0% found this document useful (0 votes)
46 views

How To Build Another Useless Machine: Easy To Make, and Hard To Use!

This document provides instructions for building a useless machine using an Arduino board. It consists of 8 steps: describing how it works by moving servos in response to a switch, listing required parts like a box, Arduino, servos and batteries, building the box, providing a schematic, fixing the servos in place, connecting everything, optionally adding a motor, and providing the code. The machine is meant to be fun to build and watch as it moves servos in different patterns each time the switch is toggled.

Uploaded by

Dante Kindever
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

How To Build Another Useless Machine: Easy To Make, and Hard To Use!

This document provides instructions for building a useless machine using an Arduino board. It consists of 8 steps: describing how it works by moving servos in response to a switch, listing required parts like a box, Arduino, servos and batteries, building the box, providing a schematic, fixing the servos in place, connecting everything, optionally adding a motor, and providing the code. The machine is meant to be fun to build and watch as it moves servos in different patterns each time the switch is toggled.

Uploaded by

Dante Kindever
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Food Living Outside Play Technology Workshop

How to build another useless machine: easy to make, and hard to use!
by riachi on October 13, 2013

Table of Contents

How to build another useless machine: easy to make, and hard to use! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: How to build another useless machine: easy to make, and hard to use! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: How it works? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2: The parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 3: Building the box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 4: Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 5: Fixing the servos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 6: Connecting the switch, servos and Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Step 7: Optional: the DC motor and battery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Step 8: The code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

http://www.instructables.com/id/How-to-build-another-useless-machine-easy-to-make-/
Intro: How to build another useless machine: easy to make, and hard to use!
So many useless machines are built, why building another one? Simply, it is really fun :), fun to build and fun to play with.

I tried to give this version a character, as I always felt there is somebody "thinking inside the box", so here I tried, I hope I succeeded to give "her" a life!

I am really happy to share with you all the steps, with all hopes that you will be easily building yours and giving it a bitter or better character! My version is based on
Arduino, you may think it is an overkill, but given the flexibility it gave me, I think it is worth it.

Here is a video of everything put all together. Later, we will move into the parts, steps, schematics and code

Let me know your comments and/or questions if any.

Hope you enjoy!


f.

Step 1: How it works?


Everything is connected to an Arduino board, the board waits till the switch is set to logic HIGH , that is, when you flick the switch, the board signals two servo motors to
move in a specific way (more on that later), after which, the servo connected to the "hand" will flick the switch back to OFF-position, and return back into the box, followed
by the "door" servo. then everything repeats.

If you saw the above video, each time the switch is toggled, the machine responds in a different way, and this is done by simply writing different functions with different
timings in the Arduino code, (I am calling them "Moves"). Each time the switch is toggled, I am calling a new move until all are done, I start over. You can add as many
moves as you want, as long you have enough memory on the Arduino.

The Arduino is always ON, this is why I added a switch for the battery to save some power when the machine is not in use. I am already planning to use an interrupt on
the switch, instead of the current simple HIGH/LOW detection, and coupling it with sleep mode. This shall save power when the machine is not in use ,and also allowing it
to be always ready (but this will also complicate the code) So, for now, it is just a simple ON/OFF switch, and the board is always powered.

Step 2: The parts


You will need:

Mandatory:

1. A box
2. Any Arduino board with PWM outputs (I happen to have an old one laying around, the Diecimila )
3. Two standard RC servo motors (I used the Futaba - S3003, they have 3,2 Kg/cm torque, more than enough to move the door or hand)
4. A 6-12 V battery (I used my AR drone battery, it is a 11.1 v / 1000 mA)
3. An SPTT or SPST switch for the trigger (basically, any switch that suits you!)
5. Another switch for the battery
6. A push button to reset the Arduino in case you want to restart the moves/code from top.
7. Some jumper wires

Optional:

In case you want to design a move that includes moving the box around (like last move in the video), then you can get:

1. An Arduino motor shield , this will also be handy for other projects (or you can design an H-bridge yourself, search it out)
2. A cheap RC car so you can take its DC motor and gear box

Furthermore, still in the "optional" section, I've built a hardware de-bounce circuit to have a clean trigger when the switch is toggled on/off. This can be skipped and easily
be implemented in arduino software using delays or timers. I did the hardware debounce because I will be soon changing the code to use interrupts, and since the latter
do not allow the reliable use of delay/timer functions in the routine, so I had to build a simple de-bounce circuit for future use. If you want to skip this part, then just
connect a simple switch/resistor to pin 2 of the arduino and implement a software debounce routine.

For the hardware debounce:

1. 10mF electrolytic capacitor


2. 10K resistor
3. A logic NOT gate i.e Inverter (chip 74HC04) This has four inverters, but you will only need one.

Let's build it...

http://www.instructables.com/id/How-to-build-another-useless-machine-easy-to-make-/
Step 3: Building the box
You can use any box you find suitable. I built mine, maybe not perfect, but still much personal :)

1. I used 2 sheets of 5mm BALSA wood, very easy to work with using a cutter, and relatively strong given its incredible light weight.
2. Consumed 5 tubes of Cyanoacrylat glue (aka strong fast-acting adhesives)

Here it is:

A 22 x 14 x 14 cm box

Step 4: Schematic
Above is the schematic (drawn using Fritzing ), showing:

Top part: The arduino main board ,2 servos and switch connectivity. Note that as mentioned previously you can replace the whole debounce (top-right) circuit with a
simple resistor/switch.

Both "door" and "hand" servos are powered directly from the 5v pin on the Arduino. The signal wires are connected to pin 9 and 10 respectively. These pins supports
PWM, thus I am using them to control the angle/position of the servo (from 0 to 180 degree max).

Note: the red push button is just a reset (similar to the one found on the face of the arduino board). I added it to have quick access to reset the board/software at any time
without opening the box. Simply connects the RESET pin to Ground to make the reset.

Bottom part: needed if you want to use a DC motor and move the machine around. This is the arduino motor shield, it is mounted on top of the Arduino, so all of the pins
of both boards are connected to each other. I am showing them below as separated just for clarity, hopefully! This shield can control up to 2 DC motor (2 channels A/B)
with incredible ease. I am using only one now. It allows to set in the code, the direction, speed and breaks of any of the available 2 channels/motors. I am using channel B
as shown bellow. where pin
13 for direction, pin 11 for speed and pin 8 for brakes control.

The battery is a 11.1 / 1000 mA, connected to the shield, thus feeding the DC motor , the main arduino board and the servos. if you are not using the shield, then you can
directly connect the battery to the power barrel on the main arduino board.

http://www.instructables.com/id/How-to-build-another-useless-machine-easy-to-make-/
Image Notes
1. The debounce circuit
2. - The door Servo connected to PWM pin 9

- The hand servo connected to PWM pin 10

Step 5: Fixing the servos


Here is the hand and door servos installed:

You need first to install the servos in their correct places, this needs a bit of trial and error until you get the needed movement. You can use the Servo example provided
in the arduino IDE in order to test the servos and the amount of deflection needed for each, and thus decide on the final positioning and arms length for the door and
hand servos.

The arms are simply made from balsa wood, I made them thicker to withstand some tearing.

Below is how I did it. Just one note about the hand servo. You will need the servo shaft to be directly under the edge of the cover (as shown below), this to avoid having
hard time in making a hand that can successfully hit the switch, and also be able to go back into the box.

http://www.instructables.com/id/How-to-build-another-useless-machine-easy-to-make-/
Step 6: Connecting the switch, servos and Arduino
Make all the connections seen in the schematic step, and try to put all inside the box similar to what's shown above:

Image Notes
1. debounce circuit
2. A rubber band to give some tension on open and close of the door
3. This is the motor shield mounted above the arduino board

Step 7: Optional: the DC motor and battery


Above is how I put the DC motor gear box (taken from a cheap RC car), also showing the batter and switch placement.

Make sure to place the gear as centered as possible to balance the box, you may need to put some weight inside the box to balance it more after final assembly, as the
battery I used is a bit heavy (100 gr) and caused some wiggling when switching or moving the box.

Note that the dc motor speed is controlled by pin 11 , Direction by pin 13 , and brakes on pin 8, these are considered channel B on the arduino motor shield.

Through out the assembly I tried to hide all wires switches and other components in order to have a simple authentic box. This applies to the wheels, so I made a rim
around them that hosts both the wheels and battery, and also provides access to the red reset button.

http://www.instructables.com/id/How-to-build-another-useless-machine-easy-to-make-/
Image Notes
1. RESET button
2. Battery and main power switch

Step 8: The code


In order to write code for arduino, you need the arduino IDE (download it here )

I am using the version 1.0.5, just make sure to select the correct COM port (windows) and board type from within the IDE, then use the below code, and hit upload.

NOTE: The values I used in the code to set the max deflection of the servos are made exactly for this box taking in account the servos positioning and
angles. I got this through trial. So you need to devise your own values according to your box and servo placement.

For reference, below are the min/max values I used for each servo as you will see them occurring in the code:

The door:
80 hiding, 155 fully open

The hand:
0 hiding, 129 pushing on switch

Here is the code:

#include <Servo.h>
Servo doorServo;
Servo handServo;

int switch_pin = 2; //set switch on pin 2

//motor variables
int motorThrottle=11;
int motorDirection = 13;
int motorBrake=8;

int pos = 0;
int selectedMove = 0; //move selector
int Testmove = 0; //test mode: set to move number to test only one selected move
//(set to Zero to run normally i.e: roundrobbin on amm moves)

void setup()
{
Serial.begin(9600);
pinMode(switch_pin, INPUT);
doorServo.attach(9); //set door servo on Pin 9 pwm
handServo.attach(10); //set hand servo on Pin 10 pwm
doorServo.write(80); //set door to hiding position
handServo.write(0); //set hand to hiding position

//Setup Channel B, (since Channel A is reserved by door and hand servos and can't ber used at same time)
pinMode(motorDirection, OUTPUT); //Initiates Motor Channel B pin
pinMode(motorBrake, OUTPUT); //Initiates Brake Channel B pin

void loop()
{
if (Testmove != 0) {
selectedMove = Testmove;
}

//if the switch is on, then move door and hand to switch it off...
if(digitalRead(switch_pin) == HIGH)
{

if (selectedMove > 10) { selectedMove = 0; } //when all moves are played, repeat the moves from beginning
// below are all the "Moves" i designed so far, each is a function that is written below in the code, execuse the names, abit strange? yes as some are written in arabic
http://www.instructables.com/id/How-to-build-another-useless-machine-easy-to-make-/
if (selectedMove == 0) { switchoff(); }
else if (selectedMove == 1) { switchoff(); }
else if (selectedMove == 2) { switchoffbitaraddod(); }
else if (selectedMove == 3) { crazydoor(); }
else if (selectedMove == 4) { crazyslow(); }
else if (selectedMove == 5) { m7anika7anika(); }
else if (selectedMove == 6) { m3alla2(); }
else if (selectedMove == 7) { switchoff(); }
else if (selectedMove == 8) { matrix(); }
else if (selectedMove == 9) { sneak(); }
else if (selectedMove == 10) { zee7(); }

if (Testmove == 0) {
selectedMove++; //swith to next move if not in test mode
}

}
}

// Library of moves

// basic move
void switchoff()
{
//Moving door
for(pos = 80; pos < 155; pos += 3)
{
doorServo.write(pos);
delay(15);
}

//Moving hand
for(pos = 0; pos < 129; pos += 4)
{
handServo.write(pos);
delay(15);
}

//hiding hand
for(pos = 129; pos>=0; pos-=4)
{
handServo.write(pos);
delay(15);
}

//hiding door
for(pos = 155; pos>=80; pos-=3)
{
doorServo.write(pos);
delay(15);
}
}

// move 3: open and wait, then move hand and wait, then switch of and hide
void switchoffbitaraddod()
{
//Moving door
for(pos = 80; pos < 155; pos += 3)
{
doorServo.write(pos);
delay(15);
}
delay(800);
//Moving hand
for(pos = 0; pos < 100; pos += 4)
{
handServo.write(pos);
delay(15);
}
delay(1000);
for(pos = 100; pos < 129; pos += 4)
{
handServo.write(pos);
delay(15);
}

//hiding hand
for(pos = 129; pos>=0; pos-=5)
{
handServo.write(pos);
delay(15);
}

http://www.instructables.com/id/How-to-build-another-useless-machine-easy-to-make-/
//hiding door
for(pos = 155; pos>=80; pos-=3)
{
doorServo.write(pos);
delay(15);

//move 4: open door then close it many times, wait, then quickly reoprn a nd switch off and hide.

void crazydoor()
{

//Moving door
for(pos = 80; pos < 125; pos += 3)
{
doorServo.write(pos);
delay(15);
}

//hiding door
for(pos = 125; pos>=80; pos-=5)
{
doorServo.write(pos);
delay(15);
}
//Moving door
for(pos = 80; pos < 110; pos += 3)
{
doorServo.write(pos);
delay(15);
}

//hiding door
for(pos = 110; pos>=80; pos-=15)
{
doorServo.write(pos);
delay(15);
}
delay(700);
//Moving door
for(pos = 80; pos < 125; pos += 3)
{
doorServo.write(pos);
delay(15);
}
delay(700);
//hiding door
for(pos = 125; pos>=80; pos-=5)
{
doorServo.write(pos);
delay(15);
}

//----of switch of----//


//Moving door
for(pos = 80; pos < 155; pos += 8)
{
doorServo.write(pos);
delay(15);
}

//Moving hand
for(pos = 0; pos < 129; pos += 3)
{
handServo.write(pos);
delay(15);
}

//hiding hand
for(pos = 129; pos>=0; pos-=3)
{
handServo.write(pos);
delay(15);
}

//hiding door
for(pos = 155; pos>=80; pos-=15)
{
doorServo.write(pos);
delay(15);

http://www.instructables.com/id/How-to-build-another-useless-machine-easy-to-make-/
}

// move 5: open door, then move hand very slowly forward and back to hiding very slowly, then quickly close door
void crazyslow()
{

//Moving door
for(pos = 80; pos < 155; pos += 1)
{
doorServo.write(pos);
delay(30);
}

//Moving hand
for(pos = 0; pos < 129; pos += 1)
{
handServo.write(pos);
delay(30);
}

//hiding hand
for(pos = 129; pos>=0; pos-=1)
{
handServo.write(pos);
delay(30);
}

//hiding door
for(pos = 155; pos>=125; pos-=1)
{
doorServo.write(pos);
delay(30);
}
delay(100);
for(pos = 125; pos>=80; pos-=4)
{
doorServo.write(pos);
delay(15);
}

//move 6:

void m7anika7anika() {

//Moving door
for(pos = 80; pos < 155; pos += 3)
{
doorServo.write(pos);
delay(15);
}

//Moving hand
for(pos = 0; pos < 70; pos += 1)
{
handServo.write(pos);
delay(15);
}
delay(800);

//hiding door
for(pos = 155; pos>=130; pos-=3)
{
doorServo.write(pos);
delay(15);
}

//hiding door
for(pos = 130; pos < 155; pos+=3)
{
doorServo.write(pos);
delay(15);
}
//hiding door
for(pos = 155; pos>=130; pos-=3)
{
doorServo.write(pos);
delay(15);
}
//hiding door
http://www.instructables.com/id/How-to-build-another-useless-machine-easy-to-make-/
for(pos = 130; pos < 155; pos+=3)
{
doorServo.write(pos);
delay(15);
}

handServo.write(40);
delay(1000);

//Moving hand
for(pos = 40; pos < 129; pos += 4)
{
handServo.write(pos);
delay(15);
}

//hiding hand
for(pos = 129; pos>=0; pos-=4)
{
handServo.write(pos);
delay(15);
}

for(pos = 120; pos>=80; pos -= 1)


{
doorServo.write(pos);
delay(15);
}

void m3alla2(){
//Moving door
for(pos = 80; pos < 155; pos += 3)
{
doorServo.write(pos);
delay(15);
}

//Moving hand
for(pos = 0; pos < 127; pos += 4)
{
handServo.write(pos);
delay(15);
}
//hiding door
for(pos = 155; pos>=130; pos-=3)
{
doorServo.write(pos);
delay(15);
}
delay(2000);

for(pos = 130; pos < 155; pos += 3)


{
doorServo.write(pos);
delay(15);
}

for(pos = 155; pos>=140; pos-=3)


{
doorServo.write(pos);
delay(15);
}
for(pos = 140; pos < 155; pos += 3)
{
doorServo.write(pos);
delay(15);
}
delay(500);
//hiding hand
for(pos = 127; pos>=0; pos-=4)
{
handServo.write(pos);
delay(15);
}

//hiding door
for(pos = 155; pos>=80; pos-=3)
{
doorServo.write(pos);
delay(15);
http://www.instructables.com/id/How-to-build-another-useless-machine-easy-to-make-/
}

void matrix()
{

//Moving door
for(pos = 80; pos < 155; pos += 3)
{
doorServo.write(pos);
delay(15);
}

//Moving hand
for(pos = 0; pos < 80; pos += 4)
{
handServo.write(pos);
delay(15);
}

for(pos = 80; pos < 129; pos += 1)


{
handServo.write(pos);
delay(30);
}
delay(300);

for(pos = 129; pos>=0; pos-=4)


{
handServo.write(pos);
delay(10);
}

//hiding door
for(pos = 155; pos>=80; pos-=3)
{
doorServo.write(pos);
delay(15);
}

void sneak()
{
//Moving door
for(pos = 80; pos < 130; pos += 1)
{
doorServo.write(pos);
delay(30);
}
delay(2000);

//Moving hand
for(pos = 0; pos < 40; pos += 1)
{
handServo.write(pos);
delay(30);
}

delay(500);

for(pos = 130; pos < 155; pos += 4)


{
doorServo.write(pos);
delay(15);
}
delay(100);

for(pos = 40; pos < 90; pos += 4)


{
handServo.write(pos);
delay(15);
}
delay(500);
//hiding hand
for(pos = 90; pos>=70; pos-=4)
{
handServo.write(pos);
delay(15);
}
delay(100);
for(pos = 70; pos < 90; pos += 4)
{

http://www.instructables.com/id/How-to-build-another-useless-machine-easy-to-make-/
handServo.write(pos);
delay(15);
}
delay(100);
for(pos = 90; pos>=70; pos-=4)
{
handServo.write(pos);
delay(15);
}
delay(100);

for(pos = 70; pos < 129; pos += 4)


{

handServo.write(pos);
delay(15);
}

for(pos = 129; pos>=0; pos-=4)


{
handServo.write(pos);
delay(15);
}
//hiding door
for(pos = 155; pos>=80; pos-=3)
{
doorServo.write(pos);
delay(15);
}
}

void zee7()
{
//Moving door
for(pos = 80; pos < 155; pos += 3)
{
doorServo.write(pos);
delay(15);
}
delay(2000);
//forward @ half speed to the left
digitalWrite(motorDirection, LOW); //Establishes RIGHT direction of Channel B
digitalWrite(motorBrake, LOW); //Disengage the Brake for Channel B
analogWrite(motorThrottle, 100); //Spins the motor on Channel B at full speed
delay(300);
digitalWrite(motorBrake, HIGH); //Eengage the Brake for Channel B
delay(2000);

//backward @ half speed to the right


digitalWrite(motorDirection, HIGH); //Establishes LEFT direction of Channel B
digitalWrite(motorBrake, LOW); //Disengage the Brake for Channel B
analogWrite(motorThrottle, 100); //Spins the motor on Channel B at half speed
delay(300);
digitalWrite(motorBrake, HIGH); //Eengage the Brake for Channel B
delay(1000);

//Moving hand
for(pos = 0; pos < 129; pos += 4)
{
handServo.write(pos);
delay(15);
}

//hiding hand
for(pos = 129; pos>=0; pos-=4)
{
handServo.write(pos);
delay(15);
}

//hiding door
for(pos = 155; pos>=80; pos-=3)
{
doorServo.write(pos);
delay(15);
}
}

http://www.instructables.com/id/How-to-build-another-useless-machine-easy-to-make-/
Related Instructables

lego ipod dock Soldering Anti gravity survival tools in


Upgrade your Exhaust Fan /
by llama lord Yu-Gi-Oh! Duel Solar Powered Machine by iPhone box by
Laptop Cooling AA Battery Josehf Murchison jamob
Disk by Azurial
fan by aaronc00 Charger by
sgeddy

Advertisements

Comments
1 comments Add Comment

milesfromnowhere says: Oct 13, 2013. 5:26 PM REPLY


very nice!!

http://www.instructables.com/id/How-to-build-another-useless-machine-easy-to-make-/

You might also like