Push Button Hidden Drop Down Compartment

by degord2 in Living > Hiding Places

3997 Views, 60 Favorites, 0 Comments

Push Button Hidden Drop Down Compartment

IMG_7911 2.jpg
IMG_7910 2.jpg

This Instructable shows how to create a secret drop down compartment which is controlled by a servo motor to hold cash or other smaller items. The compartment is controlled by a mini push button switch which is connected to an Arduino Nano. To power the whole unit, a 6 foot Mini USB-B cord is connected from the Nano to a power strip. I tried to utilize relatively easy to find components, so hopefully this design is accessible for others who want to try it out. I installed it under a bookshelf in my room, but it can be hidden just as easily under desks, tables, or anywhere else you'd like!

Supplies

(1) Arduino Nano

(1) MG90S servo, servo horn, and mounting screws

(1) Mini push button switch

(1) 6 foot Mini USB-B to A cable (plugged into USB port on a power strip)

(5) Mounting screws

Wires

Super glue or hot glue gun (optional)

3D Print Cash Tray and Electronic Storage Compartment

Screen Shot 2020-08-10 at 4.18.19 PM.png
Screen Shot 2020-08-10 at 4.18.32 PM.png

3D print both the Cash Tray as well as the Electronics Storage Compartment using supports for the overhangs. I used a 20% infill, but feel free to adjust this to your preference. Carefully remove supports when finished printing.

Servo Motor and Cash Tray Installation

IMG_7890 2.jpg
  • Feed the servo wiring through the side mount hole.
  • Screw the Servo Motor to the electronic storage compartment on each side of the motor.
  • Align the Storage Tray onto the outside peg and in the Servo Horn slot on the Cash Tray arm. ***Be careful to not snap the arms off the Cash Tray when doing this!***
  • Screw the Servo Horn mounting screw through Cash Tray arm and into the motor.

Wiring and Installing Electronics

Screen Shot 2020-08-10 at 3.17.18 PM.png
IMG_7897 2.jpg
IMG_7894 2.jpg
IMG_7886 2.jpg
  • Solder 6 wires to the Arduino Nano on D8, D6, 5V, 3V3, GND, and GND pins.
  • Solder the wires from the D8, 5V, and GND pins to their respective Servo connections.
  • Solder a 3.3kΩ resistor to the wire from 3V3 pin.
  • Solder a 3.3kΩ resistor to the D6 pin wire.
  • Solder the D6/3.3kΩ wire to the Mini Push Button Switch.
  • Solder the GND wire to the Mini Push Button Switch.
  • Fit the Mini Push Button Switch into the hole near the front and apply a small amount of glue to hold it in place if necessary.
  • Fit the Arduino Nano Mini USB-B connection through the slot in back of the storage compartment and glue the Arduino to the compartment if desired.

Upload Code and Test

IMG_7891.jpg

Hook up the Arduino to your computer and upload the code below. Then press the push button to test that everything functions correctly. Currently, the drop down angle is set at 55 degrees. If you want to change this then subtract your desired angle from 180 and put that number in place of 125 on the "servo.write(125);" line of code.

 #include <Servo.h>;

 const int buttonPin = 6;
 const int servoPin = 8;
 Servo servo;

int count = 0;
void setup()
{
  servo.attach (servoPin);
  pinMode(buttonPin, INPUT);
}

void loop()
{
  int buttonState;  
  buttonState = digitalRead(buttonPin);
  
  if (buttonState == LOW)
  {
    count++;
    delay(400);
  }

  if(count == 0)
    servo.write (180);
  else if(count == 1)
    servo.write(125);  
  else (count = 0); 
}

Mount Compartment

IMG_7918 2.jpg
  • Drill 5 pilot holes underneath a shelf, desk, or table.
  • Install the mounting screws to secure the compartment to the underside location.
  • Connect the Mini USB-B to A cable from the back of the compartment to a power strip with a USB port.

All Finished!

Secret Cash Compartment