Candy dispenser
this week, I wanted to create a circuit to perform a function from my final project, which dispenses candy, so if we put our hands, it gives us candy
software
Arduino IDE
Electronics
component list
Schematic view
Final code and blocks
Coding with Arduino IDE
Reading pins of the ultrasonic sensor and detecting it as output
Reading pins of the servo motor and detecting it as input
Final with Arduino IDE
Final Tinkercad video
wiring the circuit
Putting an ultrasonic sensor (Input)
the yellow wire connected to +ve
the purple wire (TRIG) connected to pin 4
the blue wire (Echo) connected to pin ~5
the grey wire connected to GND
Putting a micro servo motor(Output)
the red wire connected to +ve
the orange wire connected to pin ~3
the brown wire connected to GND
Putting a slide switch
the red wire connected to +ve
the orange wire connected to pin 2
the black wire connected to GND
The final circuit
Radwa, a fellow participant in the Maker Diploma, helped me to know how to get the component list and Schematic view from TinkerCAD
First, the on/off switch didn't work when I switched it off; it flowed current, so the ultrasonic was always on.I used an avometer to detect where the problem is. I found that the switch always allows 5V to go. I replaced it with a slide switch
I learned how to search for the components and how to program them
Title of Media
In the extra session,
I made a circuit using copper tape
I weld the components on the PCB