Auto-Opening Trashcan
Our group decided to create an automated trashcan. The opening of the lid is triggered using an ultrasonic sensor to detect an object approaching. When the object comes within the threshold distance it causes the servos to open the lid.
Supplies
The Sparkfun Kit includes the breadboard, Arduino, servo motors, wires, and an ultrasonic sensor.
Wire Arduino
- Get out an Arduino breadboard, Arduino Uno, 2 servo motors, ultrasonic sensor, and 13 wires.
- Wire the Arduino Uno and the breadboard together by connecting the "GND" and "5V" to the "-" and "+" respectively.
- Wire the signal pin on each servo motor to pin 9.
- Wire both servos to the ground and voltage on the breadboard.
- For the ultrasonic sensor wire the trigpin to pin 5 and the echopin to pin 4.
- For the ultrasonic sensor wire the ground and power to the breadboard.
Physical Construction
When constructing the physical trashcan we cut out two 6''x10'' pieces of cardboard and then two 8''x10'' pieces along with another two 6''x8'' pieces of cardboard. After cutting out all the pieces of cardboard we connected them together to create a rectangular box. Once creating the main box, we created a small compartment area to but our Arduino board. This was created using two 1.5''x6.5'' pieces of cardboard and 5''x6.5'' piece of cardboard and taped to the back of the box.
Downloads
Code
Download this code and open it in Arduino. Upload the code to the circuit board using a USB cable. Then, connect a battery pack to circuit board.