Laser Tag With Teensy 4.0

Status
Not open for further replies.

ajisrael

New member
Hello, I am working building a new laser tag protocol.

There are multiple aspects to the design that I would like to implement and I was wondering if the Teensy 4.0 would be a good candidate for this application. I want to use multiple forms of serial communication: SPI for interfacing with a sound card, I2C to communicate to an LCD controller, and UART for the RF. Additionally, I need to be able to generate a 56Khz, 48Khz, or 36Khz carrier frequency for IR communication. The packet structure I am building off of uses a 600us time base. So there are a lot of timing concerns for generating a packet. I would really like to be able to tie the trigger to and IRQ that is handled by an ISR to launch the packet in a minimum number of cycles so I can exit the ISR quickly to make CPU available for receiving packets from other players (possibly in another ISR). I currently have a proof of concept built using an Arduino Mega (just for the IR communication), but the board is so bulky that I need a very large gun to be able to fit it inside. The end product is going to probably run on 4-8 AA batteries. I would love to hear ideas about any other additions, implementations, and improvements.

The core idea is to introduce a feedback loop into a laser tag system. A lot of protocols are just 1 way where an IR packet is sent and received. The person who is tagged knows who shot them and how much damage they did, but the tagger has no information. Most systems have a way of compiling the data at the end of the game for accuracy, number of head shots, etc., but I want to be able to have that happen in real time. Where the tagger knows whether or not a tag was successful and who it was they tagged. I am hoping to use this to implement multiple game modes involving roles that currently aren't feasible due to the 1 way communication. The feedback is most likely going to be completed using WIFI to transmit the data back to the tagging gun. I am also thinking about implementing a server for managing the data and compiling it so people can get their stats and the guns don't have to do that on their own. Additionally, I am looking at developing an app to be able to program the guns in different game modes. This will probably be done through the server, or maybe via bluetooth for smaller games.

So in regards to the questions I have:
1. Is there a way to generate the carrier frequency using the output of a timer tied directly to a GPIO pin so that I don't have to waste CPU cycles generating the signal?
2. When working with the timers are any of the communication protocols dependent on them and will not work as a result?
3. Is the Teensy 4.0 capable of doing all these communication protocols at the same time?
4. How much power does the Teensy consume? Does it have Low Power Modes?
5. How do interrupts work with the Teensy? Can priority be specified via software?

Thanks for reading. I am really looking forward to hearing back from you all.
 
Interesting - there are two parts on each player right? The Laser Transmit Tagger and the Suit/Target Receivers? So it isn't just the transmitter with a T4 involved for each player.

No reason a T4 wouldn't be able to handle all of that AFAIK. Sound doesn't need to be SPI - though if that is at hand it can work in conjunction with i2c or other display as well as UART for RF. And there are libraries for IR Xmit and Rcv.

T4 seems to be near 100 mA at full speed - can run at lesser speeds on command. Extensive low power library isn't something visible yet? It does have a POWER input that will turn the Teensy 4.0 OFF.

Teensy offers easy to set up interrupts and offers multiple levels to prioritize them. There are samples around with AttachInterrupt().

Each T4 has RTC built in - so with a time reference established between units that could be logged as well.
 
Your post is a bit hard to read, so you need these features:
- SPI for sound (Not sure why? Just use Teensy I2S)
- I2C LCD, I would use SPI here if you can, much faster
- UART, RF backhaul
- PWM for laser
- various IO for user input.

Teensy 4 is cool but probably overkill and power intensive for this project. 3.2 would work just fine. or 3.6 with onboard SD to keep the sound files.

To make is REALLY skookum I would use an ATTINY for all the laser/IR send/receive then there is no risk of missing a shot when the main MCU is talking to the LCD or RF stuff.
 
Status
Not open for further replies.
Back
Top