LZRTag - Flexible DIY Lasertag

An easy to build, program, modify and use AVR and ESP based Lasertag system for everyone!

Similar projects worth following
Ever wanted to play Lasertag just ... Anywhere?
Maybe with a different game mode too, or for longer periods than those offered by arenas?
I know I wanted to - so I decided to create my version of it!

LZRTag (and yes, I know, that's not a good abbreviation but whatever) has been a long-running project of mine. It's a couple of years old, but only recently got started!

Its main motivation has always been, and will always be, to have an easily customizable, affordable to create Lasertag system whose capabilities rival those of professional sets, without adding proprietary software or complex hardware.

Based entirely on the popular ESP32 with ESP-IDF based firmware, and requiring nothing more than a Raspberry Pi as a server, this project still provides a huge variety of well-documented functions and a boatload of flexibility!

Ever felt like you needed something to sink a whole bunch of time into?
Some silly yet at the same time very satisfying, extremely glowy project?

Well, maybe this could be for you! This Lasertag project was created mainly out of my interest, over a long and fun process of a few years - of the last few have been documented here!

The whole project is still very fluid and active as of Oct. 2019, and I am making more and more sure that it is suitable for anyone to build and experiment with, without compromising on some of the more awesome features that any good Lasertag system should have.

Below, I'll outline a few nice key aspects of the system - if you want to see videos of its progress or similar though there are always the project logs further below ;)

The hardware

This project had a history of somewhat haphazardly hardware, using a breadboard and only an ATMega328P. 

This is no longer the case as of Revision 3.2, and I can proudly say that this project has evolved to have expert hardware.

Based on the powerful ESP32 this project's PCB features a set of numerous peripherals to deliver a rich game experience.

These include a 44.1kHz I2S audio amplifier for crisp game sounds, an I2C gyro/accelerometer to detect gestures and player activities, and multiple WS2812 LEDs, both on the PCB and broken out on the vest, to provide colourful visual feedback.

Aside from this the board also contains a robust 3.3V LDO, good capacitance to keep the ESP running, a USB to UART converter with an auto-programming circuit, a LiPo charge circuit with voltage measurement, and a vibration motor to provide haptic feedback.

Despite all this, the boards are designed with ease of use in mind. It features only two components that require hot air reflowing - one of which (the IMU) is optional, the other one can be replaced with a cheaply available breakout board.

All other components are hand-solderable 0805 capacitors and resistors as well as a few TSOP packages - nothing that a fine soldering iron couldn't handle.

Communication between the sets is done via a simplistic but surprisingly effective IR channel. Using 850nm VSCEL IR lasers as emitters, their range exceeds 40 meters in good conditions.

Sunlight sadly reduces this to just a few meters, but during dawn, dusk, or indoors, this will work plenty.

The receivers are made from a simple single-sided board, but even they feature a nice WS2812 LED and high-quality 40kHz VISHAY receivers that provide precise decoding of the IR signals.

Due to the nature of the IR encoding, cheaper AVR based modules like my IR-Bacon can also be used as positioning beacons, providing a cheap way to set up capture points and spawn rooms. The signals can even be expanded to include custom signals, such as grenade shots, weapon type, and other interactions.

The software

Now, this is where it gets a bit more interesting. For Revision 3.2, a lot of the code on both server and client-side have been majorly reworked and documented, making sure they provide a simple but flexible interface for the user to work with.

The ESP32-Side

Based on the ESP-IDF v3.3 the firmware for the ESP has been written in pure C++. This makes sure that it remains fast and snappy in all situations.

The ESP handles a multitude of tasks, the most important of which are:

  • Providing a smooth 60FPS LED animation
  • Running the I2S sound interface
  • Detecting and sending shots, which includes different weapon profiles, ammo counting and reloading.
  • Sending measurements back to the server
  • And providing the player with haptic and visual feedback about their score and other statistics

Communication is done via MQTT, providing a solid, low-latency backend. This also makes it very easy to let other modules and programs interact with the Lasertag environment, as libraries to communicate via this protocol are available for almost all languages.

A BlueTooth configuration mode will also be available soon, making it easy to set your WiFi SSID,...

Read more »


DigiKey parts list for the Lasertag case - Resistors, Capacitors and some standard parts *not* included!! (Buy them in bulk is my suggestion)

Comma-Separated Values - 400.00 bytes - 01/12/2020 at 16:53


All files necessary to flash the ESP32. Uses a default WiFi of SSID "Lasertag", static MQTT Server at, and it's MAC as PlayerID For now, reconfiguring these parameters requires compiling the firmware yourself - one day I'll add a terminal-based reconfigure

Zip Archive - 771.24 kB - 11/10/2019 at 13:02


All 3D STL files that are necessary to print a casing. Multi-Material-Capable, for single material printing just leave out transparent and marking sections!

x-zip-compressed - 435.41 kB - 10/31/2019 at 15:02


The revision 3.2 KiCAD files. Preferably pull them from the GitHub site, but they're here if anyone asks!

Zip Archive - 2.39 MB - 09/02/2019 at 19:59


  • 1 × MQTT and Ruby server Could be anything, from a small Raspberry to a huge server rack. The lower ping, the better!
  • 1 × A stable WiFi network throughout the field Anything that allows the ESPs to quickly connect, and stay connected, throughout your entire arena
  • 2 × or more Lasertag PCBs You can find those over on Aisler:
  • 2 × or more fancy shells for the PCBs Those could be the 3D printed casings, old airsoft guns, or something made from carton. As long as it glows and looks great!

  • It ain't done yet!

    Xasin12/27/2020 at 19:31 0 comments

    Don't you dare think that we're done with the Lasertag just yet!
    We just... We have a backlog of stuff here, we had an amazing time finishing a few really good #Some Christmas gift presents (will have to be updating that one later too, it is turning out really nice :D), BUT 

    We FINALLY bought it! The Principle Sound Design Sci-Fi weapon SFX Unity asset we have been dreaming about for oh so long.
    It was reduced by 30%, and now that we finally have OPUS encoding we can store compressed audio, allowing us to have 20 times more sound effects in the same storage space, meaning it's actually worthwhile to get high-quality SFX and slap them in there!

    The SFX pack has a huge list of weapon designs, some of which are just blowing us away, but we will need to rewrite the entire gun handling core to make use of things like energy-beam weapons and the different pre-charge/post-charge effects.

    You can see a first rough draft of the improved effects here:

    Oh, and on another note, a few people have shown interest in trying out the VSYL Emitter Type, which is a type of IR laser instead of regular IR diode. It could seriously improve the transmission distance of the Lasertag. 

    Look down into the comments to see how it's going!

  • Feature Creep Avoided!

    Xasin11/09/2019 at 20:07 0 comments

    Whew, so ... Finally.

    Before I start rambling on about stuff, I'd like to share a proper video demonstrating a handful of features that are now fully functional and supported in the Lasertag code <3

    This means that my system is fully functional and useable for games, with everything you'd need to set it up:

    • Team selection before the game
    • Gun reloading and switching during the game
    • Configurable parameters like damage, life regeneration, revival, team damage etc.
    • Beacons to allow for King Of The Hill gamemodes, as well as Capture The Flag with a bit of trickery.
    • Stats tracking of Kills, Deaths, Damage done and received and self-healing done.
    • Registering and starting of different games via MQTT, meaning a headless server is also doable now.
    • A slightly crude but still useable Webinterface (that I'll polish uh ... Eventually >.>)

    And I also spent all the time needed to build and wire up four of these sets all by myself, which was fun, but also a surprising amount of work.

    As of this time, I've completed my list of issues and ideas I wanted to implement, have successfully avoided feature-creep and am a bit out of breath :P
    This means I can finally put this project's development back on pause for a well deserved break while I focus on Uni.

    Trust me, this is not the end, and you will see more progress on the webinterface and some general polishing all around once I feel like it again - but for now I am really more than happy with the system, and it's time to enjoy the fruits of my labour by inviting my friends over for a round or two <3

  • More software stuff!

    Xasin10/24/2019 at 20:09 0 comments

    Alright, just a quick poke for all you guys somehow still following along.

    Over the last few days I have been refining the whole game control system a little, there certainly were some bugs to squash but nothing out of the ordinary.

    I also took some time to set the new Raspberry Pi up properly - and I might do an instruction on how to get a nice WiFi AP setup with internet forwarding, so you guys can do that stuff yourselves.
    The important news here is that the new Raspberry Pi + better WiFi stick have massively improved the connection stability of the Lasertag, which is a huge relief and improves the gameplay!

    There has also been a huge bunch of extra code documentation that I did, and now all the important Ruby library functions have been documented with YARD. I've also pushed a first version of the libraries onto Rubygems, who has been refusing to build my documentation ever since, so I can't show it off for now :C 
    Seriously, if you know how to fix this, please tell me. 

    Oh, also, a friend offered me to mill the vest detector PCBs, and they're on their way right now. They already look great, and will be much better to use than hand-wired breadboard stuff and eeeeh >->

    And as one last thing:
    We switched the IR Protocol around a little, to a DIY library we call "XIRR". The nice thing is that we already have AVR code ready for another project - IR Bacon.

    We already reprogrammed them to be small positioning beacons for the lasertag game, which opens up a TON of possibilties, from Payload and Capture-point games to Kill and Revive zones or "safe" regions to play in.

    It's awesome, and I will definitely show those new features off when we complete the vest sensor boards :>

  • Progress! Small but progress

    Xasin10/13/2019 at 18:36 0 comments

    It's been a while since I last posted a log, so I felt like doing it now - it's an opportune moment for a number of reasons.

    Firstly, the new hardware is now pretty much 100% supported, all the way from the new navigation switch to the gyroscope. This includes support for the Ruby backend, as well as a few snippets of template code that already show off how useful these new elements are!

    My favorite example is the gyroscope. It can detect when the weapon is pointing up or down - so at the start of the match, players can choose their team simply by picking up the weapon at a certain moment. I call that quite useful!

    Secondly, the Ruby backend is also nearly complete - not just for the new hardware, but for a completely overhauled game control system.
    With the current code, it's very easy to define various states of your game (such as starting, team selection, prep, active gameplay and a post-game celebration), and switch between these manually.
    There's also a way to register various configurations of games into Ruby, and select a game via MQTT, meaning that it's now feasible to set up a central, "always on" server from which games can be started!

    What's next?

    More importantly, with the individual Lasertag components coming to a polished state, we have started working on the system as a whole.

    We bought a new Raspberry Pi 3 A+, which we will turn into a proper central LZRTag server. It will have more power than the RPi Zero we are using right now, but more importantly, it also has a USB and Ethernet port, giving us much better connectivity options than with just the Zero. 

    The extra processing power will also be relevant to host a webserver!

    That's right, we finally started to work on the Lasertag's web app. React + MQTT is turning out to be a perfect combination, and we were already able to extract all relevant information on players and display it live!
    We'll have to create a good design first, and especially optimize the whole thing for mobile viewing as well as for a big "scoreboard" screen, but those tasks are surmountable.

    Video pls?

    Well, right now there just is a lot of small, disconnected stuff going on. Showing each element off individually will be tricky.
    Once we properly set up the Raspberry 3 A+ and got all five current sets running with an example game though, we will definitely provide you guys with a rich video showing off the features of our system!

    There will also be more documentation incoming on the Ruby gem and setting up the Raspberry Pi as we go along, and we're almost done tweaking the 3D printed casing for the new system and will be uploading a zip with the files soon!

  • You want your glowy toys? Take it!

    Xasin09/23/2019 at 20:34 0 comments

    That's what I'm counting on~
    I used to want you to beep, but now I only want you ooonn~

    Heh, couldn't help myself there.

    A lot has been happening with the Lasertag sets recently. Sadly, most of it has to do with internal reconfigurations and polishing. I'm slowly working on adding the new features that the hardware has given me, and it has been going very well! 

    The Nav Switch works super well, the weapon's power supply is stable, charging works just fine... The Ruby-Side is getting a good amount of affection too, making sure it's the best it can be for the new stuff.

    But ... I felt like doing something ... Silly. Something to really savor what it means to have four whole Lasertag sets at once. And there was no better way to do that, than to make them play "Cara Mia", the Portal 2 turret song in the end sequence.

    One thing that really swept me off my feet here was an experience that I think many of you can cherish.

    While trying to play the song, bugs and glitchy sounds kept popping up. I thought it was some kind of malfunction, maybe a faulty packet transmission... But when I cleared up the typo that caused a unsigned vs. signed calculation, it suddenly all came together as a ... Frankly quite stunning melody.

    We hackers deal with randomness and glitches all the time, constantly trying to turn it into some form of pattern, rhythm, music, or art. It was quite poetic, really.

  • First Bootup of 3.2!

    Xasin09/18/2019 at 09:07 1 comment

    Aw hell yeah <3 

    Aisler took its time with delivering the PCBs, so this project log is coming up a little later than expected.
    However, as usual, the wait time was more than worth it! The PCBs are of the usual high quality I've come to know from them, and the stencil with it was perfect as well.

    Perfect solder paste application, partly thanks to the good stencil, partly thanks to the good stencil-holder I was allowed to use~

    I had just gone through an exam, so sitting down and being able to take some time to solder the Lasertag was ... Actually kinda tranquil.
    It certainly began to rapidly eat up any sense of time I had left, so I was able to, somehow, sit through an entire morning and afternoon just soldering away :>

    So, enough of the talk, let's share some pretty pictures!


    Ok I might have forgotten to take more pictures.
    I did, however, not forget to write a detailed assembly guide over on GitHub :> 

    Here's the awesome extra: Everything worked first try!
    Seriously, how often does that happen? It did make me rather proud, in a way :>
    The only thing that went wrong was the fact that I didn't have enough PMBT2222A transistors, which means that for now not all weapons have their vibration motor running, but for initial programming etc. that's no problem at all.

    A few minutes after finishing up their solder, I was already able to get some lovely blink action running~

    Gha, just look at these precious little babies! 
    The fourth one is functional too, I just didn't have a USB cable or LiPo at hand to run it.

    So yeah, Revision 3.2 is finally underway at basically full speed. We've even already started adjusting the 3D casing for the new navigation switch at the side, and will be printing them out either today or tomorrow, so stay tuned! 

    It's going well :>

  • Lights? Check

    Xasin09/12/2019 at 21:16 0 comments

    Alright, so it seems Aisler is taking their sweet time with the new boards...
    It's still quicker than LCSC, and they'll be here tomorrow, but the wait was a biiit annoying. Happens <.<

    The DigiKey components arrived though, and oh boy: <3

    In the mean time however, I was able to work on some other, extremely important and long-awaited code rewrite:
    The light handling! 

    Before, a lot of the patterns were defined in a rather static manner, making it hard to add new effects and get them integrated in the code in a smooth fashion.

    I was finally able to change this by using a completely new, class-based approach with a proper, abstract interface and a list of components to render.
    The result is a very easy to expand, stable, and quite stunning new effects system!

    I think the video here shows it off best:

    I'll be reviewing the changes in a GitHub PR soon. Those that are interested can poke me for a link :>

    And next monday?
    Time for the new hardware to be soldered~

  • Next hardware rev. underway!

    Xasin09/02/2019 at 19:54 0 comments

    Seems that now that I am out of the confines of my last project (who made DShot and drone ESCs so damn uncooperative :S), things have been moving very smoothly!

    As of today, I've already ordered enough components for 4 whole Lasertag sets off of DigiKey, with the PCBs following shortly, courtesy of Aisler.
    If you want your own, you can find them right here:

    The whole thing has turned out a little more pricey than expected, with about 50€ worth of hardware per set, but this does include all sensors, batteries, speakers, etc., so it is a price I can accept!

    Anyhow, enough talking, let's have a few pictures rolling in~

    The backside
    This side has been put chock full of any SMD, QFN and LGA components, making for easy hot air soldering, if you got it!
    The front
    Here we have all the beefy components - ESP, 1A 3.3V regulator, FT231 UART Bridge, etc. - get out your big soldering iron!

    The new board is a thing of beauty - and not just because the first revision was pretty nice~

    It features a self-programming setup instead of RST and GPIO0 push buttons (which turned out to be pretty annoying to use), a much bigger regulator than the previous version, as well as a thicker supply capacitor near the ESP32 to prevent WiFi Brownout at higher power.
    We also have the MAX audio amp on-board now (though soldering a breakout board on is easy), a LSM6DS3 IMU to play hot potato with your device or detect crashes, and a beautiful new navigation switch to change your weapon selection mid-game. That's right, you can have your SMG AND a pistol!
    Or ... Well, whatever.

    There's also a little more protection like resistors to the external cable and a 3.3V ESD diode to make these boards tough as nails, and let's hope the new battery charge IC does not blow up like the previous ones did :S

    Also, fun little side-note:
    The ESP32's GPIO pins are now 100% maxed out! 
    Buuut I bet you can squeeze in more pins if you're smart enough ... Somehow <.<
    For now we don't need any of that - and if we do, we use a I2C expander :P

  • Next revision incoming!

    Xasin08/28/2019 at 09:38 0 comments

    Whew... It's been a while, hasn't it! 

    Don't worry, I never left this project alone - but taking breaks and getting a bit of variation in is healthy and fun, and I got to say, it was great working on the DSKorder and a small Hovercraft and stuff. 

    However, I've been idly collecting ideas, changes and improvements that I've been wanting to implement, and more importantly: I want to document the entire process, from soldering the hardware to setting up the Webserver.

    It would be good practice for me, and helpful for anyone wanting to take inspiration or make their own sets. 

    So, what's planned for Revision 3.2:

    There's a lot for sure, and I'll be chewing down on things over the next few months. In summary:

    • The hardware will be polished. A few better support caps, charger IC, you name it. The MAX chip and a new I2C 6DOF gyro will now also be put on the board, and I'll optimize it for hot air flow resoldering~
    • I'll also run a first larger batch of soldering. I intend to get at least four boards fully functional, which will finally allow me to try out proper games with friends!
    • The software will get multiple new features! After cleaning up the current code and adding the IMU, I'm planning to rework the light control system to make custom light patterns easier to add. There's also going to be a new button to switch weapons on the fly, and a Filesystem based sound and weapon handler. This will give the server a lot more control by being able to upload new weapons on the fly, so... Wheee~
    • The MQTT interface will be changed slightly, mainly to remove some load from the Lasertag sets themselves. Nothing major here ^^
    • Speaking of the server, that thing will be polished a bit more too. After giving the Ruby backend a few small extra features to handle games smoother, I intend to add a SQL database to log events. That way, it's a bit easier to see what happened during a game, print statistics, that sort of stuff~
    • Once all of this stuff is running smoothly, we'll get a Web interface! I've been playing with React, which is a fantastic backend for this sort of work. If everything goes well there will be a Player HUD, a big game statistics page to put on a screen or projector, and a game configuration window to mix and match game modules on the fly, set player teams, etc. This is definitely the most ambitious part, but it I get it right, it'll put this project into a truly professional grade of Lasertag system. 

    I'm really looking forward to this work, especially since I'll make sure it's well documented and reproducible for any guys here. 

    I'll also post updates on hardware and software here, so you can review it. The more eyes the better, since we all make small mistakes ^^'

  • Lack of documentation, or "Always expect people to buy it"

    Xasin07/13/2019 at 09:53 0 comments

    There's an important lesson for everyone here at the bottom, please give it a read!

    This morning I was greeted by a lovely message from Aisler, telling me that my project had been bought by a couple of people!
    That isn't fully unexpected, as I was told a FabLab was working on implementing my Lasertag Project as a small workshop course, but it still comes with a problem:

    The PCBs uploaded to Aisler are faulty

    No, it's not a major problem, or something that requires the people that did buy them to throw them away.

    The problem is the following: In the top right corner of the front of the PCB, a trace coming from the RESET and GPIO0 buttons is shorted against the ground pad.
    The good news is that it is easy to cut with a scalpel, and the rest of the PCB is functional - so for those that did already buy the PCB, don't worry, it will still work!!

    The bottom pads of the buttons, where you can also see the vias, are the "output" pins. They should not be connected to ground, but they are. Cutting them with a scalpel will resolve the issue, and you can not damage anything by accidentally leaving the fault in. If the ESP32 does not boot up, but 3.3V is present, this is likely the problem.

    Other things worthy of note to get it running:

    • You will need a set of 0603 resistors and capacitors to solder up the set. I did not include them in the Aisler parts list, because those are components I always have on hand from a lot of other projects myself.
    • You will need PMBT2222A (or similar BEC SOT-23) transistors for the IR LED and vibration motor (I always keep those on hand as well, they're fantastic little BJT transistors <3)
    • You will need a 480mAh LiPo battery, preferrably with built-in protection. For germans, I can highly recommend for those
    • You will need an Antenna for the ESP32, preferrably a PCB antenna with sticky backside to mount in the casing.
    • For the external vest detector piece, you will need 40kHz VISHAY IR Receivers, as well as a bunch of WS2812 LEDs to chain together. Oh, and a D-SUB cable, the ribbon cable mounted ones are great!
    • You'll also need a I2S Amplifier chip. The MAX98357a is perfect for the job!

    My lesson: Always be vocal about the state of the project

    I feel a bit bad for the people that bought the PCBs and now have to go through the process of reworking them.
    If I had been a bit more vocal about the state of the project, i.e. mentioning that the PCB needs reworking, the Aisler parts list isn't fully complete, then maybe people would have waited a bit longer, or would have been more prepared to deal with these issues.

    The way I made it seem was that the project was fairly easy to build, and ... That's my mistake.

    However, this should also be a lesson to anyone trying to buy or build projects here on HackADay:
    Nothing will be perfect. Mostly, we're all just a bunch of nerds having fun with these things - or at the very least, I know I am!

    There will be undocumented flaws, incomplete parts lists, or other little quirks in the process that the person building them dealt with and ... Never really wrote down, because it didn't seem like a big deal.

    As a maker, the best we can do is to put a huge "WORK IN PROGRESS" above the things that aren't quite ready yet. 

    And as the person trying to build it, we should always make sure the project is replicable: Please, ask about the status of PCB etc.
    If the maker says "The PCB needs a bit of rework", then that means it's not ready yet.

    Continue if you wish, but at your own risk to deal with all those little quirks the Maker left in.

View all 17 project logs

  • 1
    Solder things up!

    The first step to any good hardware project like this is to take some time (i.e. a whole afternoon <.<) and solder up your first batch of sets.

    For this, you will need:

    • A package from Aisler, found here:
    • A couple of standard value 0805 Caps (47uF, 10uF, 1uF and 100nF, though you can use what you have)
    • And a few 0805 resistors (10k, lots of 220R, 100k and 200k) 

    Oh, yeah, and buy some solder paste, because this PCB is best made with hot air reflow due to QFN components on the backside!

    All ready?
    Great, then head over to the GitHub wiki page for the more detailed, up-to-date instructions!

  • 2
    Print and assemble the casing!

    Any good piece of hardware needs an appealing and sturdy casing to work right, doesn't it?
    That's the same for this project, and we got you covered with an easily 3D printable frame!

    The model provided in the files consists of multiple parts. Model pieces named "COREx" are what you will definitely need to print - these are:

    • The central core that holds speaker, PCB, battery, LED, and so forth
    • The two side panel pieces that will cover the PCB.

    If you have a multi-material printer, or know how to use Prusa's Single Extruder Multi Material feature with manual filament swaps, there are a few extra models to let you add some style to the casings. The appropriate model pieces will be named "COREx_MODa.b", with "a" being the material number and b just an identifier.
    I recommend a clear material for the pieces going below the side-cover slits, and a nice, bright, contrasting material for the top indicators to add some "pop"!

    When the central holder is printed you can already start assembling it:

    1. Carefully insert the PCB. The navigation switch has to slide through the hole for it, so you need to angle the PCB a little and push the nav switch in. Then, just push the PCB into the frame and position it until the screw holes line up with the screw mounts on the printed piece.
    2. Screw the PCB in place with two M3 nuts and short (6mm) M3 screws. It should look a little like this:
    3. Prepare the speaker, button and switch. We'll glue them in in the next step which will make their solder points hard to reach, so we need to add some wire now. The button needs a bit of wire going from its upper left and bottom right pins to the two upper connection points next to the JST connector.
      The speaker's wires need to reach from the front nozzle section of the casing to the two connection points next to the ESP32 - or, if you use a breakout board for the I2S audio, to that.
      The power switch needs its wires to reach from the little cutout below the D-SUB connector to the two connection points above the battery JST connector. 

    4. Glue in the different components!
      You can use either a strong adhesive tape or something like loctite or cyanacrylate. Important is just that it can solidly connect the different parts to the frame, but that it also doesn't seep into the mechanics of the button and switch.
      For the switch and speaker you won't need that much glue, since neither will experience that much force - but for the trigger button I highly recommend a little more, just because players will probably be tempted to smash it a little harder than they need to. 

    5. Push in the two front LEDs (3mm IR LED and the WS2812) into their respective spots in the casing. You shouldn't need glue to fixate them since the case should fit them snugly, but it can't hurt to add a bit to make sure their bond lasts.
      Once they are in place, you can solder them up, using some copper wire to hook them to the six connection on the front of the PCB. 
      You shouldn't have to cross any wires over one another, but I highly recommend double-checking the polarity of the WS2812 and the IR diode!

    6. Slide in the battery into the holder. Depending on the type of battery you get, 

    7. Push M3 nuts into the six attachment points on the top and bottom of the core casing. You can fixate them by heating them up so the plastic melts around them, or just by adding a little more glue. Either way, make sure they sit flush with the surface of the casing 

    8. Screw on the top and bottom halves using the same small M3 screws as for the PCB!
      If everything went well, your piece should look somewhat like this now:

    9. And now?
      Plug the PCB into your computer via USB. If the firmware is already loaded it should start charging the battery (indicated by a very slowly growing battery LED). If not, you can go to the next step to flash the firmware of  the ESP and configure your access point

View all instructions

Enjoy this project?



jason mantor wrote 01/09/2021 at 19:43 point

Would it be possible to use an ESP32 thing from Spark fun to run your code?

  Are you sure? yes | no

Xasin wrote 01/11/2021 at 14:29 point

Yes, quite possibly!

You should take a look at which pins are available on the ESP32 Thing, and you might need to change the pin layout a bit if some of the ones that I use are occupied.

But in general, any ESP32 WROOM Module with at least 4MB Flash should be sufficient to run this code, there aren't that many important prerequisites.

  Are you sure? yes | no

Xasin wrote 12/26/2020 at 19:08 point

@Anthony Webb 

Good news, first things first: I just bought a proper Unity asset pack for Sci-Fi weapon SFX, and they are AMAZING! 
Will have to do a video of that soon :>

The receiver needs to be a 40kHz IR receiver, I used the TSOP32240 (DigiKey MPN) - a bit pricy but it delivers very clean data output.

The original transmitter diode is a SFH 4346 (which might be discontinued now?), but I really want to see what this new diode like the VSLY5940 can do.

I recommend a driving BJT or Small-Signal FET, anything that can provide the ~100mA that we will be pumping through the transmitter diode. Apart from that, you won't need anything more.

Keep in mind that the VSLY doesn't need much current since it's a laser, so maybe add a resistor, measure the current and adjust until it's in the recommended operating current range. It might even be OK to run it directly off of the ESP32's I/O if it's below 10mA.

For the current IR LED I actually didn't use any resistor at all, and probably pumped a few 100mA's through it using a BJT, but we don't need to do that with the VSLY.

  Are you sure? yes | no

Anthony Webb wrote 12/30/2020 at 01:46 point

VSLY5940 is backordered at DigiKey, but I should see them in the next couple weeks.  Got everything needed to breadboard up some tests.  I'll let you know how things look!

  Are you sure? yes | no

Joshua Grauman wrote 10/31/2020 at 22:33 point

You mention in the comments that you were thinking of using VSCEL IR Laser diodes. Have you tried that yet? What type are you looking at? Link?

  Are you sure? yes | no

Xasin wrote 11/04/2020 at 08:30 point

I haven't yet tried anything out, but I would really love it if someone were to test it <3
Right now I have some more pressing matters in Uni going on.

I was looking at a VSCEL in standard 3mm LED packaging, with about 3° beam spread. That thing would easily double the distance of the system, but might also pose more of an eye-safety risk (though honestly, I think it's minimal unless someone stares right at it while the MCU glitches out and continually activates the beam...)

Try something like the VSLY5940, it's a Vishay 950nm "Surface emitter" (I guess the term VSCEL was bought by someone else?), with 3° beam spread and an absolutely stellar 600mW/sr output power at their nominal voltage!
(Eye safety for temporary exposure is 100W/m² or 4W/sr according to the VISHAY IR safety datasheet, so this is still OK.)

The receivers I use have a minimum irradiance of 0.25mW/m², so... Ok I am bad at this kind of spherical surface maths, but this is quite far <.<

  Are you sure? yes | no

Anthony Webb wrote 12/21/2020 at 04:57 point

I have a few cycles over the next month or so that I could do some R&D on this VSLY5940 device.  I'd need to get a receiver set up so I can validate the entire emitter/receiver stack.  Do you have any extra boards laying around that I could buy from you?

  Are you sure? yes | no

Xasin wrote 12/21/2020 at 10:10 point

@Anthony Webb 
I sadly don't have any spare boards I wish to part with, and not really any time to solder up a new one.

A simple test setup could consist of only an ESP32 devboard and one of the Vishay receivers (about 1€ in single quantity), which are pretty cheap and quick to get though, and the IR Sender/Receiver code is packaged in a standalone library that can be used independently of the actual Lasertag system.

What might help there is to retrofit a better checksum or redundancy, but we'll see about that.

  Are you sure? yes | no

Anthony Webb wrote 12/23/2020 at 23:33 point

Thanks for the reply @Xasin I will build up a testing environment with a couple ESP32 I have laying around if you can help me identify the hardware I will use for testing.  I am thinking of trying the VSLY5940 emitter, and maybe pick up one of the one you use in the current design, which part number is that?  Also on the receiver side of things can you get me a part number for that as well?  Will I need any other components to breadboard out this thing and start testing?  Really excited to see what kinds of improvements we can make!

  Are you sure? yes | no

NjordCZ wrote 08/05/2020 at 10:49 point

Aren't you considering MILESTAG 2 support for the lasertag protocol?

  Are you sure? yes | no

Xasin wrote 08/05/2020 at 21:10 point

I am not, not right now. It would be possible by writing a different ESP-RMT parser, but I would essentially have to send all commands back to the Lasertag server to have them executed there.
It makes more sense to run the commands such as "Add health", "add rounds", etc., directly from the Lasertag server, and since I doubt that any MilesTag2 systems will have WiFi and/or MQTT-Capabilities, mixing devices might not make sense.

Very maybe you could Re-Use the MilesTag beacons for Ammo, health and flags though, but my protocol already supports positional beacons for that.

I do like the overall idea though - maybe I'll take some inspiration from it.

  Are you sure? yes | no

Craig Gardner wrote 05/11/2020 at 22:54 point

Looks great! How much run time do you get off a single 18650?

  Are you sure? yes | no

Xasin wrote 06/04/2020 at 08:15 point

It's hard to say, if I am to be honest, but with the current setup of the Lasertag I haven't had that much trouble running them for an hour or more with a much smaller 400mAh cell.

The ESP32 with its WiFi enabled probably averages 100mA (+ the LEDs and all that), so with a larger 18650 you can surely go an afternoon :>

  Are you sure? yes | no

Joshua Grauman wrote 03/13/2020 at 23:16 point

Nice project. I created a prototype lasertag a while back using IR leds/receivers and atmega. I've always wanted to resurrect it someday. Looking through your docs I didn't see anything about a lens. Are you using lenses to increase distance?

  Are you sure? yes | no

Joshua Grauman wrote 03/13/2020 at 23:30 point

@Xasin, I tracked down some info that I was looking at back when I was exploring it. This may be useful to you. But this person seems to have had a lot of experience with DIY lasertag back in the day and says that glass optics work well...

  Are you sure? yes | no

Xasin wrote 03/13/2020 at 23:39 point

Nope, I am not using any lenses!
I felt like those are hard to get, integrate and tune, and thusly would overcomplicate things for the average hacker trying to recreate this.

Right now I am thinking of buying so-called VSCEL IR Laser diodes, which might increase Range x4 at a cost of just 4€ per IR diode, with a spread of only 4°
That would make lenses even less necessary.

  Are you sure? yes | no

Simon wrote 10/10/2020 at 04:37 point

Good suggestion on the VSCEL, however have you had any thoughts on encoding information on the laser and also receiving / decoding it? I think that is where a lot of projects go back to IR, because over IR that is well understood.

Edit: nvm. I understand.

  Are you sure? yes | no

amd599 wrote 03/02/2020 at 22:13 point

Hey @Xasin - this is a really incredible project. You did a great job detailing everything out. We are working on a project and we were wondering if you do consulting work (paid, of course). If so, is there a way to get in touch with you via Skype or something? I think you'd be interested to hear what we're working  on for an experiential marketing event this summer. Please let me know when you have a chance. Great work again, very impressive!

  Are you sure? yes | no

Xasin wrote 03/04/2020 at 10:17 point

Thanks a lot for the praise, amd599!
This was my first attempt at a more community-oriented project, and I am glad to hear that it worked out.

Regarding your offer, I must politely decline. I am still a student, and with my Bachelor's thesis starting next semester I am not sure if I will have the time to give your project the attention it deserves, while also focusing on my own work.

I see no problem with offering some advice on certain issues every now and then, but I can't ensure that I will have time to reliably respond.

Thanks a lot, and I wish you the best of luck for your own endeavors!

  Are you sure? yes | no

amd599 wrote 03/12/2020 at 16:45 point

Sure thing! It's an incredible project and no worries at all. Perhaps some day in the future we can collaborate more :) Thank you for this awesome project to the community!

  Are you sure? yes | no

André Costa wrote 02/27/2020 at 15:08 point

Been interested in doing something similar and just found your project. Nice one! One small question tho, i can understand how the player detects he got hit but how do you know which player hited him?

  Are you sure? yes | no

Xasin wrote 02/27/2020 at 18:17 point

Hi Andre,
glad to hear you like my project! I hope it'll give you some inspiration.

Player hit detection is done very similarly to how TV remote controls work. The IR LED sends out a digital signal very similar to how UART looks, except at only 2000 Baud and with a 40kHz modulation on top of that.

Inside the IR Signal I've encoded a 8-bit player ID, which allows the hardware to figure out who it was hit by.

Since the data format I made is easy to expand with custom information, you could in theory also use the IR sending and receiving for other data. I've already built small positioning beacons you can use to play King Of The Hill etc.

  Are you sure? yes | no

Tomm Dool wrote 09/08/2019 at 20:49 point

Just came across you project looks great.  Going to be following this project.
Just played with a Lazertag system at the Halo: Outpost Convention in Anaheim the other weekend, provided by  There system was one of the best I have ever seen and used. It uses a Class 1 Laser that will reach out with accuracy across a football field in day light.   They had a test target out 150 - 200ft and if you didn't have the red dot on it perfectly you would miss.  very accurate and apparently you can adjust the beam width manually based on skill level.

They also use BT to connect to head band sensors, so no wires between head band or vest.  Just a thought as I know how the wiring is the weak link in most commercial products out there.  Thought that was a fantastic idea.  The rest works over wifi so figure a ESP32 or something.

I loved how simple the system was.  you carried just a rifle and a head band connected via BT to that rifle.  It had life indicator through 4 LED that changed colour as you die. Sounds for weapons fireing, hits and enemy hits.  LED read out for shots left and a simple button to reload.  No wires.  Respawn you just had to aim your rifle at the box and it respawned you in 5 seconds.  back in game.   Controlled through there  software, that ran off of tablets and had a display for score for all to see.  Sounds exactly what you are trying to do here.  Which I love.

Looking forward to see the progress, I will be building it myself

  Are you sure? yes | no

Xasin wrote 09/11/2019 at 14:38 point

Aw, why thank you!
I recommend waiting a little while for me to receive and test the newer hardware generation, to see if there are any problems. Most likely it's fine though.

Regarding the Battlecompany com technology, there are a few reasons why I chose to do my system this way:
1) IR Lasers are a bit expensive to come by. Even if you find a model for only 10€, it would still increase the price a good bit. The best I can do is a VSCE IR Laser diode. 4° of spread, 4€ price, should give you 100m range in dark conditions :)
2) A bluetooth headpiece would require another ESP32, LiPo, charge controller ... Essentially, a whole new main board. It could add 20 to 30€ of cost, and while I agree that cables are slightly annoying, they're sadly not that big of a problem to make me want to replace them with Bluetooth. It's still cool stuff though!

Health and ammo indicators are currently not added on the weapon itself, but it's very easy to add modules via I2C to realize this. My current goal is to build a interactive Webpage though, which lets you display stats via phone or projectors or such :)

Oh, one thing that I am going to do a bit nicer is respawning:
I'll be using Infrared beacons to determine player position, and set rooms for players to respawn in, as well as to capture. No weapon-pointing necessary :>

  Are you sure? yes | no

André Costa wrote 02/27/2020 at 13:39 point

Have a question. If u only carried an headband. Did you have to headshot people to kill them?

  Are you sure? yes | no

Brandonkeithangelo wrote 09/04/2019 at 19:27 point

I fly scale RC airplanes and would like to mate this to an in-cockpit FPV setup . Xasin, seems you might be into RC as well, might you be interested in getting a project going? here's a cool setup with some fancy optics on a beautiful day-

  Are you sure? yes | no

Xasin wrote 09/04/2019 at 20:55 point

That sounds pretty awesome, actually!
Adapting the code here to work for FPV shouldn't be too hard. The core components like shot handling can essentially stay the same, it just needs a remote trigger and most likely a better network connection. 

I'll be focusing on the normal setup for now, getting the new hardware up and stuff, but after that ... Why not.

  Are you sure? yes | no

Brandonkeithangelo wrote 09/04/2019 at 21:43 point

Hmmm...does seem like a fair amount of work has gone into the networking aspect. I wonder if we could just drop something like an Xbee3 onto the pads and run with that!

  Are you sure? yes | no

Brandonkeithangelo wrote 09/04/2019 at 21:46 point

Also, any reason you aren't using a IR laser diode?

  Are you sure? yes | no

Xasin wrote 09/05/2019 at 06:51 point

Well, the ESP isn't just networking. It also controls all the peripherals, from Audio to the IR data transmission and WS2812 control. I could, however, connect an XBee or LoRa module, and tweak my code to communicate via that. 

Also, if you have a good source of cheap IR Lasers, please do share! 

I just haven't found any on Digikey or similar yet, and so far the IR led has worked well. A laser would be way cooler though... 

  Are you sure? yes | no

Xasin wrote 09/05/2019 at 07:00 point

Actually, I need to go back on my own word here regarding lasers.

Turns out there is a technology called Vertical Cavity Surface Emitting Laser, or VSEL 

I found a emitter for only 4€, so an acceptable price, with monochromatic light output at the wavelength of my detector, and a near perfect 4° beam divergence without further optics. Makes me wonder how far I could push the range with these! 

  Are you sure? yes | no

Dylan Brophy wrote 07/29/2019 at 15:12 point

I haven't looked at this project yet, but all your pictures look really f***ing cool.

  Are you sure? yes | no

Xasin wrote 07/29/2019 at 16:26 point

Hey, what looks good sells better!
Right now there's a bit of a lack of documentation. I'm going through some University stuff right now, and will do a new revision of the Hardware, with a proper clean-up of the Software and Documentation, and a better Server with a nice webinterface.

The whole base is fully functional though, and I got a few "in-action" videos already :>

So feel free to stick around and see what it'll turn into!

  Are you sure? yes | no

Daren Schwenke wrote 05/04/2019 at 04:01 point

I am going to *have* to build this.  Good job!

  Are you sure? yes | no

Xasin wrote 05/04/2019 at 07:00 point


Oh, please do! But don't order the PCBs just yet. There's a bit of a redesign I need to do, since I switched to a different audio processor, and the current design has a PCB trace shorted to ground and needs fixing.

I'm assuming you can Solder QFN parts, but if not I'll include Solder points for a breakout board to be attached on. All other parts are hand-solderable though.

  Are you sure? yes | no

Daren Schwenke wrote 05/04/2019 at 07:53 point

At this point I'm pursuing the #P2 - Pick and Place for 3D Printers project mainly to attempt to compensate for my rapidly failing ability to solder anything small without screwing it up.  :)

  Are you sure? yes | no

Boris van Galvin wrote 03/04/2019 at 21:20 point

What an amazing project! 
Many many moons ago I built the first generation of laser tag units down here in NZ, they used a 8080 processor and ran a HeNe laser tube. A real pain in the rear as after a few big knocks the mirrors would go out of alignment. The vest was constructed from motor cross armor and had a pile of small solar sensors installed to register hits.

We later changed the system to something a little more simple and used a strobe light constructed from an engine timing light. These were a little more robust but there was no communications as to who hit who.

Your project is really cool, having it set up like you have creates so many opportunities to expand on it.  

  Are you sure? yes | no

Xasin wrote 03/04/2019 at 21:33 point

Gha, your version sounds like a heck of a lot of fun too though!
I haven't done much in terms of vest equipment yet, but the connector at the back exposes a WS2812 signal for as many vest LEDs as wanted, as well as a general purpose I2C connector for other peripherals.

All source files are available for others to work with, mainly on the Github site! The PCB uses mostly hand-solderable components, so feel free to take some inspiration from it :D

  Are you sure? yes | no

Daren Schwenke wrote 05/04/2019 at 08:00 point

All the HeNe lasers I used in the 8080 era already had bonded optics.  I guess I was privileged and didn't even realize it..

  Are you sure? yes | no

Michael Obed wrote 09/25/2018 at 12:04 point

This looks awesome, man! Very promising!

I've implemented a Laser Tag project myself using a very similar method...I initially used an ESP8266 + Arduino IDE for the hardware side and C for the software side. It worked well, but for scalability and reliability I re-did the server side in C++ and implemented checksums and a HTTP web server. I want to do the hardware with the ESP-32 as well, as the extra power and comms are attractive...

Who knows, maybe that project will make it here too! ;)

  Are you sure? yes | no

Xasin wrote 10/02/2018 at 18:27 point

You made the server with HTTP and in C? 
Now that's kind of impressive! I had no idea how to make something like that, so I chose Ruby for my server software. I intend to stick with it though, as it is a lot more flexible than C or C++ in terms of live reloading of software - something that could come in very useful for custom servers or similar.

At least I didn't use the Arduino IDE - I prefer the cleaner, more professional environment of Eclipse (as well as the C++ autocompletion it offers <3)

  Are you sure? yes | no

HP (@banjohat) wrote 09/12/2018 at 05:23 point

This is great!

Some interresting details in your build - how uncool of visahy to call the IR receiver TSOP >_< it's not even an SMD package :P

Are you only registering hits on the gun? I would love to see a vest with targets as well!

  Are you sure? yes | no

Xasin wrote 09/13/2018 at 17:04 point

Oh, thanks for pointing out my mistake!
I accidentally called it that because the vendor I buy my parts from has their own naming scheme. Their IDs vary quite a bit from the original ones, I must have mistaken that!

Also, it's exactly the opposite - the guns don't have any built-in sensors (although adding one is trivial), and it's only the "vest piece" (or in this case a tiny strap-on shoulder sensor) that registers the hits.
Since the sensors I use have a pull-down output they're easy to connect in parallel, to have as much sensor coverage as you need.

  Are you sure? yes | no

dlhavema wrote 09/08/2018 at 05:30 point

post some code.  Super cool start man

  Are you sure? yes | no

Xasin wrote 09/08/2018 at 06:49 point

The link to the GitHub is already there. I'm still working on a bit of documentation, but it's mostly self-explanatory. 

There's also a directory with one or two example game scripts ^^

  Are you sure? yes | no

dendad51 wrote 09/07/2018 at 07:54 point

Oh, the IR camera is just to be used to sight the gun in as the "image" is invisible.

I use these sort of flashlights and have IR LEDs to put in them. Just the LED and lens is used, in a 3D printed housing.

And that feeds into one of these...

Yes, the WT558D modules are great. But don't forget to buy a programmer too.

  Are you sure? yes | no

Cor van Essen wrote 09/07/2018 at 07:16 point

That looks cool. I made something similar with everything stuffed in a toy gun. And the receiver LED were on the gun itself. Yours looks way nicer. I used an Adafruit board to connect to my phone which would then upload to the internet.  I have a proof of concept, but then other things came along. So this is inspiration to pick it up again.
How good is your IR range? 

  Are you sure? yes | no

Xasin wrote 09/07/2018 at 07:32 point

I'm using a strong IR led, probably over driving it a bit, and it's run through a fairly small hole (0.7mm diameter) to focus it. 

That gives me about 40m of range in low light conditions, some 20m if the sun is out. 

I'm still looking for a good IR lens though. With it I could focus a much larger beam, and the range could skyrocket. How much I sadly don't know.

  Are you sure? yes | no

Nick wrote 09/09/2018 at 11:08 point

Im not sure  how well they work, but have you tried lens's for arcade light guns?

They can usually be bought for cheap used on ebay,, or from local arcade operators.

  Are you sure? yes | no

Xasin wrote 09/09/2018 at 11:37 point

@Nick, that lens looks fairly good, thanks for the hint! But I fear glass lenses aren't the best option for IR - some materials don't let those wavelengths through very well. It's also a bit very expensive, so I'll stick with a simple lense-less design for the time being

  Are you sure? yes | no

denys wrote 09/06/2018 at 22:35 point

This is really interesting. I've stalled a bit on my Laser Tag system that was aimed at being finished last Christmas!

Mine is built into Nerf guns and uses an Arduino Pro Mini driving the IR LED from one of those metal flashlights. The LED and lens from the flashlight is mounted in a 3D printed housing that is stuck on the end of a mobile phone telephoto lens so it shows the "picture" of the LED at quite long range. Visible LEDs are used to setting up, but an IR enabled camera will be the way to go.

Sound is from a WT588D module. Various gunshot sounds can be selected, along with an empty click, and any other sound wanted.

It may be worth looking at these for your gun.

Power is an 18650 call with a USB charger/protector board.

But I like your ESP8266 idea.

Maybe I'll get back to it so my son gets it for this Christmas ;)

  Are you sure? yes | no

Xasin wrote 09/07/2018 at 07:32 point

The WT588D module is definitely something I'll have to look at! 

Sound is still something that my project is lacking at, I'm just using a variable frequency PWM output for the buzzer. 

I like the idea of using nerf gun casings, but my system doesn't care about what it's inside. 

As for using the IR LED of a flashlight together with a IR camera, I'm not sure if that is a good idea. A camera wouldn't be capable of decoding a modulated IR signal, meaning that any source of IR light would look like a shot. 

Plus, you wouldn't be able to discern individual players, which would not allow for different weapon types or teams to be used effectively.

Isn't a IR camera a bit expensive too? >.<

If you want, you can look at the code of my AVR chip. With a few modifications it can run in stand-alone mode, without the need for an ESP and server. 

You'd have to change it a bit to work with the sound module too, but that's doable.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates