Instructables
loading
loading
Picture of Arduino Most Useless Machine Ever project
I wanted to get into Arduino projects and introduce my sons to robotics using Arduino. So I thought about building a simple project that made use of an Arduino Uno and a servo. I saw a great post in Instructables about The Most Useless Machine Ever and was inspired to create an Arduino-powered version.

It was a most satisfying build experience with my sons and I learned a lot about programing the Arduino.

How does it work?

The Arduino "listens" to the state of the switch and actuates the servo when the switch is activated.

In the OFF state, the Arduino sends the servo to the reset position (box lid closed). When a user flips the switch to ON, the Arduino sends a signal to the servo and actuates a finger to push the switch to the OFF state.
 
Remove these adsRemove these ads by Signing Up

Step 1: Parts List

Picture of Parts List
IMAG1531.jpg
spdt switch.jpg
Parts list.

You will need:

- wooden jewelry box (you can get these at your local craft store for less than $5)
- Arduino UNO
- Laptop (I use a Macbook Pro)
- 10k ohm resistor
- small SPDT switch
- servo motor
- wires
- 9v battery
- popsicle sticks
- wood glue
- some 0.5" x 0.5 " wooden rod
- old coax cable
- 2 pcs of small hinges (approximately the same size of the hinges that comes with the box)

Tools:

- Dremel tool
- saw
- screw driver
- pliers
- wire stripper
- soldering iron, lead solder
- voltmeter
- breadboard
- electrical tape

Schema:

Check out the schema for the component wiring. I used Fritzing app for Mac to lay out my components.

I recommend wiring up your circuit using a bread board first. Check your servo calibration and play around with the code to achieve the desired rotation or position of your servo arms. This may vary so you need to tweak the code to achieve the right motion.
geneulm1 year ago
My wife sent me a video from a site called Gag donkey that had these. Your work is great. Thank you for posting the step by step. I am doing an Alice In Wonderland theme Halloween, this would be great to put on the front porch and see how many of the little ghosties and goblins push the switch.
Perfect toy for kids!
LOL! She's like "I WANNA DO IT!" Little kids are great.
eliolopes made it!26 days ago

Thanks ;)

I built other machine , based on your tutorial.

https://youtu.be/-bSdqhItKJE

2015-03-27 19.45.34.jpg
thecrazylol3 months ago

hey,

i also modified your code so now it also has a door servo and you can add moves, just like opening the door then close it, then open it again, switch it off and go back in the box. ;)

// Sweep

// by BARRAGAN <http://barraganstudio.com>

// This example code is in the public domain.

#include <Servo.h>

const int buttonPin = 2;

int buttonState = 0;

Servo handservo; // create servo object to control a servo

Servo doorservo; // a maximum of eight servo objects can be created

int pos; // variable to store the servo position

long timeDelay;

void setup()

{

pinMode(buttonPin, INPUT);

handservo.attach(9); // attaches the servo on pin 9 to the servo object

doorservo.attach(6);

}

void loop()

{

buttonState = digitalRead(buttonPin); // Read the button position

if (buttonState == HIGH) {

if(doorservo.read()==11){

doorservo.write(50);

delay(500);

handservo.write(11);

}

if(doorservo.read()==50){

doorservo.write(11);

delay(500);

handservo.write(11);

}

if(doorservo.read()==11){

doorservo.write(60);

delay(500);

handservo.write(11);

}

if(doorservo.read()==60){

handservo.write(100);

delay(1);

doorservo.write(61);

delay(1);

}

}

if (buttonState == LOW) {

handservo.write(11);

doorservo.write(11);

}

}

jon gucci1 year ago
Did you have to modify the servo at all for continuous rotation?