{"id":660,"date":"2018-05-18T11:37:58","date_gmt":"2018-05-18T09:37:58","guid":{"rendered":"http:\/\/valentijn.sessink.nl\/?p=660"},"modified":"2020-09-16T12:55:13","modified_gmt":"2020-09-16T10:55:13","slug":"lets-build-a-laser-tag","status":"publish","type":"post","link":"https:\/\/valentijn.sessink.nl\/?p=660","title":{"rendered":"Let&#8217;s build a laser tag &#8211; part 1"},"content":{"rendered":"<p>I&#8217;ve been building a laser tag system for my kids and it&#8217;s in a working state now. So I&#8217;m sharing my instructions with the rest of the world here. Enjoy! It might take some time to document everything, so stay tuned.<!--more--><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-664 size-medium\" src=\"https:\/\/valentijn.sessink.nl\/wp-content\/uploads\/2018\/05\/20180518_113252-300x169.jpg\" alt=\"laser gun\" width=\"300\" height=\"169\" \/><\/p>\n<p>Some design decisions:<\/p>\n<ul>\n<li>arduino based (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Manchester_code\">Manchester encoded<\/a> 16 bit codes; interrupt driven).<\/li>\n<li>high power infrared LED for &#8220;laser&#8221;, with 1A pulses &#8211; they make for an impressive 150+ meters, daylight, range! I&#8217;m not sure about full sunlight, but on a shady day, playing laser tag is perfectly possible.<\/li>\n<\/ul>\n<p>Adding up the parts, including enclosure, wires and flashlight, your investment could be as low as \u20ac20 per gun, maybe even less if you know your way around in the Chinese parts shops. (And if you have Big Plans: I&#8217;m guessing that the whole BOM might be less than \u20ac5 if your batch is large enough &#8211; but hey, it&#8217;s a hobby, I&#8217;m not an electronics manufacturer of any kind).<\/p>\n<h1>Parts list<\/h1>\n<h3>Central to the system<\/h3>\n<ul>\n<li>an Arduino &#8220;Pro Micro&#8221; microcontroller<\/li>\n<li>a switch (for trigger)<\/li>\n<\/ul>\n<h3>IR power LED driver circuit<\/h3>\n<ul>\n<li>1000\u00b5F 16V capacitor<\/li>\n<li>resistor 0.5 to 1\u03a9, 1W<\/li>\n<li>resistor 2k2\u03a9<\/li>\n<li>MOSFET IRLZ44N<\/li>\n<li>transistor BC547B<\/li>\n<\/ul>\n<h3>the &#8220;laser&#8221; itself<\/h3>\n<ul>\n<li>1 power IR LED. I bought 20 of <a href=\"https:\/\/s.click.aliexpress.com\/e\/_d6qwxbN\">these<\/a>, 850nm, 60degree, 16mm<\/li>\n<li>1 flashlight with adjustable focus, like <a href=\"https:\/\/s.click.aliexpress.com\/e\/_BfZ0au0T\">this one<\/a> or <a href=\"https:\/\/s.click.aliexpress.com\/e\/_dX4s5Dh\">this one<\/a>.<\/li>\n<\/ul>\n<p>Or just buy a flashlight with built in IR LED.<\/p>\n<h3>display<\/h3>\n<ul>\n<li>TM1637 based display<\/li>\n<li>2 10K\u03a9 resistors<\/li>\n<\/ul>\n<h3>IR detection<\/h3>\n<ul>\n<li>4 VS1838B IR-receivers<\/li>\n<li>a 10\u00b5F capacitor<\/li>\n<\/ul>\n<h3>Optional: vibration control<\/h3>\n<ul>\n<li>resistor 15\u03a9<\/li>\n<li>resistor 4k7\u03a9<\/li>\n<li>transistor BC547B<\/li>\n<li>diode 1N1004<\/li>\n<li>vibration motor 3V3<\/li>\n<\/ul>\n<h3>stuff<\/h3>\n<ul>\n<li>A head band of some sort<\/li>\n<li>Some wire<\/li>\n<li>battery case, preferrably with switch<\/li>\n<li>A water pistol or any other enclosure for your guns. Anything goes. If your kids are comfortable playing laser tag with a salad bowl, a tape dispenser or an a barbie doll, use those. Do send pictures.<\/li>\n<\/ul>\n<h1>Some background<\/h1>\n<p><em>Laser tag<\/em> is not exactly something involving a laser. In fact, laser tag guns use infrared signals to hit opponents. So in a way, a laser tag system is some sort of remote control on steroids. No lasers, sorry.<\/p>\n<p>Central to my laser tag system is a Microchip (former Atmel) ATmega32u4 microcontroller. The Arduino series of boards form a perfect way to use these &#8211; without the need for creating PCB&#8217;s, SMD-soldering and the like. I started off using the Arduino Micro, but after a few iterations, the Arduino Pro Micro turned out to be just fine. I&#8217;m not using more modern microcontrollers, mainly because both sending and receiving IR beams in my laser tag system is interrupt driven and uses a lot of on-chip timers. I&#8217;m programming the ATmega32U4 pretty low-level. So please feel free to reprogram stuff for the ESP32\/ESP8266 &#8211; but reprogramming the timer setup might cause a headache or two.<\/p>\n<p>I&#8217;m using a rather straight forward power LED driving circuit, shamelessly stolen from Dan Goldwater at <a href=\"http:\/\/www.instructables.com\/id\/Circuits-for-using-High-Power-LED-s\/\">http:\/\/www.instructables.com\/id\/Circuits-for-using-High-Power-LED-s\/<\/a>. The MOSFET chosen has a Vth of 1-2V, which is perfect for our application. About the resistors: our IR pulses are 1A, but they will be 1ms each (with 38KHz 50% duty cycle), so you probably will get away with regular 100mW resistors. I&#8217;m just not taking chances.<\/p>\n<p>Choose a flashlight that will let you make a projection of the built in LED on the wall. More on that later (with pictures).<\/p>\n<p>IR detection is done by cheap VS1838B infrared receivers. I&#8217;m not even connecting them the right way: various data sheets suggest RC-filtering to suppress power supply disturbances, but we&#8217;ll be using batteries for power so there is no use for these extras. I&#8217;m adding a 10\u00b5F capacitor just because we can.<\/p>\n<p>Optionally you can add a vibration motor to your guns: the gun will start to buzz when you are under fire.<\/p>\n<h3>Code<\/h3>\n<p>The code is at <a href=\"https:\/\/valentijn.sessink.nl\/wp-content\/uploads\/2018\/05\/lasergun-micro-pro.ino\">lasergun-micro-pro.ino<\/a> (main program) and <a href=\"https:\/\/valentijn.sessink.nl\/wp-content\/uploads\/2018\/05\/weapons.h\">weapons.h<\/a> (header file with a couple of guns) for now. No license yet &#8211; again, stay tuned.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been building a laser tag system for my kids and it&#8217;s in a working state now. So I&#8217;m sharing my instructions with the rest of the world here. Enjoy! It might take some time to document everything, so stay tuned.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[131],"tags":[],"class_list":["post-660","post","type-post","status-publish","format-standard","hentry","category-laser-tag"],"_links":{"self":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts\/660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=660"}],"version-history":[{"count":18,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts\/660\/revisions"}],"predecessor-version":[{"id":828,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts\/660\/revisions\/828"}],"wp:attachment":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}