Introduction: Servo Controlled Labyrinth

Do you know this classic wooden labyrinth game with two knobs for X and Y rotation?

So, I've decided to modify one by connecting two standard servos to the knobs and let a microcontroller (ATmega32) play the game.

Credits:
- To CarlS www.instructables.com/id/Servo-Controlled-Marble-Maze/ for inspiration.
- To the AVR freaks www.avrfreaks.net especially Dean (aka abcminiuser) for his excellent tutorials.

Please, feel free to write ideas for improvements and modifications.


Step 1: Materials, Parts and Tools

I found all the materials for this project laying around at home and there were no plans nor designing. I just took the materials and thought how I can assemble them altogether.
You can use other materials and basically it's a good practice to design and make plans beforehand.

Materials:
1 wooden Labyrinth - 280/230/60 mm
1 wooden board - 400/350/20 mm
4 pieces of wood – 30/30/10 mm
2 pieces of wood - 150/155/10 mm each
2 pieces of wood, L shaped – 120/27/4 mm each side
4 pieces of wood, L shaped – 34/32/8 mm & 18/32/8 mm each
600 mm long strong silk string
8 pieces of rubber – 30/30/1 mm each
4 L brackets, stainless steel – 32/32/1.5 mm each
8 bolts (40/5 mm) with nuts and washers
A bunch of small wood screws and nails
a piece of paper, A4 for example
hot-glue
contact adhesive
insulating tape

Parts:
2 Hitec HS-311 Standard servos
AVR ATmega32 and a programmer – I use the AVR-LIP (EC-AVR) by DeccanRobots
2 straight switch knobs
1 breadboard
Some wires and pins

Tools:
saw, screw-driver, hammer, sharp knife, scissors, clamp etc.

Step 2: Labyrinth Modifications

Cut the servo horns (#13 R-D) just to make it symmetrical and use a hot glue to connect it to the switch knobs (90 deg. to the knob's pointer).
Replace the two wooden side knobs with these switch knobs in order to calibrate the labyrinth easily.

To improve the strings/bars friction, replace the two nylon strings with a strong silk string and put some contact adhesive around the steel bars.

Put insulating tape on the inner side of each labyrinth's hole and round pieces of paper on the outer side so the ball will stay on the board as long as you test the game.

Step 3: Servo Modules

Each servo sits in its own holder and each such servo module connects to the main board with bolts, nuts and washers. This way it's easy to adjust the servo to the labyrinth knobs.
Just follow the attached photos and you'll understand how to assemble it all.

Now, few things:
- Don't drill holes for the servos before you know the proper height acording to the knobs.
- You will have to make room for the servo's cable, do it carefully.
- Drill the holes on the main board much wider than the bolts of the servo modules.

Finally,  Add the two long wooden "L" to the main borad.

Step 4: The Controller

PWM
A standard servo operates at 50Hz which means it needs to get a pulse at its control line (Hitec - the yellow one) every 20ms.
The width of the pulse in its active state (duty cycle) determines the angle of the servo.
This modulation of the pulse width known as PWM - Pulse-Width Modulation.
1.25 ms - 0 deg.
1.50 ms - 90 deg.
1.75 ms - 180 deg.

The Code
The best method - correct me if I'm wrong - to create PWM with ATmega for two servos is by connecting the 1st servo to OC1A and the 2nd one to OC1B and program each of these timers to output PWM.
Now, the development board I have and use is AVR-LIP (ECAVR) and OC1A and OC1B are already taken by the LCD and by the piezo buzzer.
So - with the help of [frakk2136] www.avrfreaks.net/index.php -  I used different method.
I programmed OC1A to produce fast PWM and used interrupts while the servos are connected to PA4 & PA5.
You'll have to modify the code according to your system.

Some Comments
Three versions here:
Labyrinth_Auto
The game automatically played according to a set of instructions.
The code works great, but the labyrinth mechanism just cannot be calibrated well enough.
Now, add some physical factors like gravity, friction, tension (especially this X-factor) etc. and, well, sometimes the ball fall into this hole and sometimes to that one.

Labyrinth_Manual_RS-232
The microcontroller gets instructions from the PC keyboard (arrow keys) through the serial port.
The AVR-LIP works at 4Mhz so the maximum baud-rate that it can handle with no errors is 19200 which is too slow and not so comfortable.

Labyrinth_Manual_Switches
Four switches are connected to the AVR.
Works great.

TODO
[ X ] Analog Joystick
[ X ] Digital Joystick
[ X ] Accelerometer
[ V ] Switches
[ X ] Computer Vision

* ([ X ] | [ V ] = Status)

Comments

author
Bellerophon2200 made it!(author)2013-01-03

This is awesome! I used to own one of these when I was much younger. Now I can win every time haha.

author
AJMansfield made it!(author)2012-11-01

You need a video showing it beat the game, not just starting.

author
opiesan made it!(author)2011-05-30

I've seen something similar a few years ago where the labyrinth was controlled via a Wii fit board. A very cool project indeed.

Would it be much harder to do something similar with a foosball table? I've seen a basic one made entirely out of wooden dowel rods and thin, flat wood pieces for the players. It would be interesting to build a scaled down model with only a couple of rods for each team, then set up two microcontrollers to battle it out. Likely a LOT more complicated than it sounds but it would be a great project.

author
tburde made it!(author)2011-05-29

or, if you had an NXT set, jailbreak a friends iPod and use LegoDrive :P to control the NXT directly...

author
graffix made it!(author)2011-03-10

Nice project, I'm trying to do the same thing.Just have a question or a comment realy.You didnt have any problems keepn this calibrated?

author
Waren-Neutron made it!(author)2010-10-06

it is a funny video

author
sharvel87 made it!(author)2010-08-16

Hi, Can you please tell me what kind of servo fittings did you use to interface the servos with the switch knobs. Thanks in advance for your help :D

author
nivini made it!(author)2010-08-16

Hi, you can get the answer from the photos on step 2 and step 3 :)

author
HMBeck made it!(author)2010-05-17

 If you transferred the idea across to Etch-a-sketch, ensuring that the servos were fast enough and if you had some very good programming and electronics knowledge, you could maybe make an Etch-a-sketch CNC monitor that refreshes every four seconds or so. It would look great (even if practicality would be low).

author
q_businessman made it!(author)2010-01-24

 Haha, i found one of those Labyrinth Games for $3 at a yard sale a few months ago! WOO!!

author
instructables12354 made it!(author)2010-04-06

I too just got one at a second hand store. I think this was very well done but destroys the modern-day purpose of a fun game using no electricity or batteries or motors. Just wood metal and springs.

author
northconnor made it!(author)2010-01-18

Great job. Have you thought about making it controllable from an iPhone/iPod Touch using the accelerometer?

author
nivini made it!(author)2010-01-19

I've got no iPhone/iPod, but I'm gonna check any kind of controller with this game. thanks :)

author
amando96 made it!(author)2010-03-04

 Very good project, now add a wii nunchuck! (ebay, very cheap ones there)

author
M4industries made it!(author)2010-01-27

 Coolest instructable I've seen in a while.

author
nivini made it!(author)2010-01-27

Thx ☼

author
Doctor+What made it!(author)2010-01-18

 I've never actually seen one of those ball labyrinths before.  Very fun looking.  

About This Instructable

23,783views

58favorites

More by nivini:SCRUM monkeyCicadaboom - 8 step sequencer and a simple synthServo Controlled Labyrinth
Add instructable to: