Trash Can Secret Compartment (Electronic)

by raghav_anand98 in Circuits > Arduino

1718 Views, 3 Favorites, 0 Comments

Trash Can Secret Compartment (Electronic)

Secret Trash Can Compartment

What is the one place nobody looks for your stuff? The trash can of course. This project will show you how to build a trash can that opens up a secret compartment when you push the pedal down for 30 seconds.

The Parts

DSCN4458.JPG
DSCN4459.JPG
  1. Wood
  2. Hinges
  3. Screw, nuts and bolts
  4. Lever switches
  5. A servo motor
  6. Arduino
  7. 9V power supply
  8. Wire
  9. A trash can

Making the Lid and Preparing the Servo

DSCN4460.JPG
DSCN4461.JPG
DSCN4462.JPG
DSCN4463.JPG
DSCN4464.JPG
DSCN4465.JPG
DSCN4466.JPG
DSCN4467.JPG
  1. Measure out the dimensions of your trash can. Use a trash can which is preferably square and doesn't have tapering edges. Sketch this out on a computer and then cut it out from 1/4" thick plywood.
  2. Attach a hinge at the bottom of the two pieces leaving a gap for the pieces to move upwards (opposite to the point where the hinges are.
  3. Attach an aluminum or wood rod to the servo using nuts and bolts. Make sure that it is well attached and cannot move freely.
  4. Attach the servo to one side of you lid (on the same side as the hinge) and make sure the rod goes halfway into the other piece of wood.
  5. Sandwich the aluminum rod between two pieces of wood and attach that to the other piece of wood. This is your locking mechanism. (Look at the picture if you don't understand)
  6. Attach a flat sheet to the top of you lid to make it the same colour as your trash can without any gaps in between.

The Electronics and the Switches

DSCN4470.JPG
  1. Upload the below code to your Arduino and attach a lever switch to pin 2 (using a pull down resistor) of the Arduino and a servo motor to pin 6.
  2. Use a 9V power supply for the Arduino and use another lever switch to toggle power supply for the Arduino.
  3. Attach the switches as shown in the picture in such a way that they are pushed when you press the pedestal.
  4. Thread the wires through a hole in the trash can and into the Arduino inside the trash can.

Arduino Code

#include<Servo.h>

Servo myservo;

const int buttonPin = 2;

int buttonPushCounter = 0;

int buttonState = 0; // current state of the button

int lastButtonState = 0; // previous state of the button

void setup() { // initialize the button pin as a input:

pinMode(buttonPin, INPUT);

myservo.attach(6);

myservo.write(0);

Serial.begin(9600); }

void loop() { buttonState = digitalRead(buttonPin);

if (buttonState != lastButtonState) {

delay(20);

if (buttonState == HIGH) {

delay(30000);

if(buttonState==HIGH){

Serial.println("Servoopen -- digitalWrite servo to 90");

myservo.write(90);

digitalWrite(13,HIGH); } } }

lastButtonState = buttonState; }

Finishing the Trash Can

DSCN4469.JPG
  1. Attach the lid to the inside and wire everything up
  2. Cover the electronics in the bottom with a piece of cardboard the same colour as the rest of the trash can.

And your secret trash can is done!