Okay, let’s talk about this sensor lid trash can thing I put together.
Getting Started – Why Bother?
Honestly, my old trash can was just… annoying. The foot pedal broke, and lifting the lid with dirty hands, well, you know how it is. I saw those fancy sensor cans in stores, but the prices seemed a bit much for just a bin. So, I thought, why not try and rig something up myself? Seemed like a doable little project.
Gathering the Bits and Pieces
First step was figuring out what I needed. Didn’t want anything too complicated. I went looking for a simple setup.
- Found a basic infrared proximity sensor online. The kind that detects when something’s close.
- Needed something to actually lift the lid. I salvaged a small motor and some gears from an old broken toy. Figured that might have enough oomph.
- Grabbed a cheap microcontroller board, something easy to program, just to control the motor based on the sensor input.
- And of course, wires, a battery pack, and some tape and glue. Lots of tape.
Finding the right motor was a bit tricky. The first one I tried was too weak, barely nudged the lid. Had to rummage around again for something stronger.
Putting It All Together
This part took some fiddling. I started by taking the lid mechanism apart on my existing trash can. It was a simple hinge, thankfully.
Then, I mounted the motor near the hinge. Had to create a little lever arm out of some plastic strip I had lying around, connecting the motor shaft to the lid. The idea was simple: motor spins, pushes lever, lever lifts lid. Getting the angle and force right took a few tries. Used a generous amount of hot glue to hold the motor mount in place.
Next, wiring it up. Connected the sensor to the microcontroller input pin. Connected the motor driver (needed one because the microcontroller can’t power the motor directly) to an output pin and then to the motor itself. Powered the whole thing with the battery pack. It looked messy, wires everywhere, but I planned to tidy it up later if it actually worked.
The sensor needed a spot where it could ‘see’ a hand waving above the can, but not trigger every time someone just walked past. I ended up taping it underneath the front lip of the lid overhang, pointing slightly upwards. More tape.
Testing and Tweaking – The Fun Part
Okay, first test. Waved my hand over the sensor… nothing. Checked the connections. Ah, loose wire to the sensor. Fixed that. Tried again. The motor whirred! But the lid only opened a tiny crack. Not enough power, or maybe the lever arm was wrong.
I repositioned the lever, giving it better leverage. Tried again. Success! The lid popped open. But then it wouldn’t close. Right, didn’t program that part.
Went back to the microcontroller code. Made it simple: detect hand, run motor forward for a second (open lid), wait a few seconds, run motor backward for a second (close lid). Uploaded the new code.
Now it opened… and closed! But sometimes it closed too fast, almost trapping my hand. Other times the sensor seemed too sensitive, opening when I just walked nearby. Lots of adjustments followed. I played with the delay time before closing. I put a small piece of tape over part of the sensor to narrow its detection angle. Just trial and error, really.
The Result?
After maybe an afternoon of tinkering and adjusting, I got it working reasonably well. Wave your hand, lid opens. Stays open for about 5 seconds, then closes. It’s not as slick as the expensive store-bought ones, you can hear the little motor working, and the wiring is still a bit crudely tucked away inside the lid housing.
But hey, it works. No more touching the lid with gross hands. Cost me very little since I used mostly salvaged parts. Was it worth the effort? Yeah, I think so. It was a fun little challenge, and I fixed an annoying problem myself. Plus, it’s always satisfying when something you cobbled together actually does the job.