Author Topic: simple LED chaser brake light..  (Read 11193 times)

0 Members and 1 Guest are viewing this topic.

Offline DeutoplasmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
simple LED chaser brake light..
« on: June 04, 2012, 09:03:53 pm »
Project: led chaser for boat trailer brake light. Circuit: 555 timed square wave-->integrator=sawtooth--->lm3914 in dot mode for unidirectional led cascade. Is this a reasonable solution? any suggestions?  I'm trying to do this using common chip packages to ease cost.  Microcontrollers are obviously overkill, and my logic designs are too complex to be worth it.  Any alternatives?
 

Online PA0PBZ

  • Super Contributor
  • ***
  • Posts: 5214
  • Country: nl
Re: simple LED chaser brake light..
« Reply #1 on: June 04, 2012, 09:32:30 pm »
That will work, but I guess you want a triangle waveform and not a sawtooth.
And a microcontroller being an overkill... I don't know, they are cheap and easy to use.
I guess it also depends on the number of leds you want.
Something else I was wondering, is it legal to use that?  ;)
Keyboard error: Press F1 to continue.
 

Offline DeutoplasmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
Re: simple LED chaser brake light..
« Reply #2 on: June 04, 2012, 09:43:57 pm »
Well, I guess it would be illegal to use as a brake light on a vehicle, but in this case I want to have the lights mounted on the back of a boat trailer.  It should be activated by the brake light switch, perhaps with an on/off toggle to keep it from going off while driving on the highway.
 The main use would be for "cool factor", plus aiding in loading the boat from the lake in low light situations.   Cosmetically, I want the LED's to cascade in one direction, thus the choice of sawtooth input to the 3914.  The sharp fall time would make the illumination pattern seem to go in one direction.
As for the microcontroller, It would only be programmed for this one pattern, so it seems kind of a wasted potential.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19983
  • Country: gb
  • 0999
Re: simple LED chaser brake light..
« Reply #3 on: June 05, 2012, 08:30:41 am »
Cosmetically, I want the LED's to cascade in one direction, thus the choice of sawtooth input to the 3914.  The sharp fall time would make the illumination pattern seem to go in one direction.
As for the microcontroller, It would only be programmed for this one pattern, so it seems kind of a wasted potential.

Have you researched prices?

The LM3914 + 555 is far more wasteful, a simple MCU such as the PIC16F505 is much cheaper.

The analogue solution is only cheaper if you don't have an MCU programmer or the knowledge and don't want to invest in it for on off project.
 

Offline DeutoplasmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
Re: simple LED chaser brake light..
« Reply #4 on: June 05, 2012, 04:23:43 pm »
Thanks for the advice, I did the research and a PIC16F505 from mouser is only $1!  cool.  It will be a bit more expensive with the programmer, but that's only $25 or so.  I haven't used one before, but it will be a perfect opportunity to learn a new skill.
 

Online PA0PBZ

  • Super Contributor
  • ***
  • Posts: 5214
  • Country: nl
Re: simple LED chaser brake light..
« Reply #5 on: June 05, 2012, 06:34:36 pm »
Exactly, and think of all the nice patterns you can create  8)
Keyboard error: Press F1 to continue.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19983
  • Country: gb
  • 0999
Re: simple LED chaser brake light..
« Reply #6 on: June 06, 2012, 01:09:44 am »
If you're really strapped for cash, you could pick up a cheap USB programmer off ebay - I got one awhile ago but I've lost it so will just buy a new one.
 

Offline 6502nop

  • Regular Contributor
  • *
  • Posts: 88
  • Country: us
  • $EA
Re: simple LED chaser brake light..
« Reply #7 on: June 07, 2012, 09:38:38 pm »
These are known as "Larsen Scanners" (after Knight Rider producer Larsen), btw.

As it turns out, I have designed a project based on these very parts. I haven't converted them over to gEDA yet, but soon. I'm also not one of those "There's a PIC for that" posters, since I typically kick it old school. I'll try to outline what I did in text, and present the pros and cons versus PICs...

First, I used the 555 in astable, and fed the "tank" circuit (pin 2) triangular wave to the 3914, eliminating the need for the extra R/C integrator output. This frees the output (pin 3) for an LED to use for adjusting the sweep timing, and by playing with the duty cycle parameters, you can give the output a "slow-sweep-in, fast-snap-back" effect.
Pro: None, really. Con: Admittedly, not as versatile as a PIC, but gets the job done.

Next, I set the 3914 to Dot Mode, and ran the outputs to PNPs (the 3914 has active-low outputs, and are designed to be current-limited). 2N3906s are fine. These were then fed to some TIP31 NPNs, as I was driving T-194 "marker" bulbs. Since the bulbs draw about 3-400mA@12V, I played it safe and went with the TO220s. On the breadboard, they ran fine without heatsinks, not even getting warm. A thing to note: Wire the bulbs "hot" to the TIP31 collectors, and have them switch in the grounds ( +V --> Bulb --> Collector ~ Emitter --> GND). When I used the (+V --> Collector ~ Emitter --> Bulb --> GND), the bulb wouldn't light fast enough. The TIP31s switch GND faster than V+.
Pros: None, as you'll need to do this with the PIC, too. Cons: The PIC can be programmed to active-high outputs, so you won't need the PNPs, just swap in some TIP120 Darlingtons.

If you use the regular 555, it can run up to 16V on the V+. The CMOS is 15V, but operates up to a few MHz. Since this is faster than we need, a standard 555 works fine. The 3914 operates up to 18V (and can sustain peaks of 25V), which make using both the 555 and 3914 combo almost perfect for automotive use. However, you may still want to use a fixed regulator to supply the chips, as any variance on voltage will pass through to the charge tank of the 555 and affect the waveform output. A simple 7809 should do. DO NOT regulate the V+ to the bulbs or transistors! About 100-150mA will be drawn by the chips, so a non-sinked TO220 will work here, too.
Pros: Can be used without Vregs, which would be required for PICs (3v3/5v). Cons: Vreg still recommended for proper operation.

Overall, they're both about even. Factor in that you'll need a programmer for the PIC (~$30?), a computer to develop the sketches and program/debug with (~$100-500), and a few weeks to a few years to get the hang of programming for the particular PICs you use, then the single weekend I spent wiring up the 555/3914 saved me lots of money. Oh, and the whole shebang fits on the Radio Shack PCB that follows the breadboard layout (with matching project box)! If you run to the junkyard and grab some marker light sockets, you can mount the control box above the waterline, and seal the bulbs for trailer use.

I also developed two other ways of doing this, using standard digital logic, which would require 5Vregs. Since CMOS versions of these chips are available, running off 12V is entirely possible, with no effects noted for operation. Of course, using automotive power guidelines should always apply, no matter which option you choose.

Quote
Hero999
The analogue solution is only cheaper if you don't have an MCU programmer or the knowledge and don't want to invest in it for on off project.
Exactly my point.

Now, if you want to get started with PICs using this as your first project, then go for it. If you happen to have the 555/3914 chips already, then I'd stick to finishing this before using PICs.


nop
 

Offline T4P

  • Super Contributor
  • ***
  • Posts: 3697
  • Country: sg
    • T4P
Re: simple LED chaser brake light..
« Reply #8 on: June 08, 2012, 03:16:38 am »
These are known as "Larsen Scanners" (after Knight Rider producer Larsen), btw.

As it turns out, I have designed a project based on these very parts. I haven't converted them over to gEDA yet, but soon. I'm also not one of those "There's a PIC for that" posters, since I typically kick it old school. I'll try to outline what I did in text, and present the pros and cons versus PICs...


I tried to search for the 3914 and 555 based ones, no go  :-\
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19983
  • Country: gb
  • 0999
Re: simple LED chaser brake light..
« Reply #9 on: June 08, 2012, 04:55:35 am »
.
Overall, they're both about even. Factor in that you'll need a programmer for the PIC (~$30?), a computer to develop the sketches and program/debug with (~$100-500), and a few weeks to a few years to get the hang of programming for the particular PICs you use, then the single weekend I spent wiring up the 555/3914 saved me lots of money. Oh, and the whole shebang fits on the Radio Shack PCB that follows the breadboard layout (with matching project box)! If you run to the junkyard and grab some marker light sockets, you can mount the control box above the waterline, and seal the bulbs for trailer use.
You're not wrong, it's just I'd recommend in investing in learning a new skill as it'll save you money in the long run and will make it easier to get a job or tackle more complicated hobby projects.

Another idea for the non-MCU option is to use flip-flops. He wants each LED to turn on one by one then all of them turn off. This could be done with an RS flip-flop for each LED. The S input could be connected to the Q output of the previous flip-flop via an RC circuit and the R inputs all connected to the final output via another RC circuit. Standard CMOS flip-flop ICs could be used or each bistable could be build with a couple of transistors.
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: simple LED chaser brake light..
« Reply #10 on: June 08, 2012, 06:20:41 am »
Another way to do this is to use a Johnson counter.  A 74HC4017 or a 4017B, for example.  You can drive up to 10 LEDs with it.  If you have less than 10 LEDs--6 for example--then tie Q6 to the master reset pin so only Q0 through Q5 are active.  Just use a 555 timer for the clock.
 

Offline DeutoplasmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
Re: simple LED chaser brake light..
« Reply #11 on: June 08, 2012, 09:10:16 pm »
Wow!  Thanks for all the feedback!  I like all of the options posted so far, and being as I'm a bit of a beginner, I'll probably try all of them.  The PIC is something I've been interested in for a long time now, and I'm going to try out the RS flip flop version too, just to get a hang of the logic used.  Thanks 6502nop for such a detailed explanation, my final project will likely have much to do with what you recommended.  This forum, and Dave's EEVBlog are proving an outstanding supplement to formal lectures.  Thank you all for what you do!
 

Offline GBarron

  • Newbie
  • Posts: 7
Re: simple LED chaser brake light..
« Reply #12 on: June 09, 2012, 07:18:39 am »
Just a thought, but I found the Arduino to be a much simpler MCU to start with rather than the PIC.  You can buy the chip pre loaded without having the expense of buying/using the full Arduino UNO board.  That said if you don't have one it's worth spending a few dollars on one to make it easier to prototype your circuits.

If you're interested go to http://arduino.cc/it/Tutorial/Loop and there is the code and circuit to do what you want.

As far as the board goes there are lots of examples for Arduino and lots of free libraries.  I prototype my circuits with the full UNO board, which plugs straight into the USB to program.  When I have the circuit exactly the way I want it I remove the chip from the board and put it straight in to my circuit with a 16MHz crystal and a couple of caps.  Then I go to reliable eBay and buy a new ATMega328P with UNO loaded and put that in the UNO board.  Simple.
 

Offline DeutoplasmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
Re: simple LED chaser brake light..
« Reply #13 on: June 09, 2012, 08:50:34 am »
Sounds great, but for a weekend project, I don't have Kip Kay money/time to invest in all that at once.  I'll still get an arduino at some point, but for now the best i'll do is salvage parts from junk I have.  Hell, I just found an LM358, A 555, butt-tonnes of resistors/caps, and a few reasonable transformers while taking apart old junk.  I might just try to MacGyver this thing just to see if I can.
'
 

Offline 6502nop

  • Regular Contributor
  • *
  • Posts: 88
  • Country: us
  • $EA
Re: simple LED chaser brake light..
« Reply #14 on: June 09, 2012, 10:35:06 am »
Quote
DaveXRQ
I tried to search for the 3914 and 555 based ones, no go
That's because I designed my own. I haven't released it to the wild, yet. Also, just about all the scanners I've run into use the 555 as the main oscillator, running in astable mode. The differences are in what they do with the clock pulses once they leave pin 3 (or, in my case, pin 2).

Quote
TerminalJack505
Another way to do this is to use a Johnson counter.  A 74HC4017 or a 4017B, for example.
Heh. A funny thing just happened...
Whilst looking for the schematic I used for the described 3914 circuit (to throw into gEDA), I found the box I used to hold the parts, and there was the schematic. Which had, prominently, a 555 running to a CD4017, which fed TIP120 Darlingtons, wired to the 914 bulbs.

Well, crappola. I could've sworn that I used the 3914 for that one. I remember tweaking the damned thing to get the sweep right.

In any event, as soon as I can, I'll post all FOUR diagrams I came up with for the "KITT kits". Two use TTL/LS/HC, the other two are the 3914 and 4017 described above. The 4017 is preferred because it has active-high outputs, which keeps the parts count low, and the full 3-15V range of CMOS (no Vreg needed).

Quote
Hero999
You're not wrong, it's just I'd recommend in investing in learning a new skill as it'll save you money in the long run and will make it easier to get a job or tackle more complicated hobby projects.
Don't get me wrong - I rather like the PIC/Arduino/MSP offerings and designs, as a quick jaunt through the SparkFun and AdaFruit sites will attest to their versatility. It's just that if Duetoplasm wants this done in time to put the boat in the water this year, the 3914/4017 (%) solution seems to be the best. Grab the parts, get the RS breadboard PCB and project box, and hack it out in a weekend. I'd also suggest a small tube of RTV (Felpro or equiv) to seal up the box once everything is working.

Quote
Duetoplasm
This forum, and Dave's EEVBlog are proving an outstanding supplement to formal lectures.  Thank you all for what you do!
These forums remind me of an episode of Deep Space 9 (Valiant?), where Worf is in command of the Valiant, whose butt just got kicked by the enemy-of-the-week, and they need to technobabble their way out. O'Brien reminds Worf that he's ordering around engineers, not command officers. So, Worf (kindly) asks them, "I need a weapon... what can we build with what we still have?"
What follows after that is pretty much what you see here. Ideas get thrown around, pros and cons evaluated, and the best solution is arrived at. As shown above, it looks like I scrapped the 3914 circuit for some reason (parts count? stability? I forget.) in favor of the 4017. I'll get to work on gEDA so you can try out my solutions to see which you prefer.

nop
 

Online tom66

  • Super Contributor
  • ***
  • Posts: 7047
  • Country: gb
  • Electronics Hobbyist & FPGA/Embedded Systems EE
Re: simple LED chaser brake light..
« Reply #15 on: June 09, 2012, 10:43:08 am »
This bike light project got me an A in GCSE Electronics about three years ago. I used a combination of a 555 timer for light detection and a PIC for the LEDs. The program did various flashing patterns, the 555 timer acted as a delayed Schmitt trigger to avoid rapid oscillation.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19983
  • Country: gb
  • 0999
Re: simple LED chaser brake light..
« Reply #16 on: June 09, 2012, 10:56:39 pm »
I used a combination of a 555 timer for light detection and a PIC for the LEDs. The program did various flashing patterns, the 555 timer acted as a delayed Schmitt trigger to avoid rapid oscillation.

Just one question: why the 555? Why not use an ADC input and implement the hysteresis in software? The 555 isn't necessary.
 

Online tom66

  • Super Contributor
  • ***
  • Posts: 7047
  • Country: gb
  • Electronics Hobbyist & FPGA/Embedded Systems EE
Re: simple LED chaser brake light..
« Reply #17 on: June 09, 2012, 11:03:10 pm »
I used a combination of a 555 timer for light detection and a PIC for the LEDs. The program did various flashing patterns, the 555 timer acted as a delayed Schmitt trigger to avoid rapid oscillation.

Just one question: why the 555? Why not use an ADC input and implement the hysteresis in software? The 555 isn't necessary.

Of course, but then I wouldn't have gotten the A, as it had to be more than a microcontroller project. The obvious solution is to use the PIC to do everything. Examiners don't mark you on practical or real world engineering.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19983
  • Country: gb
  • 0999
Re: simple LED chaser brake light..
« Reply #18 on: June 09, 2012, 11:16:16 pm »
Of course, but then I wouldn't have gotten the A, as it had to be more than a microcontroller project. The obvious solution is to use the PIC to do everything. Examiners don't mark you on practical or real world engineering.
What a load of rubbish. You should of course get extra marks for making things more efficient, not have marks deducted.

I would try to see if I could use a very basic MCU without any comparators or ADCs and use two inputs for the LDR, each connected to different parts of a potential divider. The hysteresis could then implemented by monitoring which input goes high/low first.
 

Online tom66

  • Super Contributor
  • ***
  • Posts: 7047
  • Country: gb
  • Electronics Hobbyist & FPGA/Embedded Systems EE
Re: simple LED chaser brake light..
« Reply #19 on: June 09, 2012, 11:29:56 pm »
Of course, but then I wouldn't have gotten the A, as it had to be more than a microcontroller project. The obvious solution is to use the PIC to do everything. Examiners don't mark you on practical or real world engineering.
What a load of rubbish. You should of course get extra marks for making things more efficient, not have marks deducted.

I would try to see if I could use a very basic MCU without any comparators or ADCs and use two inputs for the LDR, each connected to different parts of a potential divider. The hysteresis could then implemented by monitoring which input goes high/low first.

Bonus points awarded for doing light measurement through the LEDs... http://arduino.cc/playground/Learning/LEDSensor. Heh, I wish. :(

That doesn't even need an ADC or LDR, so a dirt cheap PIC16F505 can be used to do everything. Total cost after LEDs would be £1.50 or so.

But we had use to use PICAXE, which is a crippled version of a PIC, and it has some godawful flowchart software we had to design everything in. Because of its stupid limitations I could only fit three light flash patterns in - on a PIC16F887 with 14K flash that's ridiculous! Also the PICAXE doesn't let you change the assignment of IOs, they are fixed 8 input and fixed 8 output.
« Last Edit: June 09, 2012, 11:32:21 pm by tom66 »
 

Offline 6502nop

  • Regular Contributor
  • *
  • Posts: 88
  • Country: us
  • $EA
Re: simple LED chaser brake light..
« Reply #20 on: June 13, 2012, 08:03:53 am »
A bit late, due in part to a 5-year-old girl that wants to clamp on to me like a tumor, now that school's out...

Anyway, as promised, I'll present my circuits as separate posts with outlines. I also just realized that the OP didn't specify the type of LEDs to use. I'm assuming an auto/trailer use here, with high current bulbs (or LEDs).

First up, I designed my Larsen scanner (I call 'em "KITT kits") at the request of a co-worker that happens to like the show, and happens to own a TransAm. He's also a big Airwolf fan. Thankfully, he doesn't own a Bell 222 helicopter.

I came up with KITT-A, based on the 74191 counter. The 555 clocks it, the '191 counts it, and the '138 decodes it to feed the output transistors. I used a two-stage NPN design, but in hindsight, this is wasteful, as turning one on results in the other being off, so there's always one transistor drawing current. A better method is that used on KITT-D (shown later) using a PNP-to-NPN.
When the '138 gets to the decoded highest count (I have it so you can jumper between 6, 7, or 8 lights), it will then trigger the '76 to flip the '191 to start counting down. Once the count hits zero, the '76 is flipped again, setting the '191 to start counting up.

If you're not using HC logic, then the Vreg is required, which adds to the complexity and parts count. Also, not all Vreg precautions have been shown for automotive use - so play carefully.

That method seemed impractical, so I came up with...

nop
 

Offline 6502nop

  • Regular Contributor
  • *
  • Posts: 88
  • Country: us
  • $EA
Re: simple LED chaser brake light..
« Reply #21 on: June 13, 2012, 08:06:21 am »
KITT-B uses the 74193 instead of the '191. The difference is how the '193 flips between up/down modes. There are two inputs for this, /DOWN and /UP (pins 4 and 5, respectively). This is why the 7476 has been swapped out for the 7400 (I suppose the Q and /Q outputs of the 7476 could be utilized, but... meh). Operation is otherwise the same as KITT-A. I also noted on my personal notes that the 7404 inverter can be added to the outputs of the '138 and run to IRL-511 MOSFETs to trigger the bulbs. This would mean yet another IC in addition to the four (five if you have the Vreg) there.

It was at this point that I decided to relegate the 74xxx chips to the 5-volt applications (adding a KITT to the front panel of your computer, for instance), and head over to CMOS land to see what I could do there...

nop
 

Offline 6502nop

  • Regular Contributor
  • *
  • Posts: 88
  • Country: us
  • $EA
Re: simple LED chaser brake light..
« Reply #22 on: June 13, 2012, 08:10:28 am »
KITT-C goes full-on 12V capable, using the CMOS CD4017 counter. As mentioned earlier, it's just set as a Johnson counter, with a "loopback" of pins to create the back-and-forth sweep effect. This limits you to six lights, since four of the outputs overlap. I modified a circuit I found online, but since I hadn't thought about publishing my modifications, I have no notes as to who the original author is. I'm pretty sure it was on All Electronics Circuits, and was intended for computer use (it shows a Molex plug in the image).

My only major modification was to swap the 2N2222s on the outputs to TIP-120s. Most '2222 type NPNs can only pass about 500mA, which gets a bit too close to actual current measured for the T914s I had (I measured ~330mA draw per bulb). Using TIP-120s bumps that up to about 3 Amps, enough that almost any type of automotive bulb can be used (211-2, 1156/57, 3156/57, etc.). I wouldn't advise using headlamps (it'd be freakin' awesome, though!). Of course, adjust the fuse rating to compensate for the type of bulbs used.

Talking Electronics has a version of this that has diodes or resistors tied to the loopback pins to prevent any feedback into the pins they're tied into. I ran this circuit, and found it behaves rather well as presented, since (I think) the dropping resistors to the transistors absorb anything that would cause erratic behavior of the 4017. Again, my main goal was to keep the parts count low, while getting the desired function. This was the circuit I settled on for my friend.

The whole thing fits perfectly, with some room to spare, on the Radio Shack PCB (276-170) and in the project box (270-1808). When using the T-914 bulbs, the TIP-120s barely get warm. The higher current 211-2 (dome light) draws about an amp, and will warm up the TIP-120, but not enough to require a heatsink. There is barely enough room for individual heatsinks, but you could make them fit if you need to do so. Since this is for automotive use, remember to secure the chips (solder them in - no sockets!) and components against vibration using electronics-safe silicone caulking (the type that smells like vinegar when curing is a no-no!). I figured the heat issue wasn't too much of a factor, as I used the TIP-120s and lower current, but bright enough, T-194 bulbs. Make sure everything works before sealing up the seams and openings of the box with RTV (Room Temp Vulcanizing, if you need to know) to prevent anything liquid getting in there.

Now, I developed all these digital circuits because my original idea was to use the LM3914 driver as the primary chip. I had some issues with that (I forget what they were, exactly), and went digital. However, this thread prompted me to dig up my notes and get this sucker working...

nop
 

Offline 6502nop

  • Regular Contributor
  • *
  • Posts: 88
  • Country: us
  • $EA
Re: simple LED chaser brake light..
« Reply #23 on: June 13, 2012, 08:21:14 am »
The 3914 seems to be the natural choice for the KITT kit. It can operate in "Dot" mode, has up to ten outputs, and can run from voltages up to 18V. Most automotive power systems can drop as low as 9V (really dead battery) and have as much as 14.4V when the alternator is charging (a faulty regulator can easily output over 15V, so design for worst-case scenarios!). Factor in the possibility of reverse-voltage (swapped battery cables or jump-starting) and the inherently noisy enviornment (ignition and switching spikes), and you wind up with some pretty hefty design problems. So, the wider the operating voltage and the less the current draw makes for easier work. The 555 also has, mostly, these same parameters, so it looks, at first, like a match made in heaven. Or Silicon Valley.

My first design was to use the 555 in astable mode, with an integrator on the output of pin 3 to shape the square wave to a triangle. Feed this to the input of the 3914 (pin 5), and you have a sweeping effect. Or so I thought. The problem popped up when I looked at the datasheet for the 3914. The input is designed to "see" 0-1.2V, and light up one of ten LEDs based on that. Since there are ten steps, and 1.2V max, each LED represents 0.12V (it's different with the 3915/16 chips, but the range is still 0-1.2V).

That wouldn't work, as the output from the integrator would ramp from 0-to-gosh-knows-what and back down. There would be a time where the voltage was out-of-range, and you'd get either a full-bar or no display. Not what we want. We (I) want a consistent range, one that will track with the 555 and the varying Vcc of the car's power. This was the point where a cup of coffee, the drone of Phineas and Ferb in the background, and the 555's datasheet snapped on the Klieglight in my diabolical mind (Hey, Ferb! I know what I'm gonna do today!).

Even when you think you know a chip, there's invariably something you don't see in the datasheet until you really, really need it. Fortunately, it was the fact that I'm looking for a better way to send a triangle wave to the 3914 that the little graph showing what the charge/discharge waveform on pin 2 of the 555 (in astable mode) looks like - a triangle! Another look at the internal block diagram shows the divider network of the 555's comparators, which is a series of three 5K resistors. That makes the waveform hover between 1/3 and 2/3 Vcc. Perfect! All we need to do is match that over on the 3914, and we solve both problems. It won't matter what the voltage is, as we're always dividing it in thirds, and we keep the waveform in that middle third.

Sometimes, I just amaze myself.

Now, the only problem is to get the 3914 to play nice with the 555. Another peek at the datasheet, and a familiar sight was seen in the block diagram: the same type of divider network as the 555. The "top" of the network is at pin 6 (Rhi), and the bottom is pin 4 (Rlo). In the case of the 3914, there are ten 1K resistors making up the "ladder". So, if one were to put a 10K resistor from Rhi to Vcc, and another 10K from Rlo to ground, we'd have a "Vcc --> 10K --> ladder --> 10K --> GND" configuration, and the 3914 will now track the inputs right along with the "Vcc --> 5K --> CHG/DSCHG --> 5K --> GND" of the 555's tank section. Normally, the 1.2V internal reference of the 3914 is run to the Rhi pin, and that is why the input sees just the 0-1.2V range. Another quick check of the datasheet shows the input can easily handle the full power range, so we're just going to skip the internal reference for the ladder (but not the LED current!), and use Vcc. I don't know who designed the 3914 this way, but I'd like to buy them a cup of coffee.

Now, about that internal 1.2V reference: it's also used to set the output current limit for the LEDs. Putting a 1K between pins 2 and 7 allows 1.2V/1000R = 0.0012A, or 1.2mA. This is then factored by ten to get 12mA of current for the LEDs. Don't let this resistor drop too low, as the max current is about 15mA (which would be about 810 ohms - a 2K2 will give about 5.5mA). In any event, this value is why we won't need limiting resistors between the outputs and the first transistor.

After a quick breadboarding, the circuit worked as expected (a first!), with the exception of the fact that my resistor's manufacturer took the whole "10% tolerance" a little to the extremes. My high LED (LED10) wouldn't light up. Swapped the 10K pair around, and now my lower (LED1) was dark. My DMM shows that one 10K is 9912 ohms, the other is right at 9997. This was enough to throw things off. I'd recommend measuring your resistors to ensure that the two you put in there are as close to 10K as you can get, and that they're matched to each other (see Dave's video on resistor testing rigs). By the way, since 1/3 of 12V is 4V, and there are ten steps, that's 0.4V per LED. A trivial bit of info, but it may help someone when trying to diagnose a problem.

Lastly, we now have to drive high current bulbs from a 10mA output. An active-low output. Great. Experience has taught me that an NPN transistor likes to switch with a positive base input, and a PNP is just the opposite. So, a direct line to the 2N3906's base, a limit resistor on the collector to ground, and tie the emitter to Vcc, and we're in business. Like the 2N2222 or 2N3904 NPNs, the current capability of the TO-92 packages is about 500mA. Way too close to the T-194s, so we're going to add another stage. This time, since we now have an active-high, we'll just use some TIP-31s. This'll give you a good 3A if you want to run brighter bulbs. I didn't seem to need any base resistors on the TIP-31s, but shoving a 100R in there may be a good idea. Yes, I could've used two NPNs creatively wired up, but that would mean that one transistor would be on when the other was off, meaning that current would be flowing somewhere even when we don't need it. Sure, a couple of mA is nothing for a car, especially when there's typically 600A of reserve in the battery, but it's the principle of the thing. Using a PNP means that both transistors are either off or on. There. Much better.

If you've read this far, go collect your hazard pay.

For those wondering, the program used was gEDA, and I am still trying to cope with the damn thing. There's no easy way to edit components. The 555 shown has pin 2 opposite of where I need it, and the 3914 needs to shift some pins around for my particular application. There's no way to shrink overly-large devices (like those big Darlingtons) to fit, and it keeps attaching traces to points I don't want them. Those annoyances aside, I'm starting to like the (FREE!) program.

Disclaimer: I avow that KITT-A, KITT-B, and KITT-D are of my own designs, and that KITT-C was modified from an online collection (somewhere!) that I modified. I also avow that anyone, anywhere, and anyhow can use and abuse these circuits as they please, provided any neat revelations, improvements, or corrections of glaring mistakes make their way back to EEV Blog or other similar online electronics sites. EEV Blog and myself are not to be held liable if this circuit violates your local laws, ordinances, or female relatives.

nop
Now go out and build something.
 

Offline DeutoplasmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
Re: simple LED chaser brake light..
« Reply #24 on: June 14, 2012, 01:44:55 am »
Bloody hell,  what a monster my original circuit has become! :)   Thanks!  I originally was going for a simple low current led, but given this option, I might go balls out and put some kind of super bright on it.  Maybe I'll incorporate 2 light levels, one for standard use, and one for blinding the piss out of those tailgating-high-beam ne'erdowells on the highway.  But that would be hazardous i reckon.   ;D
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf