Laser Spy Game

by andyk75 in Circuits > Microcontrollers

3588 Views, 26 Favorites, 0 Comments

Laser Spy Game

SAM_5790.JPG

I have to admit that this game is not really a new idea, you've seen in in cinema and TV a thousand times.

If you know the Big bang theory then you might have seen this: https://www.youtube.com/watch?v=VTmEtzseuaA


What really makes the difference now is the availability for cheap green laser pointers and the solution for the mirrors.


Now it is possible to built up this game for just a few euros or dollars.


So: Let's get started!

Supplies

SAM_5785.JPG

What you need:

  • a green laserpointer
  • some adjustable mirrors (like these)
  • an electronic control-board.

The green laserpointer might cost you 5-10.- € if you order a cheap one over the internet in China. I hope you don't want to fry you friends (and yourself) so take a 1mW version. It is strong enough, believe me. Most laserpointers from China will have a larger output anyway. And don't ever look directly into the laser! It will blind you forever!!!!


Make the adjustable mirrors according to this instructable:

They are about 2€ per piece if you use the high quality dentist mirrors. With the standard mosaic mirrors they will be below 50ct.


And finally this instructable is about the electronic control-board.

The Schematic

lasergame_schematics2.png
I chose an Attiny84 because it has everything I need and it is quite cheap though.

I now use a special one wire bootloader to programm my microcontrollers. You can find the documentation and the sourcecode here: AVR Bootloader FastBoot von Peter Dannegger

This has several advantages:
  • you don't need a full 6 or 8-pin programming interface (socket, cables ...)
  • it works very fast, sometimes even faster than the ISP.
  • You can use nearly every pin of the uC for programming.
  • You have more pins free for other  jobs.

The only disadvantage is: The bootloader itself takes 512 Bytes of your flash memory, which cannot be used by your application. But with 8kB of memory I have a lot of left.
The bootloader has to be programmed once for each chip. Maybe I can make a tutorial on this if there are a lot of questions. But it was not my work, I just use it as it is and can only thank Mr. Dannegger for his work!

Testing the Schematics

SAM_5591.JPG
SAM_5592.JPG
SAM_5598.JPG
SAM_5594.JPG
SAM_5593.JPG
SAM_5595.JPG
The electronic control board should do the following:
  • Switch the laser on and off
  • Detect if the laser was interrupted
  • play a sound in case of an interruption
You need the following pieces:
- 4x5cm breadboard
- attiny 24, 44 or 84 (depending on your programmer)
- two pushbuttons
- two LEDs
- one FET, or a normal transistor
- some resistors and one capacitor
- some cables

I started out with a solderless breadboard for initial testing as you can see in the picture. This way I could improve the software and recognize possible problems in an early stage. Instead of sound and laser I used simple leds in the first place.

In a later stage, I replaced the poti and the LED for a red laser and the LDR built in a tube for fizzy tablets. ;-)

If you only copy my device you can skip this step. But if you have different parts, it might be good to test them also like I did.

Building the Real Board

SAM_5764.JPG
SAM_5765.JPG
SAM_5767.JPG
SAM_5769.JPG
SAM_5768.JPG
SAM_5770.JPG
SAM_5774.JPG
After the tests with the solderless breadboard were finished I decided to built the real thing. In the pictures you can see the steps from the nearly clean board to the final installation in the housing.

An interesting fact occured, when I tested the device with the final green laserpointer. Where there was no problem for the red laserpointer, the green laserpointer was quite dark, because the C-E-transition of the BC547 transistor reduces the voltage by 0.7V.
It was still visible, but only as a small dot on the wall.
So I changed the BC547 to a IRLML2502. This is a N-channel mosfet and doesn't reduce the voltage like the transistor did. It was not my first choice because of the small package. I usually use it on PCBs, but it is still possible to use it on breadboard. And this device needs an additional 10k pulldown on the gate, where I used a SMD-type.

The Software

The software running on the attiny24 is the heart of this game.

I don't want to write things double, so just download the sourcecode and adjust your pins, if you chose to use other ones than I did. Everything is explained in the code itself.

As a security feature the laser is turned off when the beam is interrupted. This way it should be nearly impossible in normal use to look straight into the laser, because the side of the head would interrupt the laser before it could hurt the eye. Entering reflective materials into the beam is very dangerous because the reflections could unwanted hurt the eye. Especially for high energy lasers (>5mW). But in that case the beam would also be interrupted, reducing the probability of injury.

DANGER: During setup the laser will not be interrupted and you handle with reflective surfaces, so take special care not to look into the beam! And use safety googles!

Connect a Laserpointer

SAM_5783.JPG
SAM_5780.JPG
SAM_5781.JPG
SAM_5782.JPG
There are several ways to connect the laserpointer to the control board. I chose one that didn't change anything on the laserpointer.

The key is a roll of paper in the length of 2 AAA batteries. The front end (negative terminal) is a bit of wire with some solder. The wire is inside the paper roll.
The positive terminal is connected to the housing of the laser pointer and done with a bent wire that is partially glued to the paper roll on the upper end.
You can adjust the thickness of the roll to smoothly enter the laserpointer and then add the positive wire to get it stuck.

Setup

SAM_5790.JPG
SAM_5784.JPG
Now you have everything together to setup the whole game.

Get the Laser on the tripod an adjust it to point into the direction of the first mirror. It is advised to spread the mirrors before switching on the laser.

Now switch on the laser and adjust the mirrors. The laser is flashing while the control is in the adjustment mode. This is a visual feedback that you are still in adjustment mode. And it will reduce the probability to hurt your eye by a misled laser beam.

If you press the start game button, the laser stays on. After a second press the start game again. This adjusts the LDR-reading to the full brightness. If the intensity of the light falling to the LDR is reduced by 30%, the uC detects an interruption and take the appropriate action.

Play!

Mods

If you have a beam-splitter you could use different laser-colors for adjustment and game. Or you could alternate the laser-colors.

If you modify the electronics and the software you could use this setup for an automatic camera device. Then you can detect and take pictures of flying bats, cats in the night or many other things.

If you use a pale red laserpointer you might not even notice if the laser is running, perfect for a hidden protection of your room.

You could even connect the detection to some computer interface and take webcam-pics once the alarm was activated.

The possibilities are boundless.