Sweeping LED circuit requirements  - Page 1
Forum section: electronics / projects

author: Rickpercy87
author_rank: Contributor
timestamp: February 25, 2016, 03:33:35 pm
content: 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

author: Ian.M
author_rank: Super Contributor
timestamp: February 25, 2016, 03:55:39 pm
content: 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 aLM3914Dot/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.

author: Audioguru
author_rank: Super Contributor
timestamp: February 25, 2016, 05:25:24 pm
content: 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.

author: Buriedcode
author_rank: Super Contributor
timestamp: February 25, 2016, 06:48:22 pm
content: 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.

author: AndyC_772
author_rank: Super Contributor
timestamp: February 25, 2016, 06:53:38 pm
content: Microcontrollers are cheap, versatile, and don't get bored doing repetitive tasks.

author: LaserSteve
author_rank: Super Contributor
timestamp: February 25, 2016, 07:03:17 pm
content: 74HCT4017 or Cmos 4017 Ten decoded outputs in one chip...Steve

author: dom0
author_rank: Super Contributor
timestamp: February 25, 2016, 07:51:17 pm
content: 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).

author: Fungus
author_rank: Super Contributor
timestamp: February 25, 2016, 07:55:26 pm
content: Quote from: Rickpercy87 on February 25, 2016, 03:33:35 pmWhy? How can a $2 Arduino be "overkill" for something?This sort of project is exactly why microcontrollers were invented.

author: Rickpercy87
author_rank: Contributor
timestamp: February 25, 2016, 08:08:05 pm
content: 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 hahaSent from my SM-N9005 using Tapatalk

author: Messtechniker
author_rank: Frequent Contributor
timestamp: February 25, 2016, 08:17:04 pm
content: 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 connectup to 10 of course.Enjoy.Yours - Messtechniker

author: AndyC_772
author_rank: Super Contributor
timestamp: February 25, 2016, 08:19:09 pm
content: 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.

author: Chalcogenide
author_rank: Regular Contributor
timestamp: February 25, 2016, 08:34:36 pm
content: 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$

author: Siwastaja
author_rank: Super Contributor
timestamp: February 25, 2016, 08:39:55 pm
content: Quote from: AndyC_772 on February 25, 2016, 08:19:09 pmI don't usually do "+1!" stuff, but this..! Really, you couldn't say it any better.

author: Fungus
author_rank: Super Contributor
timestamp: February 25, 2016, 08:47:47 pm
content: Quote from: Rickpercy87 on February 25, 2016, 08:08:05 pmThere'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)

author: Audioguru
author_rank: Super Contributor
timestamp: February 25, 2016, 08:49:37 pm
content: Quote from: Messtechniker on February 25, 2016, 08:17:04 pmNo. Your circuit lights only one LED at a time, not sweeping them on more and more.

author: Fungus
author_rank: Super Contributor
timestamp: February 25, 2016, 08:55:54 pm
content: Quote from: Siwastaja on February 25, 2016, 08:39:55 pmThe Arduino basicallyisa 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.

author: Siwastaja
author_rank: Super Contributor
timestamp: February 25, 2016, 09:05:53 pm
content: 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.

author: Rickpercy87
author_rank: Contributor
timestamp: February 25, 2016, 09:34:57 pm
content: 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

author: Buriedcode
author_rank: Super Contributor
timestamp: February 25, 2016, 09:44:48 pm
content: 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).

author: dom0
author_rank: Super Contributor
timestamp: February 25, 2016, 10:09:31 pm
content: Quote from: Audioguru on February 25, 2016, 08:49:37 pmJust clock ones into a resettable shift register instead of clocking a decimal counter (that's what I though about in #6).

author: Fungus
author_rank: Super Contributor
timestamp: February 26, 2016, 12:42:58 am
content: Quote from: Siwastaja on February 25, 2016, 09:05:53 pmI 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.Quote from: Siwastaja on February 25, 2016, 09:05:53 pmYep. And us old-timers can solder the pin headers on the top of the PCB for wire wrapping.Quote from: Siwastaja on February 25, 2016, 09:05:53 pmThat's easy on an Uno. Just hold it with the USB connector at the top and say "BCD".B=pins 8-14C=Analog pins 0-5D=pins 0-7Pro Mini is similar.

author: Paul Moir
author_rank: Frequent Contributor
timestamp: February 26, 2016, 01:55:23 am
content: 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.

author: LaserSteve
author_rank: Super Contributor
timestamp: February 26, 2016, 04:14:33 pm
content: 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

author: LaserSteve
author_rank: Super Contributor
timestamp: February 26, 2016, 04:18:39 pm
content: Quote from: LaserSteve on February 26, 2016, 04:14:33 pm

author: tmalone
author_rank: Newbie
timestamp: December 08, 2017, 07:37:34 pm
content: 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=14158037And their video showing a similar product in action: