Author Topic: Sweeping LED circuit requirements  (Read 11802 times)

0 Members and 1 Guest are viewing this topic.

Offline Rickpercy87Topic starter

  • Contributor
  • Posts: 14
  • Country: gb
Sweeping LED circuit requirements
« on: February 25, 2016, 03:33:35 pm »
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/r9Fin7pyzDc

I 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

 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Sweeping LED circuit requirements
« Reply #1 on: February 25, 2016, 03:55:39 pm »
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.

 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Sweeping LED circuit requirements
« Reply #2 on: February 25, 2016, 05:25:24 pm »
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.   
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: Sweeping LED circuit requirements
« Reply #3 on: February 25, 2016, 06:48:22 pm »
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.
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4228
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Sweeping LED circuit requirements
« Reply #4 on: February 25, 2016, 06:53:38 pm »
Microcontrollers are cheap, versatile, and don't get bored doing repetitive tasks.
 
The following users thanked this post: Someone

Offline LaserSteve

  • Super Contributor
  • ***
  • Posts: 1285
  • Country: us
Re: Sweeping LED circuit requirements
« Reply #5 on: February 25, 2016, 07:03:17 pm »
74HCT4017 or Cmos 4017  Ten decoded outputs in one chip...

Steve
"What the devil kind of Engineer are thou, that canst not slay a hedgehog with your naked arse?"
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
Re: Sweeping LED circuit requirements
« Reply #6 on: February 25, 2016, 07:51:17 pm »
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).
,
 

Online Fungus

  • Super Contributor
  • ***
  • Posts: 16665
  • Country: 00
Re: Sweeping LED circuit requirements
« Reply #7 on: February 25, 2016, 07:55:26 pm »
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.



 

Offline Rickpercy87Topic starter

  • Contributor
  • Posts: 14
  • Country: gb
Re: Sweeping LED circuit requirements
« Reply #8 on: February 25, 2016, 08:08:05 pm »
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

 

Online Messtechniker

  • Frequent Contributor
  • **
  • Posts: 782
  • Country: de
  • Old analog audio hand - No voodoo.
Re: Sweeping LED circuit requirements
« Reply #9 on: February 25, 2016, 08:17:04 pm »
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

Agilent 34465A, Siglent SDG 2042X, Hameg HMO1022, R&S HMC 8043, Peaktech 2025A, Voltcraft VC 940, M-Audio Audiophile 192, R&S Psophometer UPGR, 3 Transistor Testers, DL4JAL Transistor Curve Tracer, UT622E LCR meter
 
The following users thanked this post: Monittosan, nugglix

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4228
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Sweeping LED circuit requirements
« Reply #10 on: February 25, 2016, 08:19:09 pm »
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.

Offline Chalcogenide

  • Regular Contributor
  • *
  • Posts: 156
  • Country: it
Re: Sweeping LED circuit requirements
« Reply #11 on: February 25, 2016, 08:34:36 pm »
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$
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8172
  • Country: fi
Re: Sweeping LED circuit requirements
« Reply #12 on: February 25, 2016, 08:39:55 pm »
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.
 

Online Fungus

  • Super Contributor
  • ***
  • Posts: 16665
  • Country: 00
Re: Sweeping LED circuit requirements
« Reply #13 on: February 25, 2016, 08:47:47 pm »
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)
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Sweeping LED circuit requirements
« Reply #14 on: February 25, 2016, 08:49:37 pm »
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.
 

Online Fungus

  • Super Contributor
  • ***
  • Posts: 16665
  • Country: 00
Re: Sweeping LED circuit requirements
« Reply #15 on: February 25, 2016, 08:55:54 pm »
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.
« Last Edit: February 25, 2016, 09:02:37 pm by Fungus »
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8172
  • Country: fi
Re: Sweeping LED circuit requirements
« Reply #16 on: February 25, 2016, 09:05:53 pm »
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.  :P
 

Offline Rickpercy87Topic starter

  • Contributor
  • Posts: 14
  • Country: gb
Re: Sweeping LED circuit requirements
« Reply #17 on: February 25, 2016, 09:34:57 pm »
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

 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: Sweeping LED circuit requirements
« Reply #18 on: February 25, 2016, 09:44:48 pm »
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).
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
Re: Sweeping LED circuit requirements
« Reply #19 on: February 25, 2016, 10:09:31 pm »
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).
,
 

Online Fungus

  • Super Contributor
  • ***
  • Posts: 16665
  • Country: 00
Re: Sweeping LED circuit requirements
« Reply #20 on: February 26, 2016, 12:42:58 am »
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.
 

Offline Paul Moir

  • Frequent Contributor
  • **
  • Posts: 926
  • Country: ca
Re: Sweeping LED circuit requirements
« Reply #21 on: February 26, 2016, 01:55:23 am »
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.
 

Offline LaserSteve

  • Super Contributor
  • ***
  • Posts: 1285
  • Country: us
Re: Sweeping LED circuit requirements
« Reply #22 on: February 26, 2016, 04:14:33 pm »
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.pdf


Steve
« Last Edit: February 26, 2016, 04:16:56 pm by LaserSteve »
"What the devil kind of Engineer are thou, that canst not slay a hedgehog with your naked arse?"
 

Offline LaserSteve

  • Super Contributor
  • ***
  • Posts: 1285
  • Country: us
Re: Sweeping LED circuit requirements
« Reply #23 on: February 26, 2016, 04:18:39 pm »
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. Thus the "factory" lamp is still there, and anything you design is just an add-on that can be allowed to fail.

Jim Thompson's patent from his web site:

http://www.analog-innovations.com/SED/Pat-3544962.pdf


Steve
"What the devil kind of Engineer are thou, that canst not slay a hedgehog with your naked arse?"
 

Offline tmalone

  • Newbie
  • Posts: 1
  • Country: us
Re: Sweeping LED circuit requirements
« Reply #24 on: December 08, 2017, 07:37:34 pm »
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:



 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf