Introduction: Trash Can Secret Compartment (Electronic)

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.

Step 1: The Parts

  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

Step 2: Making the Lid and Preparing the Servo

  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.

Step 3: The Electronics and the Switches

  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; }

Step 4: Finishing the Trash Can

  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!

Comments

About This Instructable

1,309views

3favorites

License:

More by raghav_anand98:unKnockiThe Sunrise Alarm Clock The WhiteSoftboard
Add instructable to: