Looking for some project guidance on driving LEDs efficiently please - Page 1
Forum section: electronics / beginners

author: doublec4
author_rank: Regular Contributor
timestamp: January 26, 2021, 03:23:53 am
content: I've been working on a project whereby I am trying to create an LED "beacon" for lack of a better term. Something like those cheap LED flashing road flares... but more industrial and much brighter.The requirements I have are...It must be battery powered (currently using Milwaukee M12 rechargeable tool batteries... 12V)or the LEDs I have been using Whelen Mini Ion light modules (each light head has yellow/red dual color)... two light heads go into one of my beacons:https://www.whelen.com/product/all/ion-t-series-mini-t-series/... (this is the part I'm looking to change)RF communication using RF69HCW radio moduleWith the help of this forum over the past few months I have had wonderful advice that has allowed me to expand my knowledge and build some interesting circuits that I have incorporated into my current PCB which I'm very proud of:Some details on the PCB..ATMEGA328p running at 16Mhz (clock speed overkill for this application but would like to stick to ATMEGA for Arduino programming environment)Soft latching power circuit so I can use a single button to turn the device on, and use the same button for input and then hold to turn offTwo voltage regulators, 5V for ATMEGA and 3.3V for RF69HCW radio moduleN type and P type mosfet pairs to high side switch the Whelen lights to various colors... the light modules have common ground and cannot be low side switched.555 timer and quad analog switch that acts like DPDT switch to allow the 555 timer to switch between two PWM duty cycles to put the lights into "bright" or "dim" modesLM339D for battery level indicator using four LEDs on the side of the boardIt works well, performs the functions I need it to perform, and fits in the housing I designed... but the battery life isn't great. On the 1.5Ah battery I can get about 3 hours of run time. I'm looking to improve this and perhaps you guys can provide me with some advice on how to do so.The Whelen lights suck up most of the battery life as they are the biggest drain. One of these light heads sits at about 300mA when constant 12V (non PWM) is applied. It's a little strange but on my "bright" setting the PWM duty cycle is ~70%... it's slightly brighter than just putting constant 12V constant power to the Whelen light head, but it also sucks up even more current... getting close to 400mA for a single light head. When running the lights in my beacon, I actually flash the lights about 1 second on and one second off, so that helps save a bit of battery life as the average current consumption over time is now roughly cut in half, but it's still taking up a lot of battery life.... plus they are bloody expensive... almost $100 CDN each!I have no idea how the LEDs are being driven inside of the Whelen light head, and what kind of LEDs they are. I have taken it apart but wasn't able to identify many of the components other than perhaps a few tiny mosfets and I think some kind of PIC uC that controls the built in flash patterns that I am not using. I actually can't use the built in Whelen flash patterns because when using the PWM signal to change the brightness, the on board uC cannot stay on long enough to enter a flash pattern.So this brings me to my actual question... I would like to build my own LED module that checks off a few boxes:Less current consumption but still very brightTwo modes, bright and dimI am willing to go back and completely redesign my main PCB to accommodate the new light modules. Ideally I would like to get this whole controller running off of 3.3V so I can get rid of the level shifter between my ATMEGA and radio module, but the rest of the on board components would have to also work at 3.3V. My use of the 555 timer for PWM right now and I think a few other components also kept me tied to 5V supply being on the board.How would you guys approach this? Any advice would be appreciated, you all have been such a huge help to me up to this point I've learned so much!

author: gnuarm
author_rank: Super Contributor
timestamp: January 26, 2021, 04:30:50 am
content: Nice job on the board and enclosure. The current draw of the LEDs is shown on the web page you link to, so the battery life should not be a surprise. I assume these LEDs are very bright. The sort of high current LEDs are usually white, but I suppose they come in color versions too.The only way you will get lower current designing your own driver is if the Whelen board is wasting power. If it's not inefficient, there's no point in trying. Can you take the Whelen module apart? With a power tool? With a hammer? Or do you prefer to go forward without the benefit of knowing what your competition is doing?The driver circuit can be very simple. I'm not sure what your MCU is doing if you are using a 555 timer for PWM. You can do that in the MCU. Atmel makes a 3.3 volt version of the same chip so switching to all 3.3 volts should easy.Once you know what the Whelen unit is doing that is wasting power, you can design a circuit that doesn't waste power. If the Whelen unit isn't wasting power... get a bigger battery.That said, LED drivers are pretty simple. LEDs are current driven rather than voltage, so they need current regulated supplies. There are many, many chips available for this or you can roll your own, even using the MCU. It's not rocket science. LEDs lose efficacy at high currents. So better to run 10 LEDs at half the rated current than 5 LEDs at max current. Better still to dim by lowering the current than by pulsing. An efficient current regulated circuit is like a switching voltage regulator, but the current is sensed rather than the voltage to provide feedback control.Your MCU should have a PWM output driver. I think some folks I know are using that chip to PWM a motor at ~15 kHz. That will be plenty fast enough if you use a large inductor to smooth the current. A faster PWM would let you use smaller inductor and cap. That's what the LED driver chips do. Adjusting the brightness is then just a matter of adjusting the reference voltage.If the Whelen unit is already doing this, no point in you doing the same.

author: doublec4
author_rank: Regular Contributor
timestamp: January 26, 2021, 05:02:56 am
content: Quote from: gnuarm on January 26, 2021, 04:30:50 amThank you! Yes they are very bright, I was hoping there might be some slight efficiency gain with different LED components or methods/strategies of driving them. I believe these Whelen lights have been around for quite some time so I was also hoping that perhaps some newer components may also have some gains in efficiency without the cost of brightness. I suppose I could sacrifice some brightness for longer battery life if this isn't the case though.QuoteI have taken one of these units apart and I haven't been able to identify much of what is going on inside though. I believe I identified a programable PIC uC that is likely housing the flash patterns. There seem to be some MOSFETs probably for switching the different color LEDs on and off, and I also saw a 5V regulator for the uC I would imagine... I'm not sure if this is also any indication of what might be happening inside of the Whelen light, but when hooking up a light head to my power supply, there is no change in perceivable brightness from 12V down to 10V and the current consumption remains steady. I would imagine that would indicate the light head is employing some kind of constant current driver?QuoteI used the 555 timer for two reasons... the first was the PWM frequency... the Whelen lights do not work with PWM frequency outside of about +/- 10% of 250Hz. They just simply don't turn on. With the Arduino PWM function I believe only the duty cycle could be modified but not the frequency and therefore the Whelen lights wouldn't work, so I went with a 555 timer. It also freed up some resources so I didn't have to have the controller multi tasking with trying to get a steady 250Hz using coding work arounds. If I design my own LED module then of course I can rid myself of the 555 timer as I can use a PWM frequency the ATMEGA chip can handle, or not have to go that route at all if a constant current drive circuit doesn't require it (that would be ideal).QuoteTrying to avoid the bigger battery if possible but obviously I can't defy the laws of the universe and current day tech... so if it comes down to it....QuoteUnless it is super tiny, I do not see a conventional looking inductor on the Whelen board. I can post some pictures of the board if it would help and maybe some of you guys can make better sense of it than I can!

author: doublec4
author_rank: Regular Contributor
timestamp: January 26, 2021, 05:18:35 am
content: Whelen light head opened up... components only on one side... backside of PCB glued to aluminum backing panel to act as heat sink I would imagine:This light head I haven't scraped away any of that glossy coating... but I did on another one a few months ago. Bottom center right 'U1' I believe was the PIC controller... the other two larger ICs on the left and right of the board I couldn't identify. Maybe these are the drivers? This light head has two colors, amber and red. The amber and red LEDs alternate, 3 of each color.Some other 'Q' prefix components on there I'm assuming are MOSFETs or transistors of some sort... assortment of diodes and resistors...Not sure what else to make of it.You can cycle through flash patterns by applying 12V+ to the flash pattern wire. There is a grey wire to sync the flashing to other light heads if you were building a light bar for an emergency vehicle or something. Other than that it is just GND wire and 12V+ wire to switch on the red LEDs and 12V+ wire to switch on the amber LEDs

author: gnuarm
author_rank: Super Contributor
timestamp: January 26, 2021, 09:47:35 am
content: I think you are in luck, or not lucky, depending on which way you look at it. The LEDS must be driven with a current rather than a voltage. The LED voltage depends on several factors. Without regulation using a resistor to control the current would vary a lot (along with the brightness) with the changes in voltage you tried.A switching regulator will show a drop in current with a rise in voltage. Given the constant measured current with the variation in voltage I think they are using a simple linear regulator to drive the LEDs with the corresponding wasted power. Rather than being transistors Q2 and Q4 may be constant current linear drivers, but given they are labeled 'Q' maybe not. Doesn't matter.It would be useful to measure voltages on the LEDs when lighted at full brightness. See how much voltage is "used" by the LEDs and how much is being "wasted" in the regulator. That will tell you how much energy you can recoup with a switching regulator. It may not be all that much. But if you design your own circuit you can add LEDs. That will use more power though. But as I said before, if you use twice as many LEDs in two strings instead of one they will produce more light for the same total current. It may only be 10 or 20% though, not all that easy to notice really. Add a 20% savings using a switching regulator and it starts to add up.I'm no LED expert, so I don't really know what advances may have been made in LEDs in recent years. Even harder to find such LEDs. Have you looked for a source?

author: Zero999
author_rank: Super Contributor
timestamp: January 26, 2021, 01:36:35 pm
content: Yes, the fact the current remains the same, rather than increases the voltage reduces and the lack of inductors on the board, indicates it's certainly a linear regulator.Under-driving and using more LEDs will improve the efficiency, especially with the newer blue/green/white/phosphor converted yellow/amber types of LEDs. Note about the latter. Raw amber/yellow LED chips have a poor efficiency, compared to the other colours, so lots of modern LEDs use blue/violet/UV chips with a phosphor on top to emit yellow light. If you're going to make your own LED module, avoid the old amber LEDs. Use phosphor converted, or as you want red, as well as amber, you could add some green LEDs, again make sure there the high efficiency type, so they mix with the red to make yellow, although designing the optics to do this can be a little tricky.It's possible to make your own switched mode LED driver, from discrete parts/common ICs but there are plenty of good/cheap dedicated ICs available.

author: ve7xen
author_rank: Super Contributor
timestamp: January 26, 2021, 09:48:54 pm
content: Quote from: doublec4 on January 26, 2021, 05:02:56 amThey don't seem to specify their light output, so it'd be hard to compare, but I'd guess there are some gains to be had here, especially if they were optimizing for brightness/cost and not efficiency, which seems likely given their target application. Cree XP-E2 for example seems to give about 144lm/W in red, but no idea how this compares to what they used.QuoteI don't know anything about how you'd accomplish it with Arduino, but the ATmega PWM hardware (with main clock 16MHz) will run at 244Hz if you use the 16MHz clock and a 16-bit timer/counter, or with the /256 prescaler and an 8-bit TC, since 16MHz/65536 = 244Hz. Since this is in hardware it doesn't affect your application code.You can use something like Diodes AL8805 (or plenty of alternative options) for high efficiency constant-current drive, and use a PWM output of your micro to control the current (I guess a pair of these driving 3 LEDs each for the two colours).Is this Whelen design exactly what you're looking for, or would you make changes? May as well consider your options (form factor, # LEDs, # colours, etc.) if you're going to start from scratch.Nice looking boards and great enclosure.

author: doublec4
author_rank: Regular Contributor
timestamp: January 27, 2021, 04:53:16 am
content: Quote from: gnuarm on January 26, 2021, 09:47:35 amThanks for the insight! One thing you have me confused about is the part where you said using twice as many LEDs (in two strings) will produce more light for the same total current... is this because of the drop off in "brightness" vs current being pushed through the LEDs when you drive them at/near their max ratings? So if I were to run them at half the max rated current I would theoretically achieve more light output overall using the same current?As for the source of my components I mainly use Digikey. My boards were made by Macrofab so I can spec out whatever part numbers in my BOM and they figure out where to get them from.

author: doublec4
author_rank: Regular Contributor
timestamp: January 27, 2021, 04:57:04 am
content: Quote from: Zero999 on January 26, 2021, 01:36:35 pmI think this is also what gnuarm was getting at.. more LEDs and under driving with current can produce more overall light output rather than running them at/near their max ratings. I'll look into those phosphor converted LEDs as well!I would most certainly go the route of a dedicated IC if going for a switched mode LED driver... I would like it to be fairly reliable and not something I would be experimenting with as my first attempt making my own switched mode driver.

author: doublec4
author_rank: Regular Contributor
timestamp: January 27, 2021, 05:31:09 am
content: Quote from: ve7xen on January 26, 2021, 09:48:54 pmI imagine efficiency wasn't really on their radar as the target application for the Whelen lights seems to be (emergency) vehicles... no shortage of power there compared to my battery powered application. I have no idea what the rating is either, but they are BRIGHT. The LEDs themselves aren't very big... only 1.75mm x 1.75mm and roughly 1.5mm tall. But these lights are clearly visible outdoors during a sunny day.I'll have to look into what you said about the ATMEGA chip... the timer/counter / prescaler stuff is new to me... but basically you're saying the PWM function available on some of the pins can be set to ~244Hz? In that case I could have eliminated that 555 circuit and saved a ton of board space and used the ATMEGA PWM output to directly drive the MOSFET combination chopping the common ground on the Whelen lights. If you have more info on that timer/counter prescaler stuff I would love to know how that works.The AL8805 looks interesting... I like the CTL pin that can handle dimming... If my ATMEGA was to remain running at 5V, would the PWM duty cycle essentially simulate voltages between 0.4V and 2.6V as specified by the datasheet for the CTL pin? I wonder if the ATMEGA could achieve the transition times of less than 1us? It also looks like the dimming can be controlled by a regular DC voltage, so I could also just send two discrete voltage levels to the CTL pin since I only need two levels of brightness if the former PWM scenario won't work.To answer your other question... the Whelen lights fit the bill in terms of brightness and form factor and I only need at maximum two colors in a single light head. They are compact and I've now designed my housings to accommodate them. So overall, the general form/fit/function of the Whelen lights are fairly ideal. BUT I could change that since those housings in the picture are just 3D printed, I have not invested in any molds. However, the cost is obscene and the current draw is an issue. Also, interfacing with the lights isn't great with my 555 timer circuit but if what you mentioned about the ATMEGA chip's PWM at that frequency then that could eliminate the 555 circuit. I would still have to invest in a mold for the lens but that wouldn't be a stretch thanks to China... For the cost of 20 Whelen lights I could probably get 500 lenses made.Another question for you guys... if I went with something like these constant current switching regulators, do you foresee any issues with possibly causing some kind of interference or noise on my board? Do I just put it as far away from my RF module and antenna as I can?SO many considerations and options now my head is spinning.Th

author: rs20
author_rank: Super Contributor
timestamp: January 27, 2021, 05:34:43 am
content: I've only been skim-reading, but one thing I haven't seen mentioned yet is the question of viewing angle. You can make all the photons in the world, but it's all for nothing if most of them well never reach anyone's eyes. Takethese LEDsfor instance:Part No.Viewing angleBrightness @ 50mATLCR520030°4 cdTLCR510018°11 cdTLCR58008°35 cdI 99% sure these all have exactly the same LED chip inside, but just with the LED set at a different depth into the epoxy lens, to give a different viewing angle, and nine times the apparent brightness (but from only one ninth of the possible vantage points, of course). The point here is that if you're ever optimizing something for brightness, you should be thinking carefully about luminous intensity vs luminous flux (candela vs lumens). Lenses (or selection of LEDs with appropriate built-in lenses) can go a very long way.And yes, more LEDs means more efficiency, because each individual LED operates more efficiently when it's run with a smaller current (up to a point, of course). So for the same total light output, you'll generally get more efficiency with a larger number of LEDs.For example, 50mA throughTLCR5800gives you 35cd. Looking at the graphs in the linked datasheet, the voltage drop would be 2.1V, meaning power consumption is 105mW. You could alternatively put 25mA through two TLCR5800's in series. This would also give you very slightly more than 35cd of light, but the voltage drop across each LED would be only 2V. 4V total drop for the string means power consumption of 100mW. So an efficiency boost of 5% from that change.

author: doublec4
author_rank: Regular Contributor
timestamp: January 27, 2021, 06:42:51 am
content: Quote from: rs20 on January 27, 2021, 05:34:43 amViewing angle is handled by the big lens on the front of the LED module which appears to be increasing the viewing angle. The component LEDs themselves have no built in optics so they are just bare. Unfortunately no specs are listed for the light in terms of brightness at a certain viewing angle... however, I believe they are "class 1" LED lights (for emergency vehicles and what not) so there is probably some standard floating around out there that these light heads would meet. It would give some idea of their rating if I can find the standard on the web.EDIT: found this right after hitting post:https://www.safetylightsandsignals.com/p-1167-what-is-the-difference-between-sae-class-1-sae-class-2-and-sae-class-3-warning-lights.aspxQuoteEDIT 2: I forgot to mention that the reason the Whelen lights were chosen in the first place is that the application for these beacons is a warning light system for trains. They indicate there is personnel on the tracks ahead and to slow their speed. So the viewing angle/purpose of the Whelen lights is fitting for the application. I work for a transit company and I'm prototyping this system for trial within our subway system... trying to go above and beyond my typical job function because I like learning new things.

author: gnuarm
author_rank: Super Contributor
timestamp: January 27, 2021, 12:55:37 pm
content: Quote from: doublec4 on January 27, 2021, 04:53:16 amYes, exactly. The light output does not increase linearly at the high end of current because more of the energy is wasted as heat. There are always resistances in a device and the power in a resistance goes up with the square of the current while the power turned into light is simply linear.QuoteBy source I meant manufacturer, but whichever. Digikey has excellent search capabilities. Do they include efficacy as a sort criterion for LEDs?

author: JohnnyMalaria
author_rank: Super Contributor
timestamp: January 27, 2021, 01:15:24 pm
content: If you are pursuing this as a commercial option in the US, then you should review the patent literature, particularly patents owned by Whelen. If you reverse-engineer their product to figure out how to reduce current and implement it, you could end up infringing.Here's one of their patents (expires in Dec 2023):"LED driver circuitsAbstractSeveral driver circuits for energizing series arrays of LEDs are disclosed. The LED driver circuits incorporate programmable microcontrollers and switching regulators in circuits that permit precise control of current applied to the series array of LEDs. One driver circuit senses the condition of a SYNC line such that the light emission pattern of multiple LED light sources, each with a driver circuit connected to the SYNC line may be coordinated without need for a central controller. Another driver circuit applies an overdrive current to the LEDs for a first pre-determined time period, then ramps down the applied current to a sustainable level. A four channel driver circuit provides each channel with electronic switches arranged to simultaneously turn on and electrically connect a constant current source to an LED array, resulting in abrupt turn on and turn off of the LEDs."https://patents.google.com/patent/US7116294B2/en?q=led&assignee=whelen&oq=whelen+ledThis information is easy to find.https://patents.google.com/?q=led&assignee=Whelen+Engineering+Company%2c+Inc.They have 200+ patents mainly in the LED field.Also, if you are pursuing a commercial option and come up with something novel, don't share it publicly (e.g. here). File a provisional application for a patent first (in the US). I believe the Canadian equivalent is an "incomplete" application.

author: doublec4
author_rank: Regular Contributor
timestamp: January 27, 2021, 02:37:41 pm
content: Quote from: gnuarm on January 27, 2021, 12:55:37 pmYes, they do list the lm/W in the filter options. They have a great website

author: doublec4
author_rank: Regular Contributor
timestamp: January 27, 2021, 02:49:43 pm
content: Quote from: JohnnyMalaria on January 27, 2021, 01:15:24 pmThanks for the advice. I am not pursuing any commercial application as I'm doing this for our internal company use. I'll have to look through their others patents, but that is a very interesting find and will definitely "shed more light" onto what is going on inside those light heads.I'm going to have to dive into the LED component selection and drivers and try and figure out the best strategy here. I'm not sure if I'll find a one size fits all solution since each board would have to drive three different colors of LEDs. One of the light heads on one side of the beacon is solid white, and the light head on the other side of the beacon device is dual colored and can switch back and forth from red / amber. Each color will likely have a different forward voltage so I would need to drive each set differently with its own regulator perhaps?

author: JohnnyMalaria
author_rank: Super Contributor
timestamp: January 27, 2021, 03:07:26 pm
content: You may be able to get some ideas from this company if you can get hold of examples:https://youtu.be/NVfy_OaVjzgTheir roadside beacons are very bright and communicate wirelessly.(Disclaimer: that's my brother!)

author: gnuarm
author_rank: Super Contributor
timestamp: January 27, 2021, 07:33:50 pm
content: Quote from: JohnnyMalaria on January 27, 2021, 03:07:26 pmThat's a pretty awesome product! I went to the web site but they don't actually sell them from the site. The one complaint I could find was on the 5 light version it does not say it can be charged from the car. That might be useful and is done for the 8 pack. I'd like to buy some of the 5 packs, but you know the saying about prices, if you have to ask, you can't afford it.

author: JohnnyMalaria
author_rank: Super Contributor
timestamp: January 27, 2021, 07:42:27 pm
content: They do sell direct:https://shop.nightsearcher.com/product/NSPULSARPROSQ_Rand 5-pack comes with a DC charger for vehicle.

author: gnuarm
author_rank: Super Contributor
timestamp: January 27, 2021, 07:53:44 pm
content: Wow! That violates the first rule of Internet sales, there is no big red BUY button on the page promoting them. You have to start the selection all over again on the "shop" side of the web site.I see on some pages they say it includes a DC charger - on other pages they don't mention that.The 5 packs seem to be only single colors. I wonder how much the 8 packs cost.

author: JohnnyMalaria
author_rank: Super Contributor
timestamp: January 27, 2021, 08:20:39 pm
content: I'll ask. I keep asking from free samples to demonstrate in North America but I think he sees through me.

author: ve7xen
author_rank: Super Contributor
timestamp: January 27, 2021, 08:24:35 pm
content: Quote from: doublec4 on January 27, 2021, 05:31:09 amIn the most simple terms for PWM use, the TC hardware in ATmega is just a counter that counts up at every clock cycle and a register that you set called the 'output compare' (OCR). The output is set when the timer overflows, and is cleared when the OCR matches the current timer value. So OCR directly controls when in the cycle the output turns off, and thus duty cycle, while the PWM frequency is defined by the clock frequency divided by the total number of clocks needed for the counter to overflow (which is 2^n where n is the number of bits in the counter). This all happens in hardware, so the only thing your application needs to do once it's set up is change the OCR value as necessary to adjust the duty cycle.So given a 16MHz clock, if you use a 16-bit counter, the resulting PWM frequency is 16MHz/2^16, which = 244.14 MHz. A clock prescaler is also provided that can divide the clock prior to the counter by /8, /64, /256 or /1024, so with this you could also use the 8-bit timer/counters by prescaling the clock /256.The hardware has other modes, you can see the Timer/Counter section in the datasheet and read "Modes of Operation". What I describe above is what they call Fast PWM. You can actually achieve arbitrary PWM frequencies with the provided hardware by sacrificing resolution as it gives you control over the 'TOP' value when the counter gets reset, but for your case just setting it to all ones will work.Like I said, I don't know anything about Arduino as I just write standard C for these chips. The main consideration is that the PWM output only appears on a specific pin for each timer and compare unit, so you need to make sure you wire it up to the exact right pin for the timer and compare unit you want to use, which is probably why Arduino doesn't do it by default, since I think it tries to avoid this kind of constraint. Once you wire everything up correctly it's just a matter of setting a couple registers correctly, the timer peripherals in ATmega are pretty simple.Ken Shirriff has decent looking blog article on doing this in the context of Arduino and describes the PWM modes a bit more simply than the datasheet:http://www.righto.com/2009/07/secrets-of-arduino-pwm.htmlQuoteIt's designed to be driven directly from a (relatively slow) PWM or by an analogue voltage ~0.5-2.5V. The PWM will be simplest to generate by the microcontroller; you can probably use the exact same code to drive your Whelen modules. Even at a slow clock speed, the transition times on the ATmega outputs should be in the low ns; at 16MHz a clock cycle is 62.5ns and it needs to transition twice well within this time. It will have no trouble meeting this. If you wanted to use the analogue control method you'd need to filter out the PWM frequency and then scale it to the correct voltage range, so this is more suited for using a potentiometer or similar.QuoteYou're switching fairly large currents at fairly high frequency, so it'll be a consideration, especially if you need any sort of EMC approvals. If you follow the layout and part selection guidelines though I doubt it'll be an issue, but try to keep the driver/LED loop as tight as possible anyway and I would fit the vaguely suggested filtering capacitor across the diode string close to the regulator. Diodes makes AL8807 which is basically the same chip but with controlled rise time for reduced EMI, and the datasheet for this one goes a bit further into EMI considerations (which would also apply to AL8805). You will pay with a couple % of efficiency and a few 10s of cents, but other than that it's basically the same chip. Test both if you're concerned about it.QuoteThe driver doesn't care about the voltage (as long as it's low enough that it can forward bias them from it's supply minus whatever the switch etc. drops). However, output efficiencies are fairly different for different colours, as is the perceptual 'brightness' so you probably want to drive them with different currents, but this is just a matter of changing the current setting resistor. If you really wanted to cost/size optimize it, you could use the one driver chip per side and switch between LED strings with e.g. FETs and use the PWM control to change the drive current as necessary to balance brightness, but for your case I don't think you need to go that far and would probably just have separate LED drivers for each string, each controlled by a separate PWM channel (or maybe each side can share channels if they run the same patterns). You might choose to use a boost driver for the white side if you're putting more than 3 LEDs in series, but for your application I would probably go with the more versatile symmetric design with 2 strings on each side, which would give you the flexibility to populate whatever LEDs you might want in the future.Personally my next step would probably be to get the AL8805 evaluation board and order a bunch of different (most efficient I can find) chip LEDs and experiment with various drive currents to estimate power consumption, as battery life seems to be a major consideration. This will give you a good idea of what you will be able to achieve in the final product and whether you need to rethink battery size which will drive some of your other design decisions.

author: drvtech
author_rank: Regular Contributor
timestamp: January 27, 2021, 09:06:22 pm
content: Just a quick note about your statement near the beginning on level switching. The Atmega328 is perfectly happy at 3.3V provided you run it at less than about 12MHz (there's a graph in the reference manual which shows you the max speed against Vdd).

author: doublec4
author_rank: Regular Contributor
timestamp: January 27, 2021, 09:15:37 pm
content: Quote from: JohnnyMalaria on January 27, 2021, 03:07:26 pmThose are definitely cool and I actually came across those when I first started up this project. I'm essentially trying to do something somewhat similar. I don't need fancy flash patterns or sequential/directional lighting, but the RF modules in my units will allow for remote operation of the lights to change colors to signal oncoming operators. They can also report back things like battery status for lights that are out of line of sight so you know they are still operational for example.

author: doublec4
author_rank: Regular Contributor
timestamp: January 27, 2021, 09:39:26 pm
content: Quote from: ve7xen on January 27, 2021, 08:24:35 pmSo much great info here, thank you so much, these are all things I will be looking more in depth into.After spending more time looking into the Whelen lights and some of the patents, something also "clicked" and I came to a realization. In one of the patents there is mention of the LED driving circuit that overdrives the LEDs when you first turn them on. I didn't see anything about why this happens, but on my power supply, the light heads jump up to about 0.5A when you first power them on and then after a few seconds settle in around 0.2A (depending on what color) when powered with constant 12VDC.My PWM circuit at 70% duty cycle is bright... brighter than the constant 12VDC scenario. My current consumption is also higher and after reading the patent am thinking that I am working the LED and onboard Whelen controller to constantly start the light head up in this "overdrive" state. This is why I'm seeing such a high current consumption in my application. In retrospect I should have had my "bright" state wired to direct 12VDC and just skipped the PWM signal. This would have solved my battery problem in bright mode... but the cost of the lights is still a problem that this doesn't resolve.... so I am still going to make my own light head.Therefore, if the linear regulation approach already used by Whelen is reasonably efficient and more compact than a switching regulator circuit, plus does not introduce RFI to worry about... I might just stick to that. Depending on what discrete LEDs I can find, I can still physically fit 6 LEDs on a board of the same size and I can split them into 2 strings of 3 LEDs each. Therefore each light head would require 2 driver circuits (four in total for a single device) and as suggested I can use MOSFETs to control their on/off state, all of them sharing a PWM signal to the drivers to control their brightness. I have no need to make one light head bright and one light head dim. A solid amber light head would have both strings always on, and a dual color light head would only have one string on at a time.If that approach sounds reasonable... I now need to find some VERY bright and efficient colored LEDs meant to be used with secondary optics. I'm trying to figure out which components are used in some of these SAE class 1 rated lights without much luck. I can find plenty of very bright LEDs in white, lots with built in dome lenses etc, but not much on the front of color/no optics/BRIGHT.I have some searching to do, but another thing came to mind... does a linear driver exist that has some sort of built in flashing function? Ie. set some resistor/cap values and it would set the flashing rate (ex: 1Hz)? I'm typing as I'm thinking so I haven't done my own search yet, just throwing ideas onto the screen as they come to me...

author: doublec4
author_rank: Regular Contributor
timestamp: January 27, 2021, 09:48:42 pm
content: Quote from: drvtech on January 27, 2021, 09:06:22 pmThanks! Yes I had looked into that, shouldn't be a problem. For this board I used 5V since I just "wanted it to work" and other components were still 5V dependent. I had some prior experience with the ATMEGA chip with 16MHz external oscillator, so without risking a mistake I went with it for now. In the future I'll drop the clock speed and voltage if I can get everything running happily off of 3.3V ... this will also change some of the PWM considerations (if I need them) that ve7xen posted. Lots of work to do!

author: ve7xen
author_rank: Super Contributor
timestamp: January 27, 2021, 10:23:37 pm
content: Quote from: doublec4 on January 27, 2021, 09:39:26 pmPerhaps it is just that their default state is configurable and has been set to less than 100% or isn't 100% by default?QuoteOnce you've found appropriate LEDs and know the current you want to drive them at and their Vf at that current, it's pretty trivial to calculate efficiency (P=IV; current is constant, and you know V for the LED string - the remainder is your loss). Such drivers can be fairly efficient if they don't need to burn a lot of voltage, so if your strings are fairly close to your battery voltage, this could be quite efficient, but it won't be as efficient as a switcher since you will need to handle the variable battery voltage. You still may need to consider RFI due to your PWM edges, but yes it will be less of a concern than using a switching regulator.Lots of linear constant-current LED drivers out there too, in single or multiple channel variants, some with digital control so you don't even need to run your own PWM. Before you try to pick one though it will be more important to know your intended drive current and expected power dissipation, as this will probably constrain you considerably.QuoteThe reason you may want different drive currents has more to do with the differing efficiency of LEDs and the different sensitivity of the eye than wanting different brightness. You might find a good balance that would let you use a fixed current for all LEDs, but I think you will probably want to tweak this so the white isn't blinding AF and the amber appearing dimmer than the red and suchlike. I would just use the PWM signal to turn them on or off too, rather than having a separate MOSFET for that, but either choice would work.QuoteThe optical side I know little about, but it does appear that Cree's application guide specifically calls out 'emergency vehicle lighting' and that's probably a good place to start. They recommend the XQ-A, XQ-E and XP-E2 series for this.QuoteYou're back at the 555!Such things certainly do exist, I've seen a couple for low-current indicator applications (mainly to allow controllers to sleep while the LED continues to breathe or whatever), but I'm not aware of anything at the kind of currents you're likely to need here. I'd just continue using a micro, cheap enough and versatile.

author: doublec4
author_rank: Regular Contributor
timestamp: January 28, 2021, 04:37:28 am
content: Quote from: ve7xen on January 27, 2021, 10:23:37 pmAlso a good point... could be... I believe I also read somewhere in the patent something about 10% to 40% pwm... I'd have to go back and verify what they were talking about because on this model there is no bright/dim setting by default. So perhaps "bright" is 40% duty cycle. Regardless, there is still that very big current spike when you first turn them on that corresponds with their "over drive" mention in the patent. So either way when you first turn them on they are drawing more current than when they eventually settle in.QuoteRight. So because my battery voltage goes from ~12.4V to 9.3V my series Vf has to be below that for the LEDs to work through the range. I've read that with a simple series resistor to regulate current, one should leave about 25% of the voltage head room to be taken up by the series resistor to ensure reliable current regulation. Do these drivers work on the same "general principle" or is this some figure that is different to each regulator and I should be looking for in the datasheet?EDIT: Out of curiosity... is there any reason why I couldn't use a single switching regulator to drop my battery voltage down to around constant 9V (that would also be able to supply enough current) to feed multiple (or one with multiple channels) constant current drivers to drive the LED strings? This way I don't have a large variable voltage head to dissipate through my constant current drivers? It would bring back the issue with potential RFI but it could be more power efficient at the cost of space/part count/price for the added switching regulator. It would only require one switching regulator though instead of using multiple in the case of needing multiple switching regulator LED drivers for the different channels assuming that multi channel switching regulators don't exist / are rare. Just spit balling ideas in the middle of the night here.QuoteGood point. I have been noticing that, for example, green LEDs seem to put out a ton more light for the same amount of current than other colors. Green isn't a color I need but as you said, white follows the pattern of higher efficiency than my other colors.QuoteI did see that on their website so it gives me some starting point on intensity. I'm still in the early stages of my searching but I am having a hard time finding color LEDs of similar intensity that are meant for secondary optics. Most already have the domes and what not built into them. I didn't expect it to be this obscure.QuoteFair enough. There is a reason the 555 is so popular thoughlol. I may also have a reason to produce a board that does not have RF communication capabilities and just flashes the lights on/off... so I may still need to fall back on a 555 or something to generate a PWM signal instead of using a uC. It would save me the time of having to program them. We'll see what happens on that front eventually...

author: ve7xen
author_rank: Super Contributor
timestamp: January 28, 2021, 07:38:26 am
content: Quote from: doublec4 on January 28, 2021, 04:37:28 amYeah, so if you go linear, then when the battery is full you are burning 3V across the regulator. Which means about 75% efficiency, improving as the battery voltage drops.The problem with resistors is that they don't regulate at all, the current is directly related to the voltage across them. So current (and thus brightness) will decrease with battery voltage, and you need to size the resistor for the 'worst case' voltage drop to make sure you're not over driving the LEDs. The tighter you make the margin here, the more LED current will vary with battery voltage / temperature etc.Active regulators are actually regulating, so they won't have a significant problem with that as long as they have sufficient headroom. Much like the difference between a traditional and LDO series regulator, this is going to depend on their topology and parameters. This will probably be called dropout voltage or minimum out voltage or something like that on the datasheet. I'd expect it should be under 1V for a decent modern chip at these sorts of currents.QuoteNot really. You could also boost the voltage to run bigger series strings, which has a (local) effect of increasing efficiency, but your overall system efficiency still goes down since your linear regs need to burn some power too, and your switcher is going to be no more efficient than a good constant current one. Since the V difference here between your battery and intended LED strings is pretty small I don't think it'd be worth it, probably not much more efficient than going pure linear. If you made larger strings, you might see some gains, but discrete switching drivers would see them too.As I mentioned before, you could also probably get away with using a single constant-current driver, or at least one per side by alternating which LED string is driven or maybe use a boost driver instead and put the two sides in series. Depends a bit on what patterns you want for the outputs, but even then you could also treat this like a multiplex system if you have headroom on the LED's peak current (eg. alternate between the 4 strings at 4x the current results in the same average current in each, do it at some decent frequency and it's invisible). But this all seems like premature cost optimization to me. They're options, but my impression is that a couple bucks of parts per unit probably doesn't matter to the total unit cost what with NRE and considering your small run, and you're not too super cost conscious anyway. In fact it'd probably cost more if you factor in the NRE to make it work. Go there if you need to for board space or whatever but otherwise I would KISS.QuoteIt's great, and maybe you find a use for it here, that would be awesome. In case you weren't' aware, both Microchip or DigiKey (and others I'm sure) will program the chips for you with code you supply for a pretty low fee, but maybe that's not what you were referring to. At this point I think I'd be quicker spinning up a solution for you application with an AVR than a 555, and it probably costs about the same while being a lot more flexible!

author: doublec4
author_rank: Regular Contributor
timestamp: January 28, 2021, 02:48:30 pm
content: Quote from: ve7xen on January 28, 2021, 07:38:26 amGood advice, I will stick to the linear regulators for now and see how it builds out in terms of space on the PCB. Small cost differences aren't a big deal here. The cost savings of anything I design will eclipse the $80 - $100 cost PER Whelen light head so whatever happens I would still be way ahead of the game.QuoteI was not aware... I've never built any PCBs in volume, none with an on board controller. I was assuming I (or another third party) was on the hook to figure out a way to batch program (I think that's what its called?) the controllers once they are already on the board... but that's great to know. I'd certainly be interested in that service because it's one less thing for me to worry about, and I wouldn't have to sit here and repeatedly program a few hundred of these things myself haha! And as you said, it would maintain the flexibility of the system if changes had to be made or new requirements were made.

author: ve7xen
author_rank: Super Contributor
timestamp: January 28, 2021, 06:51:19 pm
content: Quote from: doublec4 on January 28, 2021, 02:48:30 pmIn a 'real' volume production run, it usually makes most sense for whoever is testing the finished assemblies to also do the programming as part of the PCBA functional testing. For small runs of 100s it may not be worth it to outsource testing (which includes supplying test jigs, test scripts, documentation, etc.), and instead choose a cheaper and lower touch assembly house that will just place the parts and pack the boards up. Or if you were to do in-house assembly.See here for Microchip's program:https://www.microchipdirect.com/programming, they have full online quoting & ordering. DigiKey doesn't have much online but they mention it here:https://www.digikey.ca/en/resources/value-added-services/index

author: gnuarm
author_rank: Super Contributor
timestamp: January 29, 2021, 02:26:33 am
content: Quote from: doublec4 on January 28, 2021, 02:48:30 pmI find the time spent programming a device is typically not a big deal. I build a board that is programmed and tested on a custom test fixture. The first step is powering up of course, but the next test is to use the programmer to talk to and then program the FPGA (rather than an MCU). The programming takes 18 seconds (reported) out of a 2 minute test time, so not really a big deal. Of course the programmer is connected to the test fixture rather than the board under test so no time for connecting and disconnecting the cable and saves wear and tear on the cable.While a distributor won't typically charge for the setup, etc of programming your parts, they do charge per unit and will have a minimum. I don't recall the minimum volume when I asked for a quote. The charge was a reasonable $0.50 per chip. Still, I found it to not be required or even useful really. Programming is just a part of the testing process. I assume you would do that before inserting the board in your assembly.