May 04

Laser Tag Update 5/3/15

My deliverables from last month were to:
1. Build a receiver unit. (IR receivers with indicator LED)
2. Adjust code for first game played

1. I arranged IR receivers in a circle,and they all read. I soldered them onto a spare piece of board and built two. After the fact, I decided to add an additional LED onto the receivers so that you would have LED indication on the lens tube when you are tagged or when you send a tag.
2. I changed how my LED's (for indication, not for tagging) turn on and off. I wrote a function that handles all of the indication LED's. With some modification, I could have it run RGB LED's and change their colors without using the built in PWM. The color may change a little bit when you send or receive a tag, but other than that, it should be able to control them pretty easily (during the time that you send or receive a tag, you would not be turning the LED on or off, so the color may be a little different.)

Note: I could change my code that sends and receives tags to send/receive a pulse and then go back into the main loop until I need to send/receive a pulse again. I'm not sure that I'll need to do this, but it is a possibility if I want to run through my main loop faster (and not have to wait for a tag send/receive to complete before going through the main loop).

At this point, I have two tag units, they both are running the current code, and I am ready to actually test playing laser tag. During that test, I should figure out what I should add to make the game play better. I have some other items that I would like to add, and in no particular order, here are some of them:

To add Later:
1. Telegraphing
2. Health bars
3. Shields
4. Bases

Based on trying to make a game type similar to Star Wars Battlefront, I should make spawn bases next. I can work on telegraphing and shields after I have places to respawn from. I can add allowing players to capture spawn points later. (I could add a certain number of respawns for a game type). So, here are my next steps:

Do Next:
1. Test the game with the current tag units: get feedback on what I should add to the devices
2. Begin work on spawn bases (unless telegraphing, health, shields, etc. comes back as something people want more)

Apr 05

Laser Tag Update 4/5/15

My deliverables from two weeks ago were:
1. Rewrite the bill of materials for the tag unit
2. Purchase three additional units
3. (Optional): test tag distances with different protocol timing.

I sorta updated my bill of materials. I have purchased most things from mouser.com, so I have a record of everything that I've purchased and will be able to purchase more if I need to.
I have now purchased materials to build four additional units. Why four? That will give me enough materials to have 5 units. So I could have some asymmetric game play (4v1, 3v2, etc.) or just have up to five people test the things. Or one will break. Who knows.

Do Next:
It will take a week or so for the parts to ship to me, and in the meantime I should prepare for the first game. The only next step I can think of is:
1. Build a receiver unit. It should be able to receive tags from a wide angle (360 degrees is nice, but not necessary). It should have an indicator LED on it.
2. Adjust the code for the first game played.
I am trying to build the minimum viable product. That means the minimum that I can do to make this work is what I should do.

For the first part, I basically need an array of IR receivers that are looking in different directions for a tag. I'm planning on using around 8 right now, because each of the ones that I'm using has a 45 degree field of vision. With 8, I get 360 degrees. I will have to mount that on the tag unit so that you can be tagged from any direction.
I should put an indicator LED on this part. This should go on top of the lens tube. In fact, I could build this in two parts so that you could still see down the center of the tube in order to aim.

For the second part, I need to make the code react to getting tagged in some way so that I can play a game with it. What is the most basic game that I want to play? Standard death match. Each player can get hit a certain number of times. They are out after hit a certain number of times. I need to add some code to keep track of the number of times someone has been hit, and if that counter reaches 0, they are out (I could have the indicator LED stay on or something.
If I want to make the game last for a certain amount of time, I could use a timer on my phone.

For future work, I can get stuff laser cut here:
http://www.cherrylaser.com/
http://www.lasersoverlosangeles.com/

Mar 09

Laser tag update 3/8/15

I missed last week's update, but I still worked on the laser tag project. I just didn't post. Well, here's to make up for lost time:

My deliverables from last week were:

1. Change IR LED current to 1 Ampere. Done.
2. Get distance tests for 1 A with 4.5" lens and a 1" lens. Not done.

So, I did upgrade the board a bit. I was using a solderless breadboard for my prototyping, but it was difficult to hold the darn thing together while aiming at my receiver board. Since I need to make a prototype anyway, I built a version on perfboard that had a breadboard layout on it. That way, my prototype would be sturdy enough that I could walk around with it and test it. I changed the current draw up to about 1 Amp as well. I am not using the 4.5" lens, and instead am using a 3.49" lens that is a standalone lens (the 4.5" lens is encased).

Specifications:

Voltage for LED: 5 V
Resistance for LED: Seven (x7) 33 Ohm resistors in parallel, resulting in 4.7 Ohm total resistance.
Current for LED: 1.06 (max is 1A)
Lens Diameter: 3.49"
Lens Focal Length: 9.5" +/- 0.125"
Max Transmission distance: ?? (not tested)

The purpose of this prototype was to build a unit that could be carried around. I used cardboard as my building material, as it is easy to cut, I have a bunch of it after purchasing stuff, and I can build things with it really quickly. I don't care about making it look pretty at the moment. I just need to see if it will work.

This is the first laser tag prototype

This is the first laser tag prototype

I will do distance tests eventually. However, currently, I have my receiver (which is basically another tag unit) turn on an LED when it is tagged. However, I can't see the little LED very well when I am standing 90 feet away, so I'll need to hook up my laptop and walk away, tag the receiver, then walk back. I'll do it eventually. Not enough time these past two weeks.

Another fun fact about using a larger lens. I empirically found the focal length by focusing the light of the sun (which is as close to a collimated source as I can get. If you have a better solution than focusing your light on something 92 million miles away, please let me know). When I did that, I noticed that the spot is larger than the spot of light I got when using a smaller lens. This is beneficial because the LED is not a point source, but is 5 mm in diameter. Using a larger lens will allow the focal point to have a larger diameter, so I will be able to collimate more light.

I will also mention to check for floating inputs. I didn't solder on the receiver initially, as I was pressed for time. That meant that the input was left floating (I didn't turn on internal pull-up resistors, since originally, there was a receiver there). My tag unit would stop tagging for some reason. I thought it was a power supply issue, code issue, and eventually tracked down that I had a floating input. Oops. I soldered the receiver in, and everything worked fine. If I'd taken the time to solder that last bit on, I wouldn't have been frustrated with the unit upon building it. Let that be a lesson.

Eventually, this needs to be turned into a tag unit that I can run around with and send/receive tags. Here's a short list of work that I will need to do eventually:

1. Build an enclosure - should be done after prototype done
2. Look at multiple IR receivers - (simplest way may be to add multiple receivers to the unit. Current ones don't have 360 degree field of view)
3. Test using 1 resistor instead of 7.
4. Determine what connection you want between your LED and tag unit. (maybe for the final unit, you have a red LED next to the IR)
5. Build multiple devices and test them in the field!

Future work (after first game):

1. Add LCD
2. Add RGB LED?
3. Add 58 kHz receiver for other types of tags
4. Make different lens combinations with different resistors on them with different tag rates

So, based on those things, I should probably test adding multiple IR receivers to my project and make it work with multiple receivers as my next step.

Next Steps:

1. Test multiple receivers. I have a few extra, so I shouldn't have to buy any more to do these tests.

Feb 15

Laser Tag Update 2/15/15

So, about two years ago, I wanted to make a course to teach laser tag. I didn't make it a habit, and it didn't get done.

Now, I've made some progress towards that laser tag. However, like the me of the past, this is still a large project, and I haven't gotten very far.

So now, I'm going to (try to) use some of the advice I've got from Extra Credits. They make videos about video games, and their advice can be translated to other projects. I'm specifically talking about their series on making video games, and their rules video. I should refer to this every once in a while when I am unsure of what to do.

Completed Work

1. Create a program to send and receive tags
2. Build a prototype that can send and receive tags
3. Build a lens setup and test adding a lens - adding lens increased tag distance
4. Build LED test setup and increase current - increasing drive current increases tag distance
(Note: requires batteries that can supply the current, and capacitors)

In Progress

1. Increase range of tag unit send/receive

Methods:

In my meanderings across the internet, books and the like, I have come across information on optics. I haven't done very much with optics, so this is a lot of trial and error on my part. However, I do know that I want to collimate light. Basically, I want to take light from an LED (emanating at about 25 degrees) and turn it into a beam that travels straight. Fortunately, if you buy a lens, they tell you the focal length, or distance away that a collimated light source will be focused. Put a light source that far away, and presto, instant collimated light.

However, what assumptions are they making about that light source? In the land of physics, everything is a point source, meaning it doesn't have any height or width. I tried using a 1" diameter lens to collimate a 5mm diameter IR LED. I got it to transmit about 50 feet, but it did not work very well outside. When I checked what the beam looked like with a red LED, the beam was not a column, but focused a few inches from the lens. If I want my lens to work more like the theoretical column, I need to make my LED look more like a point source. That means a larger lens or a smaller LED. Why not try both?

Deliverable:

1. Get a larger lens/lenses 2"+ in diameter.
2. Build test set up and test 2" diameter lens (inside and outside) and record transmission distances at standard currents

Future work

1. Add more light indication.
2. Make tag unit more sturdy.

Oct 19

Updates in the world of Open Source Laser Tag

To quote GLaDOS, "It's been a long time."

While I've been away, there have been plenty of things going on in the world of open source, laser tag, etc. A quick google search showed me some recent developments that look exciting.

Skirmos is an open source laser tag game made by college students. It is based on the arduino, uses IR LED's to send tags (with a range of 500 feet according to their kickstarter page), X-bee radios to sync data, tricolor LED's for coloring the tag unit, has a screen (which seems to be their differentiator), and has a cool shell. Since it uses an arduino, it is hack-tastic for other arduino enthusiasts. I missed the initial kickstater, and will have to follow up with this in the future. Based on their website and kickstarter goals, the final product may not have all of the functionality that they state in their kickstarter video. But hey, they are building something cool, and I am supportive of building cool things.

The guys at Skirmos mention that they are working with Kevin Darrah. He's another person who has a tutorial for using those silly NRF24L01+ radios (and I say that they are silly because, while I have read their data sheet and understand how one could control them, I haven't spent the time to write a library for controlling them and don't want to. I want a free one that I can use for whatever I want. Including teaching children how to build laser tag). Kevin has a website here with some cool projects relating to LED cubes (shift registers, multiplexing, etc.) and some home automation stuff with the aforementioned radios (which turns out are really cheap on ebay). He also made a breakout board for those things. Because who wants to solder 8 pins every time they use one?

IBM developerWorks has a three part tutorial on building laser tag. Who knew? I had some trouble navigating from part 1 to part 2 (there wasn't a link from part 1 to part 2 that I found faster than googling for part 2, so I'm posting the links to all 3 parts). I may have to look at developerWorks from IBM for more cool projects.
Part 1
Part 2
Part 3

Apr 18

Board to use for permanent Laser Tag modules

I would like to have a stand-alone board to put in the laser tag modules instead of an arduino. This would allow students to use the arduino that they use in class for other projects while keeping the laser tag module intact. Right now I have two alternatives:

Moteino: Cost: $18.95. Uses surface mount components for a really small footprint (1.3x0.9 inches), ATMega328P processor, RFM12B tranceiver. This is the lowest cost module that I could find (as opposed to the JeeNode, which is 18 euros, and has a much larger footprint). I would need an FTDI adapter (or just use the one in the arduino to program it) to program the module, but that's fine. The Moteino also has a version without the RFM12B, which is $12.95.
Update: Low Power Lab is working on an ATMega32u4 based Moteino called the Moteeino Leo, which will probably be less expensive (since it's USB native). Keep an eye out for this.

Freakduino: Cost: $33. Freakduino is an open source arduino clone with an on board 2.4GHz radio (the Atmel AT86RF230). It has a great datasheet, and is a bit bigger than a standard arduino. It's a little pricier, but I like that it can have a longer range by adding an antenna.

miniSWARM: Cost: $25. miniSWARM is an open source arduino compatible with a 2.4GHz radio built into the chip. As of this posting, it is on Indiegogo for crowd funding. It can be used to build a mesh network and is based on the ATmega128RFA1. They are also giving away some miniSWARMs away on their website. This module has much more capability than I need for my application, but it may be useful if I want a mesh network and a much more complicated game.

Note: Both of these alternatives have built in radios for communicating with a central hub, which would keep track of tags. I could not have a wireless module and have all the communication between the central hub, bases, etc be done through IR. It'd be more protocol to write, but I can do it. Just not sure if I want the added flexibility of getting data from players as they play the game.

Later Note: The Waspmote is a commercial wireless sensor node based of the ATMega1281, which is arduino compatible. ATMega processors can be used for real, commercial applications. Fun fact to know.

Processor Note: So, I'm using an ATMega328p when I don't need that much functionality. I mean, I need 1 hardware timer, at least 10 I/O pins (if I put a 7-seg LED on it, or other peripherals), and some program space. But switching to an ATTiny could prove prohibitively complicated in the context of an introductory course. I don't want to have people programming an AVR with an arduino just to get a smaller microprocessor. It's a nice thought to use something with less capability because I don't need the capability, but if I end up expanding this project, it'll be nice to have excess program space and I/O pins to play around with. And who knows, maybe I'll need another hardware timer.

Mar 26

ATmega32U4 vs ATmega328P

I am thinking about using an ATmega32U4 instead of the ATmega328P for my laser tag project. The main advantage of the 32U would be built in USB (at the cost of built in serial hardware. Oh darn, I can use software serial. Not a big deal). The 32U is also twice as expensive. The table below summarizes the differences that matter for the laser tag project (there are many differences. I only care about the ones that my project needs. Mainly, programmability and cost; both chips have the functionality that I need).

Microprocessor ATmega32U4 ATmega328P
USB Yes No
Serial (hardware) No Yes
Price (Quantity = 1) $6.04 $3.05
Price (Quantity = 100) $3.42 $1.73
Barebones Arduino $22.95 (adafruit) $29.95 (adafruit)

But, of course, there are similarities. Both chips have 32 kB of flash memory for storing programs, and both have hardware timers, PWM and enough output for the basic laser tag game that I want to implement. Therefore, since both of these chips have these properties, this information has no effect on my decision because it does not help me distinguish which alternative is better.

Both processors are supported (can be programmed with) the arduino IDE, which makes my life a lot easier. Since the 32U doesn't need an FTDI chip for USB to serial conversion, it saves about $15 for the cost of the board. As of now, I should use the 32U instead of the 328P, since it will make the device cheaper by implementing USB communication on chip.

Dangerous Prototypes posted an article about Paperduino, an arduino Leonardo (Leonardo uses the 32U) clone. It has a cool tutorial on putting a paper label onto the board as well, which is a nice touch. For more information on the 32U4 and the Leonardo, the guys at arduino posted a great article.

Mar 22

Laser Tag Parts and Resources

Open Source laser tag already exists. Miles Tag is an open source laser tag project that has already developed open source laser tag modules. So why would I reinvent the wheel? I'm not. The purpose of my laser tag project is to teach other people how to build the units themselves and understand the science behind it.

So, here's a link to their tagging protocol. This protocol is the same as Version 2 of my laser tag project. If version 3 (serial) doesn't work, then I'll go back to this method of communication. They also have information about lenses, which is something I haven't looked into yet.

Also, their store has parts and part numbers. I may as well use standard components. Like their IR LED. I probably won't buy these parts from them, since I will most likely be able to get them from mouser, digikey or Jameco for less, but I do appreciate the effort that went into these devices. This is a great resource.