Building an Arduino laser maze – part 1
What is a laser maze? Well, imagine a darkened room filled with smoke, where you can see a series of laser beams. If you can get from one end of the room to the other without tripping a laser beam, then you’ve made it. Of course, this is pretty damn hilarious when done at a party where everyone is a little bit drunk anyway. Which was exactly the circumstances through which I was introduced to laser mazes; A few months ago, my friend Gwyn set up a laser maze for a party I had, and it was an all-round smashing success.
I’m not entirely sure how Gwyn built his laser maze (I know Rails and a laptop were involvec), but once the hang-over wore off the next day, I decided I simply had to build my own. Except I decided to play the lovely game of one-up-man-ship with Gwyn; My laser maze would have to be completely self-sufficient, without needing a laptop to function.
Now, I’m a reasonably geeky type person, but I know very little about electronics indeed. So, in order to build a laser maze, I’d best start learning. So learning I did. I picked up an Arduino (an open-source electronics prototyping platform), a load of electronic components, and decided to get started.
My laser maze, I decided, would have to do the following:
1) Use between 1 and 5 lasers (automatically configured: it’d automatically have to find out how many lasers were available. I also decided I was going to program the laser maze software so it would be expandable to even more lasers).
2) Have 2 simple push-buttons: One which enables all the lasers so it becomes possible to set the maze up without tripping the lasers all the time. The second pushbutton would reset the system, in preparation for the next try of tackling the laser maze
3) Would have to be auto-calibrating. (This, it turns out, is quite easy: Take a reading from all the sensors for 1 second, find out what the lowest reading is for each sensor during that second, and then subtract a couple as a safety buffer – once someone breaks the beam, the reading drops below the automatically calibrated reading, which trips the trap)
4) Once someone trips a laser-beam, all other lasers switch off, and the laser that was tripped starts blinking. A buzzer would also have to sound, because I’m cruel like that.
When everything comes to it, it turns out that the actual code is pretty straightforward. The electronics involved are as well; 2 pushbuttons, 5 power sources (the lasers), 5 sensors. Pretty easy.

A very simple circuit used to test and calibrate som eof the code. Put a piece of paper between the LED and the photosensitive resistor (i.e. ‘breaking the beam’), and the Arduino trips the laser trap. (cue buzzers and blinking lasers)
Now, I’ve got all the code written, and I have the laser maze working both in theory and in theoretical practice (that is; I’ve wired everything up, and used simple photoresistors as sensors, and LEDs as ‘lasers’.) In theory, I just need to replace the sensors with slightly more hard-wearing ones, and the LEDs with laser modules (these cost £2 in the US, and £9.99 from Maplins, so I’m going to have to order some from abroad, I think). Finally, I’ve got to wire everything into a good project box, so the electronics are safe and dry, the lasers and sensors are easy to set up and dismantle, and so the whole thing is easily portable.
Stay tuned, as I’m hoping to actually build this thing in the next few weeks; I reckon it’d make a great party game for, say, a house-warming party. Good job I’m about to move back to London (Bethnal Green, in case you’re curious), then!
No Comments »
RSS feed for comments on this post. TrackBack URL
