loading

This guide will demonstrate how to create a simple useless box. I estimate this could be built perfectly in approximately 6 hours. It requires basic knowledge of circuits, the Arduino IDE, and 3D printing is nice, but not necessary. My device is not overly complex, and could perhaps be simplified even further!

This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida. (www.makecourse.com)

Step 1: Preparation

Every item one could need for this project can be purchased locally or via Amazon.

Things you will need:

Arduino UNO R3 board ~$12

Project box ~$10

Mini breadboard ~$2

Jumper wires ~$6 (100ct)

SPDT toggle switch ~$6

Servo with metal gear ~$10

Servo mount (requires access to a 3D printer, woodworking capabilities, or any suitable DIY alternative)

Lever arm (requires access to a 3D printer, woodworking capabilities, or any suitable DIY alternative)

Mini metal hinge ~$4 (5ct)

9V battery ~$6.50 (2ct)

9v battery connector ~$3.00 (10ct)

10k ohm resistor ~$5 (100ct)

Soldering iron ~$40 (optional)

PC or Mac with USB port capable of running Arduino software

Step 2: The Circuit

The circuit is very simple.

Power is provided to the Arduino by the 9v battery with connector attachment.

From there, supply power to the breadboard with the 5V and GND pins.

For the servo:

The servo has 3 wires: power (red), ground (black), and signal(yellow). Use jumpers to appropriately connect the power and ground to the breadboard, and connect the yellow wire to pin 9 on the Arduino.

For the switch:

The switch has 3 blades which should be soldered or crimped using a reliable method to secure the connection. These connections are labeled: power, gnd, and acc. Connect the power to the power rail on the breadboard. Connect the ground blade to the ground rail on the breadboard, and connect the 10k ohm resistor (also from ground rail of breadboard) towards the center of the breadboard. (This causes the resistor to act as a "pullup" resistor for the signal, which will filter the "noise" created and ensure the Arduino doesn't think the switch has been toggled when it hasn't.) Then connect the acc (signal) connection next to the pulldown resistor. Finally, attach an additional wire right next to this wire to pin 8 on the Arduino.

Step 3: The Code

The code is also very minimal. It only consists of a single if-else conditional statement. A builder will need to adjust the positioning of the servo according to his or her specific model. Adjusting the servo movement will take a lot of tweaking!

/* Richard Solomon<br> MAKE course 
 Spring 2015 */
#include  //import Servo library
Servo myServo; //naming the servo
int toggleSwitch = 8; //declaring toggleSwitch as a variable
void setup() {
  myServo.attach(9); //attaches servo to pin 9 to receive servo position
  Serial.begin(9600); 
  // initialize serial communication at 9600 bits per second:
  pinMode(toggleSwitch, INPUT);
  //attach toggleswitch to pin 8 to receive serial data
}
// the loop routine runs over and over again forever:
void loop() {
  int switchState = digitalRead(toggleSwitch); 
  //reads binary position of digital pin input #8, toggleSwitch, 
  //and assigns to variable "switchState" where 0=OFF, 1=ON
  int pos=20;
  // "OFF" position for servo
  if (switchState==0)
  //if switch is turned OFF
  {
    delay(150); //wait 150ms 
    //delays are for stability
    Serial.println("OFF"); //print "OFF" to serial monitor
    myServo.write(115);    //ensure servo is in initial OFF position
    Serial.println(115);   //writes servo position to serial monitor
    delay(25); //wait 25ms                
  }
  else if (switchState==1)
    //if switch is turned ON
  {
    delay(150);            //wait 150ms
    Serial.println("ON");  //print "ON" to serial monitor
    myServo.write(35);     //extends servo arm by rotating 80°
    Serial.println(35);    //writes servo position to serial monitor
    delay(25);             //wait 25ms
  }
}

Step 4: The Design

Designing the useless box is where all the imagination takes place! Of course the variations are unlimited, so I will describe the process I underwent.

For the closed portion of the lid, (the static portion with the switch) I offset the hole for the toggle switch slightly off center in order for my particular lever arm to strike the switch in the correct position. I reused a part I acquired from a toy instead of 3D printing this part. I could have easily produced a new lever arm, but this part fit perfectly and made me feel good about recycling it. Using a laser cutter, I then cut out the holes for the screws that attach the lid to the box, etched out some letters, and raster engraved a cute kitten.

The only 3D printed part I used in my design was the mount to attach the servo to the box. I simply measured the dimensions of the servo and created a model using Solidworks. I added a slot for the servo wiring to fit through, and made many, many, prints due to tolerance errors. 3D printing is a long, arduous task which I think is ultimately unnecessary for this project.

Attaching and aligning the flappy (opening) portion of the lid was probably the trickiest part of this whole project. The first hinge I tried was too stiff, so I was forced to find one with a looser fitment. I also could not figure out a way to attach the hinge to the box without it poking out the back. I wanted the assembly to be completely concealed to add to the mystique the box attracts. It wouldn't fit no matter what I did! Eventually, I figured out that I had to reverse the hinge by gently hammering out the pin, then switching the orientation of each hinge piece, and replacing the pin. This allowed me to place the hinge on the inside of the box as desired. My next complication arose when attaching the hinge to the box. Since I only had access to one project box, I didn't want to drill inaccurate holes because my box would be ruined. Instead, I super glued the bottom portion of the hinge to the box, which allowed me to drill holes into the lid. Unfortunately, my drilling must have been imprecise because the lid never completely aligned properly. In hindsight, I feel this could have been avoided by marking the positioning of the hinges instead of simply "eyeballing" it.

Finally, I also reused a kitty head I had lying around to give the aesthetic of a cat poking out of the box to turn the device off.

Step 5: Conclusion

In conclusion, this project is a simply weekend DIY project that is relatively inexpensive and provides endless entertainment! (until your battery runs out of course)

<p>These boxes are awesome. Thanks for sharing!</p>

About This Instructable

1,615views

13favorites

License:

More by skatethestate:How to build a useless box 
Add instructable to: