Have you ever seen a bin of garbage and felt a bit disgusted by it, but you still had to throw your garbage away, forcing you to open it? Well, no longer with this project! In this project, you'll learn how to build an automatic garbage opener.
CircuitConnect your stepper motor to the ULN2003 module. Then, connect pins IN1 - IN4 to the Arduino pins 8 - 11, respectively. Connect the + pin on the ULN2003 to the 5V pin on the Arduino, and the - pin on the ULN2003 to the GND pin on the Arduino. This is the circuit for the stepper motor.
Connect the Trig and Echo pins on the Ultrasonic Sensor to pins 4 and 3 on the Arduino, respectively. Connect the VCC pin to another 5V pin on the Arduino, and connect GND to another GND pin on the Arduino.
With that, the circuit is all ready to go!
CodeThe code is available at the bottom of the page. Upload the sketch to the Arduino.
BuildTape or glue your components and circuit to some kind of platform, I used a square of cardboard. Attach the platform to a wall. Attach a spool of thread to the shaft of the stepper motor with hot glue, so that the spool rotates with the motor. Take your garbage bin and place it near the wall. Unravel your thread and tape/glue/fasten the end of the thread to the back of the garbage bin lid. Plug the Arduino into a socket and wave your hand in front of the sensor, and the motor will turn the spool, reeling in the thread and pulling up the lid automatically. You may need to experiment with different angles and lengths of thread.
FinalResult
You should end up with something like this!
Comments