Shop OBEX P1 Docs P2 Docs Learn Events
Propeller based laser tag — Parallax Forums

Propeller based laser tag

Kal_ZakkathKal_Zakkath Posts: 72
edited 2008-11-25 02:17 in Propeller 1
In an attempt to give you all the relevant information, I'll start by describing my level of knowledge:

I'm currently a masters student studying computer science (programming), I'm familiar with OOP (Java and C++ mostly), and have done a little bit of assembly programming but that was a few years ago using an FPGA as part of an undergrad course. Besides that I've never done any 'real' micro-controller programming. As for the electronics I'd say I know the 'basics' but fortunately my father should be able to help me with the more complex parts.

Now, on to the problem at hand...

I was looking at building some laser tag guns using MILES tag (http://www.lasertagparts.com/mtdesign.htm) which uses a PIC controller (18F2525) and (optionally) an ISD25xx chip for sounds. The only problem is that the ISD25xx chips are no longer produced. The next version of MILES tag is reportedly going to use the ISD17xx series, though I gather these are a bit of a pain to load sounds onto.

Enter the propeller chip...

I stumbled across the propeller chip and I can see it is capable of doing some pretty cool stuff. Most importantly (for the problem at hand) I believe it can be used to load and play wav files from an SD card. This would solve the problem above and also makes it much easier to load new sounds etc.
Basically for laser tag I'd need\want to do the following with the propeller:
  1. Display info on an LCD screen (probably 2x16, HD44780 or compatible)
  2. Send and receive info via IR
  3. Load and play sounds from an SD card
  4. (Optionally) Monitor battery level

From looking at the object exchange and on the forum here it seems all of these should be possible with the propeller, but before I dive in and order all the parts I thought I should check if there's any limitations or other caveats that I have overlooked that might cause problems. I realise the propeller + SD route will probably be slightly more expensive than the PIC + ISD route (and I'll have to do the coding myself), but it will·be a lot more extendable, and of course if I get sick of the whole thing and give up I can always use the propellers for other cool things smile.gif

As a side note I wont be using any of the pre-made boards from parallax (handy though they would be), mostly because of the cost and since I live in New Zealand it's already going to cost me about $30 US just to ship everything out here.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-20 03:57
    Be sure to download the application note on the use of the cog counters (AN001) which also shows how to do analog to digital conversion (for monitoring the battery level). You might look into 4D Systems' uOLED-96-Prop which includes a nice little organic LED panel, a Propeller, and a microSD card socket. 4 of the I/O pins are brought out to a connector. One or two I/O pins can be used to produce audio and the two I/O pins used for downloading from a PC can be used for the IR communications leaving at least two uncommitted I/O pins. 4D Systems is in Sydney and they have a distributor in Auckland.
  • Kal_ZakkathKal_Zakkath Posts: 72
    edited 2008-11-20 05:04
    Thanks for that, should come in handy when it comes to the PWM for the IR.

    As for the uOLED, it's a bit pricey for me I'm afraid. I'm trying to keep costs low since ideally I'd want 8-10 of these (it's not much fun to play on your own tongue.gif )
  • JamesxJamesx Posts: 132
    edited 2008-11-20 07:59
    Regarding the uOLED-96-Prop, yes it is expensive. But it is a GREAT little design and implementation platform. I've been using it for 6 months on a couple projects, and I love the combination of size, integrated SD card, beautiful screen, multi-sized fonts, and simple 0.1" pin spacing for prototyping. I suppose it's hard for a hobbyist to put a dollar figure on their time, but this little pup might save you 100+ hours of sorting and sourcing everything as you get started. Maybe you could use the uOLED-96-Prop to get up and running and learn how the propeller and SD work together. Then use that as a start on the 8-10 units using less expensive components.

    By the way, if you ever get a laser tag application up and running, it would be nice to see it here on the forum. I wanted to do something like that but didn't even start, thinking it was too difficult.

    Jim C
  • Kal_ZakkathKal_Zakkath Posts: 72
    edited 2008-11-20 11:30
    Yeah, I did think about the time vs. money trade-off, but ultimately time is cheap for me (for now anyway...) so I'll probably go the slow-and-painful DIY route.
    I'm hoping that having MILES tag as a reference will help the design once I can actually use the prop (for instance, MILES tag checks for things like self-hits, burnt out IR LEDs, etc).

    I will of course post it on the forum if I have some level of success (and probably numerous questions along the way).
  • Computer Geek 101Computer Geek 101 Posts: 179
    edited 2008-11-20 12:04
    I have a version built. Its entered in the Prop design contest. Once that is complete, I plan on posting the data.
  • Kal_ZakkathKal_Zakkath Posts: 72
    edited 2008-11-21 02:35
    I guess that confirms it's possible smile.gif
    I'm interested to see what features you've implemented. I believe the contest finishes on the 1st of december?
  • Computer Geek 101Computer Geek 101 Posts: 179
    edited 2008-11-21 15:46
    here is what i did:

    The Propeller LaserTag system is composed of four different parts:
    1) Gun/Vest unit
    2) Claymore unit
    3) PC Data Link
    4) Computer Program

    There are two different modes of operation; Team and Free-for-All modes. In Team mode, you cannot hurt anyone on your team (i.e. Red team cannot shoot any other Red player). In Free-for-All, you can shoot anyone. The vests are programmed via Propeller based PC Data Link. The game type and game duration is sent via IR transmission to the vests. Thirty seconds after being programmed, the game starts. The Shot data is recorded to the built in SD card.
    The PC Data Link module sends IR data for the game type and duration to the vests. In the future, the link will be able to get the shot data from the guns so the SD cards won’t need to be removed.
    The Claymore units are built for setting up “traps” for the opposing teams. To setup the Claymore, turn it on and shoot it one time. This procedure will program the Claymore with the ID of the person that shot it. Every time the Claymore shoots a player, the person that activated it will get the credit. If, an opposing team can shoot a Claymore four times within 15 seconds without being shot, the Claymore will reset to the new player’s ID thus switching teams. The LED indicator on top of the Claymore displays the color of the team it’s on. The Claymore will not switch to a different player’s ID on the same team, so a teammate cannot take over the Claymore.
    The Vests have five IR sensors to detect a “shot”; Gun, Left Shoulder, Right Shoulder, Front, and Back. If any sensor detects a shot, the Vest goes into “shutdown mode” for fifteen seconds. The data (sensor number and Vest ID) are recorded to the SD card for future statistics processing via the PC program.
    Once the programmed time has passed, the vest shuts down to end the game. The time is controlled via RTC. It is programmed on startup with the date and time of June 22, 1992 at 1:00:00 a.m. The game duration is added to this set time and the vest checks to see if the time has passed.
  • SRLMSRLM Posts: 5,045
    edited 2008-11-21 18:14
    What about adding some mines (traps) ? I'm thing a PIR sensor and a unshielded IR beam. It waits until you're close, then BOOM! <Dramatic IR Explosion> and is interpreted as a shot to all around.
  • Computer Geek 101Computer Geek 101 Posts: 179
    edited 2008-11-21 18:15
    thats the claymore unit!
  • SRLMSRLM Posts: 5,045
    edited 2008-11-21 20:16
    Haha... I thought (for some reason) that you had redefined "claymore" from a mine type into a sort of berzerker player! Rereading it more carefully, I get it. Sounds fun!
  • Computer Geek 101Computer Geek 101 Posts: 179
    edited 2008-11-24 12:58
    hope so! I'm planning on building some for the kids in my youth group. The last time I took them to play, it cost me about $500 for 4 hours!
  • Kal_ZakkathKal_Zakkath Posts: 72
    edited 2008-11-25 01:02
    Yeah they can be pricey alright, our one here costs $8.50 (NZ) per 15 minutes, there used to be another one around that was cheaper but it's closed down now cry.gif.
    I've ordered (hopefully) all the parts I need for 2 gun\vest sets now, I estimate the cost at·~$50 US per set for the electronics and maybe ~$25 US for the gun casing\batteries\misc, though once I can start playing with the parts I might be able to trim down that price a bit. Too bad I didn't do this back in june\july when the exchange rate was higher >.<

    I assume you are driving all the LEDs at 5v and not directly from the propeller?
    And just FYI the MILEStag system runs a lower current through the IR LED for longer communications (to\from PC,·cloning settings,·etc) to keep the LED from burning out so might be worth considering.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-25 01:15
    LEDs are generally specified for a certain amount of current (10-20mA) and that can be supplied from a Propeller I/O pin with the proper series resistor. You don't need to run it off 5V. 3.3V works fine with the exception of some white or blue LEDs that need more than 3.3V.
  • Computer Geek 101Computer Geek 101 Posts: 179
    edited 2008-11-25 01:29
    If you want Ill start a completed entry with my current design. I want to modify alot of it tho.
  • Kal_ZakkathKal_Zakkath Posts: 72
    edited 2008-11-25 01:40
    Would be nice to see it, but I'm not in a huge hurry -·half way through writing my thesis at the moment so it'll probably be at least a month before I get to do much playing.

    Mike: Thanks for that, should be able to run the 'team colour' LEDs straight from the prop then (super bright rated at 30mA), the IR LED though is rated at 100mA (200mA peak) and I gather they push them pretty close to the limit to get·long range (hence the concern about them burning out often).
  • Computer Geek 101Computer Geek 101 Posts: 179
    edited 2008-11-25 02:17
    I'll try to get it together during the holiday
Sign In or Register to comment.