Hi all, Longtime lurker. I was talking to Rich over at MtnElec about a programmable driver for use with an Led to strobe at ~1x.xx Hz (Precise freq Redacted to prevent misuse). However he advised me that I would need to source a driver with either an onboard/external oscillator to get the precision I need. This is a fairly specific use-case scenario (Emergency vehicle authorized use), and one that googling was less than helpful with.
Any firmware Devs successful at getting strobe precise to 2 sig figs?
That frequency is illegal because it changes traffic lights to emergency mode for ambulances. They lock out the intersection long after you have passed before it resumes normal operation again.
This is going in an ambulance.
I see. Where do ambulances usually buy these things?
Lighting options from the outfitters usually (AEV, Braun etc.). Can be purchased from a couple of online retailers as well.
But in this case we are a nonprofit and dont have the cash for a $400 design that isn’t as reliable as it should be. So many burnt strobe tubes…
Well it sounds like a noble effort, so I’ll assist. You’re on the wrong track trying to customize the driver’s clock. Any driver will do, just tweak the software until you achieve the desired frequency. Be warned the frequency will always vary a bit based on the driver’s input voltage and ambient temperature. That’s even true if you go with your original clock-based idea. But the good news is I can guarantee there is tolerance built into the stop lights because the manufacturers face the same issues. And they need it to be reliable, so the acceptable error is probably rather generous.
Very much appreciated! Excuse my quick retort.
How much of a variance are we looking at? Alot of the transmitters/receivers on the market use a crystal oscillator as a reference clock to prevent the easy duplication of the rate. In any case it’s worth a shot to try, if only to use as a backup to a truck mounted unit that has failed.
What would you recommend as a MCU programmer
I don’t know what the variance would be, I can only assume it’s enough. I don’t really want to be known for helping open-sourcing a complete solution. But I learned what I know from reading on BLF. Here’s loads of free flashlight code to edit and flash to a flashlight:
http://bazaar.launchpad.net/~toykeeper/flashlight-firmware/trunk/files
And the info on where to get a programmer and how to use it is around BLF too.
No worries, there is some extra special wavelength sauce to get it working that I haven’t/won’t mention. I removed some key information from the originating post as well.
Yea probably for the best. Goodluck.
If you want to build your own mirt with a stable-enough frequency, you’ll have to use a µC with a crystal clock, not RC or worse, self-running.
Even cheapies will use 455kHz ceramic resonators, not as accurate as crystals, but tweakable.
Looks like the Attiny uses RC. Any idea of a driver that uses a dedicated crystal clock or similar? I think I’m going to have to abandon the flashlight form factor and opt for a dash mount unit with an Arduino or similar.
As its coming close to the slippery season up in the northeast, a MIRT would be super useful on our truck to slow/stop traffic before we get to an intersection in the city. Seems like less and less people notice us these days with cell phones and noise isolated cabins of cars.
One feature I wanted on my flashlight was a precise 10 second timer. I made it flash one pulse every 10 seconds so I could count time while keeping my eyes on my work. I achieved precision so good with at standard Attiny13A that there is no noticeable variation in the exact moment it ticks after running for 10 minutes. That’s a lot of precision. Granted, the code needs tweaking for each flashlight it is loaded on, but I have done it with 3 flashlights to date and achieved the same results.
No luck so far, looks like we figured, a reference crystal is needed. Sigh. Our supplier is out of the unit we usually buy, giving us 3 months to wait. So still need to build this. Any idea where to get a reasonably small driver with a clock?
Thanks!
Wellp, you’d need an external clock signal, sample that, and divide down to get the exact frequency you want.
A 32.768kHz crystal or oscillator is small and can be divided down nicely. So if you need (making it up) 12.345Hz, you’d divide 32768/12.345 = 2564. So you sample the input, count 2564 pulses, ping the LED, reset the count. Rinse, repeat.
It’s possible to do with a regular driver, but you’d need to add the osc and reflash the µC with your own code to do the above.