Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Table of Contents
Step 1: Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Step 2: Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
http://www.instructables.com/id/Build-a-big-crane-game/
Intro: Build a big crane game
How to build a whole room crane game. Based on the arcade style 'Crane Game' or 'Claw Machine'. This is a continuation of a previus instructable titled CRANE GAME
in which we built a 2-axis crane game in a door frame. We have now added a third axis and wireless control. And made it big.
Less wires - controllers and batteries move with the motors and are signaled with IR light.
Precision not needed - I was able to set-up a 8x10ft track without measuring anything
Reproducible - used standard parts, used the same components in many spots
Expandable - use longer tracks to make it bigger - track cost is about 50cents a foot.
Removable - hangs from the ceiling by 4 small hooks
Future? Could be used as basis for a big 3D printer
Overview
1. Materials
2. Frame
3. X-Axis Mechanical
4. Y-Axis Mechanical
5. Z-Axis Mechanical
6. X-Axis Electronics
7. Y-Axis Electronics
8. Z-Axis Electronics
9. IR Control Overview
10. IR Receive Circuit
11. IR Transmitter (TV remote)
12. IR Decode Process
13. X-Axis Control Code
14. Y/Z - Axis Control Code
15. What's next?
16. Complete Wiring
17. Complete Code
note: this still has some holes in it, feel free to ask for stuff
http://www.instructables.com/id/Build-a-big-crane-game/
http://www.instructables.com/id/Build-a-big-crane-game/
http://www.instructables.com/id/Build-a-big-crane-game/
Step 1: Materials
Materials:
6 - 6' J channel
7 - Big continous servo motors
1 - Roll of electrical tape
2 - Arduino UNO boards
3 - Small peices of perferatored board
2 - IR demodulator
1 - Universal TV remote control
1 - 25' coiled phone chord
1 - 15' straight phone chord
1 - Roll packing tape
1 - Pre-made claw with servo
2 - 4 AA battery packs, rechargable
6 - screw hooks
3 - Peice plywood - 2x6" each
1 - roll metal plumbers strap
Tools:
- Drill
- Computer
- Soldering iron
Step 2: Frame
Frame:
X-Axis -
-The X-Axis consists of 2 parrallel tracks mounted to the ceiling about 9' appart
Y-Axis
-One track that is supported on either end by the Y-Axis
Hang X-axis
-Put 2 screw hooks in the ceiling, one at each end of the expected X tracks
-Cut 4 peices of plumbers strap, about 6 inches long
-Thread the peice of plumbers strap towards the end of each track
-Bend the plumbers strap, like an L, so that it will hold up the track
-Hang the other end of the plumbers strap on the hooks on the ceiling
-Adjust as needed
Prepare Y-axis
-The Y axis will be suspended from the motorized carriages on the X-axis
-For now, cut 2 more pieces of plumbers strap and thread through each end of Y-axis
http://www.instructables.com/id/Build-a-big-crane-game/
http://www.instructables.com/id/Build-a-big-crane-game/
Step 3: X - Axis Mechanical
X-Axis Mechanica
The X axis has 2 motorized carrages
Attach Servos
-Attach a large wheel to the servo, use a screw
-Wrap wheel with something for friction (used this sticky foam)
-Put the servo Bracket in the slot
-Wrap servo and base with electrical tape to secure
-Repeat with the second servo
-When done, weels should be a little less than 1/8" appart (3/32" ?)
Hange the Y-axis track from these hooks using plumbers strap
http://www.instructables.com/id/Build-a-big-crane-game/
Step 4: Y-Axis mechanical
The Y axis has one carraige.
Make the carraige just like the ones for the X axis.
But -- add a third servo, tapped to the bottom of the platform. This will control the claw (Z axis)
http://www.instructables.com/id/Build-a-big-crane-game/
Step 5: Z-axis mechanical
Tie a 8-10 ft string to the wheel on the third servo of the Y axis carriage
***
Arduino pins used:
D11 IR receive
D9 Servo Xa
D10 Servo Xb
http://www.instructables.com/id/Build-a-big-crane-game/
Step 7: Y axis electronics
Master X-axis board - this attaches to an arduino, like a mini-sheild.
This board had connectors for 3 servo motors (2 for Y axis, 1 for Z). It will also have screw terminals for power. In addition to the connectors it will have an IR reciever,
this is a special component that decodes IR signals from TV remotes and then sends them out to the arduino.
Here are the parts:
See the schematic for wiring. Here are some general things to know:
***
Aduino pins used:
D11 - IR receiver
D9 Servo Ya
D10 Servo Yb
D2 Servo Z
D6 Servo Claw
http://www.instructables.com/id/Build-a-big-crane-game/
Step 8: Y and Z axis electronics
The Zaxis doesn't have it's own board. It is just goes to one of the connectors on the Y board. 1 servo opens and clses the claw, one servo raises and loweres the claw
by winding up a string on a spool.
Also - it is helpful to get everything working with wires first, then substitute the IR control. I started by sending commands from a laptop over the USB ports.
Here is the IR receiver I am using: IR Sensor IC 38KHZ Vishay Infrared Receivers - Mfg p/n TSOP38238SS1V - mouser p/n 782-TSOP38238SS1V -- Pinouts are 1:data
out, 2:Grnd: 3:Vs (supply Voltage, 5V). Facing the bump pine 1 is on the left.
http://www.instructables.com/id/Build-a-big-crane-game/
Step 11: IR Decode Process
The buttons we are using are: up, down, left, right, select, and menu. DVD players usually use all these buttons, so program the TV remote to send DVD signals from a
DVD player that you do not have.
For the univerasal remove, have used code: 1119 which is for a ACESONIC DVD player.
The code below will display the values that the arduino gets from the remote.
Write down the numbers for each button. These numbers will be added to the Arduino code.
Arduino Code:
void setup(){
Serial.begin(9600);
irrecv.enableIRIn(); // Start the IR receiver
}
void loop(){
// read IR buttons
if (irrecv.decode(&results)) {
long x = results.value;
Serial.println(results.value, HEX); //for decoding buttons
Serial.println(x);
}
delay(100);
http://www.instructables.com/id/Build-a-big-crane-game/
Step 12: X-axis control code
The X axis moves in two directions.
X-axis code:
#include <Servo.h>
#include <Wire.h>
Servo XA;
Servo XB;
int dir = 0;
int oldDir = 0;
//IR stuff
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
String action;
String oldAction;
//
void setup(){
Wire.begin();
Serial.begin(9600);
irrecv.enableIRIn(); // Start the IR receiver
}
void loop(){
http://www.instructables.com/id/Build-a-big-crane-game/
// read IR buttons and set the action //
if (irrecv.decode(&results)) {
long x = results.value;
//Serial.println(results.value, HEX); //for decoding buttons
// Serial.println(x);
timeIR = millis(); //record time of button push
switch(x){
case 351005205:
action = "up arrow";
dir = 5;
break;
case 350988375:
action = "down arrow";
dir = 6;
break;
case 350963895:
action = "left arrow";
dir = 1;
break;
case 350976645:
action = "right arrow";
dir = 2;
break;
case 350952165:
action = "ok/mute";
dir = 3;
break;
case 350986335:
action = "B2";
dir = 4;
break;
case 4294967295:
break;
}
irrecv.resume(); // Receive the next value
}
if(action != oldAction){
if (action == "up arrow"){
XA.attach(9);
XA.write(0);
XB.attach(10);
XB.write(180);
Serial.println("X go away");
delay(100);
}
if(action == "down arrow"){
XA.attach(9);
XA.write(180);
XB.attach(10);
XB.write(0);
Serial.println("X come back");
delay(100);
}
if ((action == "none") && (oldDir == 5 || oldDir==6)){
XA.detach();
XB.detach();
Serial.println("stop x axis");
}
//send commands
Wire.beginTransmission(9);
Wire.send(dir);
Wire.endTransmission();
Serial.println("send dir ");
Serial.print(dir);
Serial.print(" ");
Serial.println(action);
}
oldDir = dir;
oldAction = action;
http://www.instructables.com/id/Build-a-big-crane-game/
delay(100);
Arduino Code:
#include <Servo.h>
#include <Wire.h>
Servo YA;
Servo YB;
Servo Z;
Servo Claw;
//IR stuff
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
String action;
String oldAction;
int dir = 0;
int oldDir = 0;
void setup(){
Serial.begin(9600);
irrecv.enableIRIn(); // Start the IR receiver
}
void loop(){
// read IR buttons and set the action //
if (irrecv.decode(&results)) {
long x = results.value;
//Serial.println(results.value, HEX); //for decoding buttons
//Serial.println(x);
timeIR = millis(); //record time of button push
switch(x){
case 351005205:
action = "up arrow";
dir = 5;
break;
case 350988375:
action = "down arrow";
dir = 6;
break;
case 350963895:
action = "left arrow";
dir = 1;
break;
case 350976645:
action = "right arrow";
dir = 2;
break;
case 350952165:
action = "ok/mute";
dir = 3;
break;
case 350986335:
action = "B2";
dir = 4;
break;
case 4294967295:
break;
}
irrecv.resume(); // Receive the next value
}
if(action != oldAction){
if (action == "left arrow"){
YA.attach(9);
YA.write(0);
YB.attach(10);
YB.write(180);
Serial.println("Y go left");
delay(100);
}
if(action == "right arrow"){
YA.attach(9);
YA.write(180);
YB.attach(10);
YB.write(0);
Serial.println("Y go right");
delay(100);
}
if(action == "B2"){
Z.attach(2);
Z.write(180); //down
Claw.attach(6);
Claw.write(100); // open?
Serial.println("claw down and open");
delay(100);
}
if(action == "ok/mute"){
Z.attach(2);
Z.write(0); //up
Claw.attach(6);
Claw.write(20); // close?
Serial.println("claw up and close");
delay(100);
}
Serial.print(dir);
Serial.print(" ");
Serial.println(action);
}
oldDir = dir;
oldAction = action;
delay(100);
}#include <Servo.h>
#include <Wire.h>
Servo YA;
Servo YB;
Servo Z;
Servo Claw;
//IR stuff
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
String action;
String oldAction;
int dir = 0;
int oldDir = 0;
void setup(){
Serial.begin(9600);
http://www.instructables.com/id/Build-a-big-crane-game/
irrecv.enableIRIn(); // Start the IR receiver
}
void loop(){
// read IR buttons and set the action //
if (irrecv.decode(&results)) {
long x = results.value;
//Serial.println(results.value, HEX); //for decoding buttons
//Serial.println(x);
timeIR = millis(); //record time of button push
switch(x){
case 351005205:
action = "up arrow";
dir = 5;
break;
case 350988375:
action = "down arrow";
dir = 6;
break;
case 350963895:
action = "left arrow";
dir = 1;
break;
case 350976645:
action = "right arrow";
dir = 2;
break;
case 350952165:
action = "ok/mute";
dir = 3;
break;
case 350986335:
action = "B2";
dir = 4;
break;
case 4294967295:
break;
}
irrecv.resume(); // Receive the next value
}
if(action != oldAction){
if (action == "left arrow"){
YA.attach(9);
YA.write(0);
YB.attach(10);
YB.write(180);
Serial.println("Y go left");
delay(100);
}
if(action == "right arrow"){
YA.attach(9);
YA.write(180);
YB.attach(10);
YB.write(0);
Serial.println("Y go right");
delay(100);
}
if(action == "B2"){
Z.attach(2);
Z.write(180); //down
Claw.attach(6);
Claw.write(100); // open?
Serial.println("claw down and open");
delay(100);
}
if(action == "ok/mute"){
http://www.instructables.com/id/Build-a-big-crane-game/
Z.attach(2);
Z.write(0); //up
Claw.attach(6);
Claw.write(20); // close?
Serial.println("claw up and close");
delay(100);
}
Serial.print(dir);
Serial.print(" ");
Serial.println(action);
}
oldDir = dir;
oldAction = action;
delay(100);
http://www.instructables.com/id/Build-a-big-crane-game/
Step 15: Play with it
Give the conroller to the kids and let them go nuts. The whole thing does move a bit slowly, but that is probably for the best.
http://www.instructables.com/id/Build-a-big-crane-game/
Step 16: What's next
A few basic things to improve:
Claw is not great, probably just need more power to the open/close servo
Batteries have to be removed and to recharge them, so that is a hassle
If you move to a different spot in the room the controls no longer make sense
http://www.instructables.com/id/Build-a-big-crane-game/
Step 18: Complete Code
Here is all the code in one place:
Related Instructables
knex claw
machine [first
Marc's entries CRANE GAME My mini bartop K'nex Claw Arcade Machine
to on site] that has
by marc.cryan arcade machine Machine Game (Photos) by instructans by
Sparkfun/Ponoko/GeekDad (pacman)
Contest (Photos) (video) by hacker3455 knexinventer
(Photos) by T86157
by marc.cryan
newtonn2
http://www.instructables.com/id/Build-a-big-crane-game/