I got the idea that itâ€™d be fun to make an IR driven toy gun, and sensors that you can put on your body. Then make 10 of them and run around shooting each other. There are several commercial versions of these devices, and its quite a common team building exercise for companies. But it should be easy to make something like this DIY.
So I designed a simple circuit based on the MSP430 value line using the TI Launchpad. Itâ€™s a cheap MCU thatâ€™s relatively easy to program. Maybe not as easy as Arduino, but much cheaper.
But then I started wondering about the â€˜moralâ€™ implications of this. I donâ€™t really want my kids running around shooting each other. Iâ€™m not the kind of father who wants to buy gun toys for my children. But is it OK to make it? It sure is fun, but is it right? Iâ€™ve got a working prototype of it, but Iâ€™m not sure Iâ€™m going to proceed making it. I was planning on printing the gun itself on my plastic printer. Maybe I could find some alternative, less agressive angle to the project. But Iâ€™m not quite sure what it should be. I certainly could make it look different from a gun, but would that help?
Iâ€™ve got C-code for the MSP430 that receives coded IR signals and plays the buzzer. When the button/trigger is pressed, it sends out a coded C signal and plays a short lower tone. The pipe is used to concentrate the IR light, and seems to work ok. The IR receiver is from Sparkfun, and works REALLY well. But itâ€™s a bit expensive, so Iâ€™ve ordered some cheaper ones to try out. Iâ€™ve only tried it indoors. I guess it might not work outdoors.
Note: Iâ€™ve now also tried it with the IR RX Vishnay TSOP31238, which also works well. Itâ€™s a through-hole component and costs a couple of dollars. You need a pull-up resistor on it, and preferably an extra capacitor + resistor to filter the power.
The parts list is:
- MCU:Â MSP430G2211IN14 (part of MSP430 Launchpad)
- IR Receiver:Â VISHAY SEMICONDUCTORÂ TSOP31238
- Transistor:Â FAIRCHILD SEMICONDUCTORÂ BC337-25
- 5K ohm resistor between MCU’s pin P1.0 and the base of the transistor
- IR diode. Use one that’s got at least 100mA current, with more in bursts. As low angle as possible.
- Push button
- Power switch
- Alu tube (for directing the IR ray). Without it, the IR isn’t as directional.
Below is a picture of the components soldered together. In the end I decided not to make it look like a gun, but more like a remote control. It probably makes it more acceptable. The box is 3d printed with my thing-o-matic, and it has an integrated battery holder.
It works 🙂