this is week 2 page.

Input Devices


Group assignment:

Individual assignment:

for this week assignment we have been asked to go deeper into electronic, specifically this week we will focus on input devices, and we should test it on a board that we designed, so as start i will make a new board to work with this week and i will planned a head so i can use it also for Output device

Designing New Board

as i have already explained the process in more details in electronic Design Week i will not put full details here again , just i will add the main steps

I will use ATtiny45 on this assignment margin cut

Add component

kicad- cut

connect them to Attinu45s

kicad-design02 cut

check the connection with design rule


after Checked the design rule i found there were no problem in the connection

Annotate schematic symbol


Assign foot print

in this step you can see the foot print for each component and make sure that you have choose the correct one

footprint cut

Generate Netlist

netlist cut

load netlist in PCB layout

from the pcb layout top bar click load netlist, then choose the one you saved in the past steps.

 netlist  netlist

Adjust Trace Thinkness and Clearance

next is to adjust the setup from file –» board setting — »> Net classes


connect Traces to components foot-print

this seams to be one of the tsaks that east most of the time, every time i design a new board i take most of the time finding the best way to route the traces, i had to delete the FTDI header since i will use ISP programmer , and deleted the LEDs i will use it outside the board.

after that i ended up with this design

munzir al radi board

fill it with copper to connect the grounds

munzir al radi board

export the deign

now export it as svg ,


generate a tool-path

i used mods To generate the tool psth for the desing in order to prepare it to cut it with Roland- SRM20 munzir al radi board

Mill it with SRM-20

after that send the file to the printer to start milling it , you can refer to my assignment electronic production for more information about the exact steps to cut the machine


Milling Result

mill-result board

Soldering Result

mill-result board

lets run the programmer i will use Arduino as ISP


connect isp with arduino


if you dont know how to upload the program follow my steps that i have explained in Embedded Programming upload the first example

Push button

one of the most important input devices is the push button, its important that you know how its connected and how to make use of it

mill-result board

the push button we are using have internal connection pin 1 -3 connected also 2,4 make sure to have it tested before going further, you can do that by simply connecting one side to 5v and the other side to led, you can also do the test with multimeter, but since the bread board is front of me i found this way is faster

input pull down

i have added 10K resistor going to the ground to make sure that the reading is sooth

mill-result board

input button to enable led

the program is simple , if the button is pressed , turn on an LED otherwise keep it off

you can download the code from here


LDR It stands for Light Dependent Resistor or Photoresistor, which is a passive electronic component, basically a resistor which has a resistance that varies depending of the light intensity. mill-result board

to connect it with our board we need to connect one leg to input and wit 5k resistor pullup , the other side to ground as shwing here

mill-result board

with same function of the least program we can read analog signal, if the reading is more than specific value turn on an LED other wise keep it off.

but first lets connect it with Arduino to see the value that i will depends on, i will use ready example in Arduino , " analog read serial "

depending of this Value i can say that if the value is less then 200 its mean dark , and if its more its mean there is alight, so will write my program this way, and upload it to my board

you can download the code from here

push button serial

next i wanted to test the serial communication to read the value of my sensors in arduino serial monitor,

i found that serial function will not work directly, so i hade to use software serial and here is the result