Hi I am looking to build a sweeping LED circuit.
Basically I'll have 10 leds, I need them to light up one after the other.
Like this video:
https://youtu.be/r9Fin7pyzDcI can achieve this easily using an arduino, but it's a bit overkill.
I believe I'll need a decade counter, but if anybody has another source or some advice, I'm very open to suggestions.
Sent from my SM-N9005 using Tapatalk
All the other options are more complex than using a MCU, which has the minimum chip and component count. I wouldn't use an Arduino - too much extra stuff you don't need. However there's no reason not to use an ATMega328P programmed as if it was an Arduino, but running off its 8MHz internal oscillator. Personally I'd use an 8 bit Microchip PIC, as I'm already set up with all the development tools for them + keep a selection in stock.
To do it digitally without a MCU would take at least two chips: 555 or similar for a clock signal then a 4017 decoded decade counter. However, that would only give you a moving dot. To get a bar effect you'd have to add a lot of diodes to OR the outputs together and a driver transistor for each LED.
Another option would be a
LM3914 Dot/Bar Display Driver. However you would need some sort of ramp generator (or other oscillator) to provide its swept input signal so at the least you'd need an OPAMP.
An LM3914 set to bar graph with a sawtooth signal input will do it for 10 fairly dim LEDs. You can use transistors or an IC to drive brighter LEDs.
As mentioned before, an MCU solution probably has the lowest part count, and cost. The only 'rub' is you have to write the software.
I routinely fall down the trap of 'well, a micro is overkill! just a bit of TTL logic or analogue will do', but if you add up all the parts, and the time to make up a board for those circuits, it almost always comes to higher cost, and takes more time. Maybe its 'electronics guilt' in thinking, that its a bit of an insult to use an MCU with all manner of clever and useful peripherals to just 'light a few LED's', and in some ways its cheating. But ultimately, it has long been the best option. Also can be upgraded later for any pattern or different inputs.
Microcontrollers are cheap, versatile, and don't get bored doing repetitive tasks.
74HCT4017 or Cmos 4017 Ten decoded outputs in one chip...
Steve
MCU + power shift register / LED driver.
A solution with discrete logic instead of the MCU can be made with just two LSI logic chips (- maybe even just one, not sure without making a sketch).
I can achieve this easily using an arduino, but it's a bit overkill.
Why? How can a $2 Arduino be "overkill" for something?
This sort of project is exactly why microcontrollers were invented.
Cheers guys.
I don't want to use a microcontroller because I would be using the project as indicators (turn signals) for my car. I'd rather not have an arduino in each tail light. Plus it would have to be powered all the time. Wouldn't an arduino also be more unreliable?
Cost isn't too much of an issue. I'm more concerned with reliability and simplicity in hooking it up to my car.
I'll do my research on the ideas you have put forward but I still may end up going with the arduino haha
Sent from my SM-N9005 using Tapatalk
What a coincidence! Just developed the circuit you need for a different purpose.
See enclosed circuit diagram as a starting point.
Has only 4 LEDs since I need only four. You can connect
up to 10 of course.
Enjoy.
Yours - Messtechniker
Nobody said anything about putting an Arduino in your tail lights; the advice is to use a microcontroller. Big difference.
If you're still thinking in terms of your options being discrete logic or some kind of 'duino, then by far and away the most useful outcome from this project will be learning to ditch the training wheels and use a 'bare' Atmel or PIC processor. It's really not that hard, and will open up your options enormously.
An Attiny44 would be very cheap and easy to write software for. But then again, you can get a complete Arduino Mini Pro clone from China for <1.5$
If you're still thinking in terms of your options being discrete logic or some kind of 'duino, then by far and away the most useful outcome from this project will be learning to ditch the training wheels and use a 'bare' Atmel or PIC processor. It's really not that hard, and will open up your options enormously.
I don't usually do "+1!" stuff, but this..! Really, you couldn't say it any better.
Wouldn't an arduino also be more unreliable?
There's nothing inherently unreliable about Arduinos. Just make sure you solder the wires onto them instead of relying on breadboard wires poked into the edge connector.
If you want to do it properly, AVR chips have all sorts of reliability-oriented hardware built into them. Watchdogs, brownout detectors ... it's easy to make the chip reset itself if things are looking bad.
But ... if you have a decent power supply and good software then you won't need them. Those chips are happy to run for years and years. I've got stuff here that's been running for 3 years (on a single battery)
What a coincidence! Just developed the circuit you need for a different purpose.
No. Your circuit lights only one LED at a time, not sweeping them on more and more.
If you're still thinking in terms of your options being discrete logic or some kind of 'duino, then by far and away the most useful outcome from this project will be learning to ditch the training wheels and use a 'bare' Atmel or PIC processor. It's really not that hard, and will open up your options enormously.
I don't usually do "+1!" stuff, but this..! Really, you couldn't say it any better.
The Arduino basically
is a bare chip - especially variants like the Pro Mini.
Look at the PCB: There's nothing there. A crystal, a voltage regulator, a reset button, an LED... that's it!
If you get the variant with the extra holes on the end of the PCB then you get an ISP header. You can ditch the bootloader and program the chip directly, mess with the fuse bits, etc:
If you want to make things that run for years off a battery then you need to remove the voltage regulator and power LED. That's easy enough to do though - just poke 'em with your soldering iron.
Yes,the Pro Mini is a sane choice. Ditch the "arduino library+IDE" and just program it with ISP (aaand you can use versions without USB and FTDI), and you have a nice little "standard" PCB for many projects; the only downside is the usage of arbitrary port numbering in the silkscreen; you need a table to translate it to the real AVR port names.
But there is very little "Arduino" left at this point. Which is exactly what makes it usable.
It seems the vast majority of people here think a microcontroller is the way to go. I'll proceed using an arduino I think.
I need to look further into the wiring on the original rear lights.
For instance if the alarm goes off, I'd still like the rear lights to flash. I can imagine the arduino may not be powered at this moment without a key in the ignition.
I'll begin looking into PIC processors, and have a look forward. But are they not more expensive to program than arduino? I can't remember much about them but something put me off.
Also in terms of versatility, are they a better option than arduino?
Sent from my SM-N9005 using Tapatalk
Just remember, the 'arduino', in terms of hardware is nothing new, I, like many, were using the Atmega88 in almost all of my projects before it arrived. Its just a convenient form factor, with a USB-serial bridge, and a regulator, most of the 'arduino' is the software used. You won't need the USB-serial bridge (but handy to have one for flashing with a bootloader) and your regulator should probably be something a bit more 'bullet-proof' to handle plugging into the automotive supply (which has load dumps and 100v spikes..). But the regulator would be needed for *any* digital circuit. A ULN2003 as a current driver for the LED's, and you're all set.
I'll admit, I wouldn't be happy having an arduino in a semi-critical project, but mostly because of the software used, and the regulator, but AVR, PIC, MSP, the micro choice is down to you,
Not to mention the almost endless possibilities of patterns, PWM fading, and hooking it up to the cars CANbus (more hassle than its worth I think).
What a coincidence! Just developed the circuit you need for a different purpose.
No. Your circuit lights only one LED at a time, not sweeping them on more and more.
Just clock ones into a resettable shift register instead of clocking a decimal counter (that's what I though about in #6).
Yes,the Pro Mini is a sane choice. Ditch the "arduino library+IDE" and just program it with ISP
I still use the IDE.
There's a folder called 'core' in the installation somewhere. That's there the "main()" function that sets up the interrupt for "millis()" then calls "setup()" and "loop()" lives.
You can delete all that and put main() in your sketch, where it belongs.
you have a nice little "standard" PCB for many projects;
Yep. And us old-timers can solder the pin headers on the top of the PCB for wire wrapping.
the only downside is the usage of arbitrary port numbering in the silkscreen; you need a table to translate it to the real AVR port names.
That's easy on an Uno. Just hold it with the USB connector at the top and say "BCD".
B=pins 8-14
C=Analog pins 0-5
D=pins 0-7
Pro Mini is similar.
I don't think you would have to power it all the time, just power it off the bulb circuit. What you might have to do is run a pair of wires between the lights to let the other uC know that both lights are on, in which case it can revert to full on (or whatever). I'm guessing these are also your hazards so you probably want something simple.
Power up, and go right into the sweep routine. If it happens to see the other light on, go full on. Only trick would be to make sure you get the full sweep done before power is lost from the normal blinker relay.
Having the uC there might let you do try some nice looking things easily like accelerated sweeps.
Considering what the alternatives look like, a micro is the way to go...
Here is the discrete implementation for a older Ford Thunderbird with the famous three light chase...
By the time you make your circuit load dump proof, a micro is going to save you a lot of time.
Note that one lamp is still switched by the blinker switch for reliability, if the circuit fails, there is still a strong chance of the single lamp flashing.
Jim Thompson's patent from his web site:
http://www.analog-innovations.com/SED/Pat-3544962.pdfSteve
Rickpercy87, did you ever find a solution and build your sweeping LED turn signals??
I recently have decided I would like to do the same thing, and modify my Audi Q5 taillights to sweep left and right instead of just blink. I found many 'sequential light' circuits online but not many that created a sweeping motion, adding LEDs to create a "bar" (with all LEDs on). However, I did just find this product which I am considering:
http://zledslights.com/home/#!/S10-Classic-Sequential-Driver-v4/p/65266240/category=14158037
And their video showing a similar product in action: