the assignment was about to create a circuit that takes an input to control an output
this is the model I chose to make. I was thinking about making an alarm that can be switched on or off by a switch.
I used tinkerCAD for the simulation
used materials :
buzzer
slideswitch
led and green led
jumper wires
arduino uno
some cardboard and sellotape
the device contains one input and 3 outputs:
1 - a switch controlling the circuit (input)
1- red led light when switch is on (output)
3- buzzer when switch on ( output)
4- green led when switch is off (output)
the code blocks :
first we read input (pin 7) if high then buzzer and red led works else (low) green led works
slideswitch connected to pin 7
red led is at pin 4 , while green led at pin 3
buzzer at pin 2
full circuit
slideswitch
the arduino code :
first i identified the used pins which are 7 , 2,3 and 4
then i made a loop when switch is on red led and buzzer are on while green led is on while switch is low
when I tried to apply the circuit on the breadboard it wouldn't start unless I was touching it and touching the ground
i asked the instructor and he said that maybe the breadboard is not working properly or a jumper wire is defected.
i tried to change the bread board and it worked
defected board
working board
getting to know how to design 3D designs will surely help me in my final project