How to Build an Airsoft Target With Microcontroller

How to Build an Airsoft Target With Microcontroller


Go Started with Altium Upverter,Sign Up At present.

Project Design Walkthrough

In my Guide to Starting a New Project , I mentioned working on some projects for a friend, and for this continuation article, I think it'south worth mentioning that nosotros're both Airsoft players. It's a great fashion to spend a day out in the woods with some friends and get some exercise, and what better project is there for us to work on together than a tracer unit for nighttime games. A tracer unit is a mock suppressor for a replica gun that shines UV light on a glow-in-the-nighttime BB as it exits the barrel. This is the perfect time to make one because there'south a large Airsoft event spanning multiple days coming up, which he is going to. I'd love to join him, only instead, I'll be going to AltiumLive .

During the day, it'southward very piece of cake to come across a white BB fly through the air toward your target, while at night, information technology's more than of a challenge to see what you're hitting. Tracer units are surprisingly expensive and typically have under a single watt of LED power. For a like cost, we can build our own tracer unit and purchase nearly 140 watts of loftier power SMT LEDs. I'thousand a fan of the phrase "if it'southward worth doing, it's worth overdoing", and 140 watts seems like plenty of overdoing, so that'due south the plan. The challenge volition exist packaging this many LEDs and powering them!

Unlike many project articles you may encounter, this will be a series to take you lot through my full project blueprint process as information technology happens. I'yard writing this article as I'thousand planning and designing, and information technology will encompass the projection design process to the point of circuit board layout, and will exist submitted before breadboard prototyping or schematic capture and PCB layout begins. This way, yous will be able to see the full project design process, including changes that are driven past the schematic or PCB layout, rather than the cooking show's typical 'here's ane I prepared earlier' arroyo. This is my first Upverter™ project. I've been an Altium Designer® user for over a decade, so I'm excited to encounter what the more than modern Upverter has to offering in design experience.

If you lot're new to designing your own electronics, this article will guide you lot through the process of an experienced engineer and maker as they tackle a project. As mentioned in the Guide to Starting a New Project , whether you are edifice a basic device, such as this tracer unit of measurement, or a complex projection, the project design procedure all boils down to the aforementioned prepare of steps.

Specifications

My specifications certificate is fairly simple: Plow the LEDs on when a BB enters the tracer unit, and turn the LEDs off when the BB exits the unit.

I was planning to build this purely with logic devices, however, the number of ICs was rapidly growing and the board space/packaging was going to be an event. Instead, I'm going to use a microcontroller to discover the BB's passage and control the LEDs. Not to mention, every bit a fun added bonus of using a microcontroller, I tin can also utilize the tracer unit of measurement as a chronograph, to measure every BB's velocity as it passes through.

To detect the BB, I'm going to use an infrared LED and detector, as the BB travels by information technology will break the beam telling the microcontroller to plow the lights on. The calorie-free gate will be at the exit of the tracer unit, and used to plow the lights off. I'll also want to add some code to the firmware to automatically turn the LEDs off later a period of time if an exit event was not detected. If there is strong infrared low-cal, such as daylight, shining into the tracer unit of measurement, it may not detect the exit result, and with such a huge power draw for the LEDs, I desire them switched off as quickly every bit possible to conserve battery life and prevent the whole unit from overheating. In that location will be very trivial cooling for these LEDs, so I'grand relying on the very brusque duty cycle to foreclose overheating.

Part Selection

Before even looking at a schematic or a PCB layout, I need to effigy out which critical components the design will use. For this design information technology will be the bombardment, LEDs, LED driver, microcontroller and photogate. Since this is a tracer unit, it's going to have a lot of LEDs, which means beyond the basics of merely detecting the BB travelling through the tracer unit, the power requirements for the LEDs will be driving many decisions.

Battery

For the bombardment, I am going to select a Turnigy 700mAh 3 cell LiPo battery with a 60C discharge rating, as it's the most compact battery I tin can detect that meets my discharge requirements. I've been using HobbyKing for many years, and their batteries are high quality all the same inexpensive, and they accept absolutely no circuit protection as yous'd find on batteries targeted at consumer devices, which is keen for stuff like this! Don't recall of the lack of protection as a bad matter, because in the radio controlled hobby industry, the electronics which the batteries plug into provide the necessary protection, leaving the batteries able to discharge staggering amounts of power. I will need to build a low voltage detection circuit into the design to end the LEDs from running if the battery starts to be too depleted.

At present that the bombardment has been defined, I could use its dimensions to ready the minimum length of the tracer unit to virtually 80mm. The minimum length of the tracer unit volition too affect the layout of components and the corporeality of space available on circuit boards within the unit. Knowing the bombardment size is disquisitional to being able to design the most compact unit of measurement possible, which non only is better for real world usage, but besides will determine the PCB manufacturing cost.

LEDs

Considering I'one thousand trying to light upwardly a phosphorescent material, I first demand to effigy out the optimal wavelength of calorie-free to use. Phosphorescent materials work by arresting a lower wavelength of light and re-emitting it as a higher wavelength. I tin exist fairly sure that typical Airsoft tracer BBs are using SrAl ii O 4 , strontium aluminate , for the phosphorescent textile equally the cheaper ZnS probably wouldn't get lit brightly enough to satisfy players. Wikipedia tells u.s. that "excitation wavelengths for strontium aluminate range from 200 to 450 nm", so the shorter UVB or UVC wavelengths are probably going to be the best options, if suitable LEDs can be constitute.

For the UV LEDs, I headed to Digi-Key to get-go filtering down the Infrared, UV, Visible Emitters category. Initially I'm looking for Agile, In Stock, Ultraviolet ones that are on Cutting Tape to come across what options come upwards. Sorting by price at a quantity of 100 units, I can come across in that location are a lot of depression-power options there which but won't give the energy density this project requires, so I'll further filter by forward electric current for anything over 500mA. Now I take lots of 1A Forrad DC Current (I f(Max) ) options, which is fantastic. The cheapest options have a 120°-130° viewing angle, which I doubtable is going to be also wide, so I'll caput to Fusion360 to mock upwards the blueprint to run into what might piece of work. I want the LEDs to polish on the BB for every bit long as possible, and so perhaps a wide angle LED volition piece of work well, only if I tin cram a lot of LEDS in a row, I could possibly get a higher free energy density by using a tight beam.

Mock up design for a 120 to 130 degree viewing angle LED in contact with a 6mm BB Broad angle LEDs have to exist placed close to the brawl to attain high energy density.

The box at the acme is a 3.5mm wide LED, and the circle at the bottom is a 6mm BB. With a 120° viewing angle, I feel in that location volition be skillful coverage of the LED every bit information technology comes by, just the peak energy on the LED perhaps isn't going to be as high equally it could be. To become the phosphorescent material glowing as brightly as possible in the shortest amount of time, I need to requite it a lot of free energy. My gut feeling is that travelling past more tightly focused LEDs will 'charge' the phosphorescent fabric better than more than fourth dimension in the emissions of a wide bending LED.

50degree LED Narrow angle LEDs offer high energy density while maintaining distance from the BB.

If you look at the same drawing with a l degree viewing angle LED, you will find that I tin bring the viewing angle lines down to be tangent with the BB and still maintain expert clearance (four.1mm) from the path the BB volition travel. This should reduce turbulence in the tracer unit of measurement, allowing for a more than accurate shot.

I now have a short listing of possible UV LEDs, with the Everlight ELUA3535OG5-P0010U23240500-VD1M being the cheapest. It is a 405nm LED which isn't maybe as optimal as a 385nm or shorter wavelength, but the price is 37% lower than the aforementioned LED in a mildly shorter wavelength. I feel equally though 37% more LEDs of the marginally longer wavelength is going to provide more brightness than we could get with fewer LEDs of the shorter wavelength. Withal, I practice not accept actual information to back this up. Inolux take several LED options that are simply a little more expensive, but the Everlight datasheet is more than comprehensive and has much clearer land design and pivot details, which are very important to me designing the board. So we'll get with the cheapest option, as not merely are they the cheapest per unit, they are also the cheapest per watt. As this part is only available from Digi-Cardinal, I made a quick bank check for UV LEDs on Mouser and European suppliers, but didn't notice a cheaper selection that would accommodate my requirements.

LED Driver

The called LED'southward datasheet has a nice voltage/electric current graph. Using the 405nm option, information technology looks equally though three.55v to three.6v will give about 900mA to1000mA of forward electric current. This lines up very nicely with our bombardment, as a LiPo battery offers a nominal voltage of 3.7v per prison cell. All the same, a fully charged battery will be at 4.2v, making it articulate that we're going to need a constant current driver of some sort and so as non to burn the LEDs out.

vf-vs-ma College wavelengths allow for larger forward current for a given forward voltage.

In that location are two possible approaches to have here: either use an op amp on a current sense resistor to enable/disable the gate of a MOSFET to limit the tiptop current, or go with a full blown LED driver IC that tin can boost the voltage and permit more LEDs to be run in series.

Being a lazy engineer, I'm off to Texas Instruments Web Bench tool to design up a constant current LED supply. I only input my requirements, and it came up with a design based on the TI TPS92691 multi-topology LED driver with a rail-to-rail current sense amplifier. It sure sounds fancy! Okay, I'1000 kidding somewhat, I wanted to employ a constant current boost driver considering I'm going to be doing another UV LED project for mail-curing parts that have been 3D printed from resin. Knowing I'k going to be having similar LEDs and ability requirements for that projection allows me to design a ability supply for this ane, and apply the same schematic for the other project every bit well, which makes it both easier to lodge parts, and reduces the total design fourth dimension for both projects.

I have called to get with 4 'rails' of LEDs inside the tracer unit of measurement, and based on a series of decisions which are now mostly irrelevant since deciding to utilise an LED driver, I decided to apply 12 LEDs per rail. I was planning to run the LEDs directly from the bombardment using a MOSFET and an op amp for current limiting, which led to groups of 3 LEDs. A constant electric current LED driver, yet, will supply a consistent brightness as the battery is discharged and is a more elegant solution. The driver will run ii sets of 6 series LEDs in parallel, which requires a 21.6v, 2A supply. This ends upwards existence about 173W for the whole unit, which is definitely overkill and a bit of scope creep, but I'thou okay with that.

Web Bench takes care of pretty much everything, however, information technology does make some odd choices for capacitors and inductors. Given that I need this to exist a relatively compact design, I used the integrated pecker of materials editor to swap out parts for smaller, more efficient options. I'm not overly concerned with saving every last cent, equally I volition simply be making a couple of these units, so a difference of a dollar or two in the BOM to go a more than efficient, more compact blueprint is worth information technology.

TPS92691-sch TI Web Bench allows yous to pattern power supply systems with consummate ease.

My main business organization with using a commuter like this is that I can't beget to have a soft startup or actually any startup delay. Every bit starting upwards the LED commuter takes more than fourth dimension than just switching the LEDs on and off, I'chiliad going to have to put a N-Channel MOSFET on the LEDs. This is going to brand the driver think the LEDs are cleaved or something's gone incorrect; the datasheet specifically mentions this.

The TPS92691/-Q1 supports continuous LED condition cheque through the current monitor (IMON) output. This allows for LED brusk excursion or open circuit detection and protection.

The IMON pivot is an counterpart output, and the driver mentions bike past cycle protection and sensing, so I'chiliad hoping if the load goes away, it volition give me full electric current on the side by side cycle if required. I don't normally like technical risks such every bit this in a design, however, I'm curious enough to effort it, and the projection timeline isn't critical, then I could afford to spend time experimenting. When I get the circuit boards I'll find out if I need to exercise a redesign!

softstart-sim Faux commuter startup shows that LEDs attain peak current later on a delay.

Microcontroller

Adjacent up, we're onto the microcontroller. To keep things easy, I'k going to get with an NXP microcontroller with USB bootloading and MBED compatibility. The NXP LPC11U12FHN33/201 fits the bill nicely. Information technology's cheap, has enough resources for this projection, and shows up as a USB mass storage device when bootloading. What more could you lot enquire for? If the board layout gets tight, I will switch to the LPC11U35FHI33/501 at near twice the price, just in a 5x5mm footprint rather than a 7x7mm i. I could use a microcontroller that fits in a WLCSP bundle (36 pins in a 2.4×2.5mm area) if I needed to go really tiny, but those are starting to accomplish beyond the limits of my ability to hand populate a board reliably.

Photo Switch

There are multiple means to implement a photo switch/photogate sensor, however, due to the curt duration of the night menstruum equally the BB travels across the sensor, I need an implementation that is capable of low latency response. Considering of this requirement, I've decided to apply an infrared photodiode continued to a transimpedance amplifier , which in plough will drive an S-R latch that is connected to a microcontroller pin. I may not need the Southward-R latch, but I haven't decided how I want to implement the code at this indicate (either as a loop or using interrupts and with or without MBED). I really need to ensure the BB's transit across the sensor is not missed, then past using a latch I can ensure the event is caught, and held, until the microcontroller has dealt with it.

In the UK, an automatic airsoft gun is limited to 1 joule, which, with a common 0.ii gram BB gives effectually 340 feet per second (104 m/s). A single shot airsoft gun, such as a sniper rifle, is limited to 2.3 joules which would give a 0.2g BB a 500 feet per 2nd (152 m/southward) velocity. Nevertheless, snipers typically utilise much heavier BBs to reduce deflection by wind and increment range, then the projectile's velocity could exist effectually 340-400 feet per second. At 340 anxiety per second, the BB will cake a 3mm sensor surface area for about 29 microseconds, a relatively long time in the globe of microcontrollers, only still possible to miss if for example the code is saving chrono information to an EEPROM.

When selecting the photodiode, information technology'due south important to look at the spectral response graphs. Many of the available options list an infrared wavelength, but will also detect some UV and a considerable corporeality of visible light upon closer inspection. As the tracer unit will contain 170 watts of UV LEDs, and merely a basic IR LED, calorie-free leakage from the UV LEDs could cause a missed detection on the go out sensor equally could brilliant sunlight. The tracer unit will have 3D printed calorie-free baffles/shields effectually the IR gates. However, with orders of magnitude more lite coming from the UV LEDs, the run a risk of some light getting past the baffles is quite high.

Optimizing the role choice for the infrared spectrum only, and the highest possible current when exposed to calorie-free, I chose the Everlight PD15-22B/TR8 Silicon PIN photodiode. This photodiode has a peak sensitivity wavelength of 940nm, which is important to know prior to selecting an IR LED, then it can exist chosen to match this wavelength.

Heading back to the emitters category on Digi-Cardinal, I'm now looking for an Active, In Stock, 940-950nm surface mount IR LED with a 10-20 caste viewing angle. I'thousand also trying to avoid gull fly and like packages in general on this project, as they don't handle shock and vibration as well equally something directly mounted to a excursion board. When setting up the BOM for the LED commuter in Spider web Bench, I switched from aluminium SMT capacitors to multilayer ceramic ones for the same reason. Whilst airsoft guns exercise not have anywhere near the aforementioned recoil equally a existent gun, they do have some vibration and shock as they are used. Sorting by radiant intensity, my pinnacle pick is an OSRAM SFH 4641-Z LED that should piece of work quite nicely. It's perhaps a little too power hungry, and 950nm rather than 940nm, just it nevertheless seems to be the all-time tradeoff given the options available.

Analog Devices have a nice tool to calculate the values for a transimpedance amplifier for a photodiode. It even has the backdrop for the photodiode I accept selected in information technology's database, which is dainty. Using this tool, I was able to design a two stage amplifier, which has significantly lower noise than a single phase amplifier, using SOT-23-5 sized op amps to salvage space. The tool very much preferred auto selecting dual and quad op amps, just those were just too large. My stop design with the tool uses an Analog Devices AD8615U1 for the first stage, and an AD8061U2 second phase. The resistor values will still need some tuning once I see what the bodily current the photodiode generates inside the device is, all the same, the tool does provide a very skilful starting signal.

diodeamp Ii stage amplifier designed with the help of the photodiode tool from Analog Devices.

When searching for a surface mountain S-R latch, in that location aren't a lot of options bachelor. In the smallest pin pitch/package, it comes downwards to the Texas Instruments CD4043BPWR or the aforementioned device in a NAND configuration. That's all Digi-Key has for me, so that'south what I will go with. Luckily, information technology has 4 independent latches built in, and so I only need ane of these existent-manor hungry devices.

The High Level BOM

At present that the high level components for the design accept been selected, I have the following parts:

  • 48x Everlight ELUA3535OG5-P0010U23240500-VD1M UV LEDs.
  • 4x Texas Instruments TPS92691 LED drivers.
  • 1x NXP LPC11U12FHN33/201 microcontroller.
  • 2x Everlight PD15-22B/TR8 photodiode.
  • 2x OSRAM SFH 4641-Z IR LEDs.
  • 1x Texas Instruments CD4043BPWR quad S-R latch.
  • 2x Analog Devices AD8615U1.
  • 2x Analog Devices AD8061U2.

Next Time

The process of selecting parts to come across requirements is disquisitional to a project's success. Fifty-fifty on a very simple projection such equally this, there are many applied science decisions to be made before even starting on a schematic. If this was a project I was taking to a client or management, I could provide them with a very broad thought of costs at this point, knowing that I'd take some miscellaneous IC'southward such every bit low current linear voltage regulators, perhaps a clock crystal for the microcontroller, connectors for the battery and USB, as well as all the passives, and ESD and EMI filtering components. From past experience, I have a ballpark figure for how much those extras are going to cost me, and specifically for this design at the low quantity I will be producing, it's probably going to be $5-$7 and a set of PCBs from asia will be about $30-$40 delivered. The main toll in this projection is the stupid, over-the-top number of loftier wattage UV LEDs, but thats half the fun of maker/hobby projects!

Continue to Part 2 and Part 3 of this projection series.

You can sign up for costless and become access to the best browser-based PCB editor, schematic editor, and component database. Visit Upverter today to learn more.

How to Build an Airsoft Target With Microcontroller

Posted by: cooleydroasing.blogspot.com

0 Response to "How to Build an Airsoft Target With Microcontroller"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel