An elegant solution to flasher circuit puzzle?

thomas.hood

Newly Enlightened
Joined
Aug 1, 2007
Messages
12
Hello all,
First a little background to help explain what I'm trying to achieve: this is for a 'be seen'-only cycle lighting project.

IMO flashers are very good at drawing attention, but are less useful as regards tracking/predicting the cyclist's trajectory/speed, than a steady-source. I've seen several cycle lights that utilise a combination of steady and flashing LEDs. Similarly, wide angle lenses are good for cars in turnings, and mixing with traffic at close quarters, whereas a spot will be seen a way further off.

My idea is to have two high-end LEDs (Seoul or whatever) one with a wide angle and one with a spot, mounted next to one another (effectively coincident). By having a flashing sequence like this, I will have the steady and flashing component alternating between the two LEDs thus keeping their temperatures equal and alternating between wide and spot.


frontledsequencejm2.gif


As I've highlighted in red the pattern is a 4-period cycle, with one LED being extinguised every other period in an alternating manner.
Thinking about it further, I realised that as I was going to make a white front/ red-rear version of this I may as well drive them off a unified battery pack/ circuit. Which gives the following requirement:

frontandrearledsequenceyq3.gif


Rearange these sequences and you get:

combinedledsequencexz1.gif



In other words, what I need is a circuit that just blanks one LED in four in a cycle. Any ideas for the easiest way of achieving this, or is there a simpler solution than trying to combine front and rear that will still give me the alternating spot/wide flash/steady sequence.

Many Thanks,

Thomas Hood
 
Not sure if this is all that simple, but I built something like this a while ago.
It uses a 555 timer as a clock pulse generator and a decade counter. The one I set up sequentially sets one output high as the others stay low. By relocating the "reset" pin from the 10th output to the 4th output. it wil sweep sequentially through 4 outputs.

Tiny SOT-23-5 oscillator equivalent to the 555 plus a 4017 decade counter in an SO-16 package should do it. Hook a small P-channel MOSFET gate to the outputs and you can switch several amps with each output.
If you use a 556 dual timer, you can have alternating flashing speeds
 
Last edited:
"sequentially sets one output high as the others stay low. ... it wil sweep sequentially through 4 outputs."

Isn't this the inverse of what I'm trying to achieve, or have I misunderstood you?

I would phrase my goal as "sequentially sets one output low as the others stay high"

Thanks,

Tom
 
Just use a PIC. The 12F675 has 4 outputs, so driving the two leds would be easy. Of course, you will have to write some code to make it work, but it isn't too difficult for most people to learn.

I use something similar, but not exactly the same, as a "personal warning device" that I clip on the back of my running hat or running suit. During the summer months, it isn't needed as there is plenty of daylight while I'm running. However, during the winter months, I want to be seen when running on dark country roads where I live.

My current design uses a single AAA NiMh battery, a DC to DC converter, a PIC, a FET and a single blue Cree led. This thing is intensely bright and I don't use a lens of any kind. It flashes the Led three times very fast, then pauses for about 0.5 secs then repeats. I used blue instead of red as I wanted to be seen at longer distances at night. This device is easily visible from over a half mile away. It will run continuously for about 2.5-3 hours on one charge.

In an effort to make a new one even smaller, I have removed the individual cells from a 9 volt NiMh battery, there are 6 inside. Each cell is smaller than a AAA battery and will power my device for about 1.5 hours.

Gene
 
That's why I said use P-Channel MOSFETs. They turn ON when the gate is held low. Or you can just use an inverter and an N-Channel MOSFET. I think using a PIC would be over complicating things. I mean, you're not trying to flash out morse code.
Bada-boom bada-BING.

"sequentially sets one output high as the others stay low. ... it wil sweep sequentially through 4 outputs."

Isn't this the inverse of what I'm trying to achieve, or have I misunderstood you?

I would phrase my goal as "sequentially sets one output low as the others stay high"

Thanks,

Tom
 
Hi,

N Channel MOSFETs should work ok. You put the drain in series with
the LEDs, not the source. Also, some mosfets have what are known as
"logic level" gate thresholds, which work down to about 2v, meaning the
device can be turned on by as little as +2v on the gate. The other
types of mosfets might not turn on enough if the voltage dies down
below about 4 volts, so look for the 'logic level' type. If you are not
sure what type it is, look at the spec called "gate turn on threshold"
and it should be about 1v to 3v or lower (1v to 2v better).
 
I'm not an expert in circuit design, but as a programmer, I can't help but see you are just shifting bits. Maybe some sort of combination of a shift register and a 555 could be used. Get a SIPO register, and just loop the 4th output back to the input. You can use an 8bit register(since I think these are more common), and leave the last 4 outputs unused. The only thing I'm not sure is what would the best way to set the initial values in the register.
 
Many thanks to all. I'll go away now and read about mosfets and 555 timers...

Tom
 
Bingo on the logic level gate. I said P-Channel, because while the 3 outpus are low the P-channel MOSFETs are "on". If he used N-channel MOSFETs, there would be 3 LEDs off an 1 on.


Hi,

N Channel MOSFETs should work ok. You put the drain in series with
the LEDs, not the source. Also, some mosfets have what are known as
"logic level" gate thresholds, which work down to about 2v, meaning the
device can be turned on by as little as +2v on the gate. The other
types of mosfets might not turn on enough if the voltage dies down
below about 4 volts, so look for the 'logic level' type. If you are not
sure what type it is, look at the spec called "gate turn on threshold"
and it should be about 1v to 3v or lower (1v to 2v better).
 
Bingo on the logic level gate. I said P-Channel, because while the 3 outpus are low the P-channel MOSFETs are "on". If he used N-channel MOSFETs, there would be 3 LEDs off an 1 on.
I think I actually understand this. (Yay!) Like MrAl I think P-channel or N-channel MOSFETs should work, depending on how you connect things. It sounds really fun and surprisingly easy to do.

How much "signal" will the 555 produce? How many volts and current do they switch?
 
By far the simplest solution is a tiny PIC and some programming. You might even use one with a PWM output and use it as the regulator too ;)

If you don't fancy that then you could do the same in hardware with an oscillator and a single PAL. All you'll need to do is set up a 2-bit counter and decode the four outputs from that. Will probably draw a bit of current mind!

For the lowest power you could use a CMOS oscillator (eg LMC555) and create a ring counter in CMOS too.

http://en.wikipedia.org/wiki/Ring_counter
 
Last edited:
You can switch standard LEDs directly with it. 20mA shouldn't be a problem. It's square wave out put goes from low ~0 volts (ground) to high which is what ever the 555s feed voltage is. Ideally, you should have a mosfet or transistor on the output to control larger currents. The 555 would only be sending a square wave clock signal into the 4017 decade counter. So it can drive it directly.
Personally, This is what I'd do...
Use a Micrel MIC1557 timer/oscillator to send a clock signal to a Texas Inst 74HC4017. Connect the 4017 so that it resets on the 4th output.
Send the outputs to a Fairchild CD4011BCM quad NAND gate. From each of the 4 NAND outputs connect the gate of a logic level mosfet like the International Rectifier IRLL3303. You'll be able to switch about 4 amps per output.
That's just the way I'd do it.
MIC1557 $0.99
74HC4017PWR $0.56
CD4011BCM $0.38
IRLL3303 $1.40

I think I actually understand this. (Yay!) Like MrAl I think P-channel or N-channel MOSFETs should work, depending on how you connect things. It sounds really fun and surprisingly easy to do.

How much "signal" will the 555 produce? How many volts and current do they switch?
 
Why bother with the sequence?

In my opinion, sequential flashing is always less visible than everything flashing at the same time.

And I agree with whoever said an n-mosfet between load and negative rail is the best answer for the control element.

If you need the sequence, a little hardware logic circuit takes less time to develop than a microcontroller-based design, unless you are pretty quick at programming.

Although for fun, and hardware simplicity, I would go for an 8-pin PIC-based design.

ALTHOUGH - the risk always with a microcontroller is that the programme will crash and turn the lights off just when they are needed.

That said, I have never had a problem with a home-brew MPU circuit when I was using the internal RC oscillator option.

I have had a problem when using an external ceramic oscillator in very heavy rain - the impedances around the oscillator pins make it a little vulnerable.

Good luck

Steve
 
I hadn't commented about the sequence since it wasn't part of the OPs question (Not slamming anyone, Just my reasoning ;) ).

If you want just alternating ON/OFF for a pair of circuits. 3 LEDs on one 3 LEDs on the other, there are simpler designs. Personally, I'd use an alternating fast and slow flash scheme with at least 3 circuits. I imagine it would be most eye grabbing. The goal here is to get attention, not provide illumination.
I'm sure there are plenty of flash patterns that would be suitable and manage to keep only one string of LEDs lit at any one time, thereby reducing power consumption.

I'd love to get into PICs and have thought about it several times. Especially lately with my PWM softstarter design. I just know nothing about them. I don't even know enough to pick the right one. I mean how complicated can it be? When power is applied, ramp duty cycle to a value determined by an external pot at a rate determined by another external pot.
Anyway. I digress. To meet the OPs design requirements I think my circuit would work perfectly. Not to say yours wouldn't, but the knowledge to make yours work is a little more than the solution I propose.
For FUN and future flexibility as well as future projects make the effort to use a PIC.

I think the external RC oscillator should be fine in any weather since the clock frequency will be between 2 and 20 Hz. If it varies by even 20% it shouldn't be a problem. Of course it goes without saying that the circuit should be either potted or coated before final deployment.

Why bother with the sequence?

In my opinion, sequential flashing is always less visible than everything flashing at the same time.

And I agree with whoever said an n-mosfet between load and negative rail is the best answer for the control element.

If you need the sequence, a little hardware logic circuit takes less time to develop than a microcontroller-based design, unless you are pretty quick at programming.

Although for fun, and hardware simplicity, I would go for an 8-pin PIC-based design.

ALTHOUGH - the risk always with a microcontroller is that the programme will crash and turn the lights off just when they are needed.

That said, I have never had a problem with a home-brew MPU circuit when I was using the internal RC oscillator option.

I have had a problem when using an external ceramic oscillator in very heavy rain - the impedances around the oscillator pins make it a little vulnerable.

Good luck

Steve
 
Gosh. Just checked back to see all this! As I mentioned, this is in fact two lights (front and rear) driven by one circuit. Two LEDs at each end -- one always on, one flashing (again reasons above). I'm not trying to have a four-LED array with one being extinguished sequentially -- I agree that would be pointless. Nor do I want a particularly 'eye-catching' sequence design, as I'm not convinced they're any better.

One more question, if anyone is still reading: I can't find a simple explanation of what battery voltage I should choose. LiIon packs seem to come in 3.6V, 7.2V, 14 etc. and it seems with a buck or boost circuit I can get whatever voltage I please (probably 3.2-ish for rebels? yes?), but what are the tradeoffs?


Thanks again,

Tom
 
By far the simplest solution is a tiny PIC and some programming.
But that's not simple at all for someone who hasn't used PICs before.

Send the outputs to a Fairchild CD4011BCM quad NAND gate.
Now, what's the quad NAND gate for? :thinking:

Two LEDs at each end -- one always on, one flashing (again reasons above). I'm not trying to have a four-LED array with one being extinguished sequentially -- I agree that would be pointless.
I'm really disappointed. I thought that's what all this was about, and hence all the discussion with lots of fun sounding ideas above. But if that's what you want, wire the two steady-on LEDs with whatever resistors or regulators you like, and use an unstable multivibrator to swap between/flash the other pair (one front, one back).
 
I hadn't commented about the sequence since it wasn't part of the OPs question (Not slamming anyone, Just my reasoning ;) ).........

........
I think the external RC oscillator should be fine in any weather since the clock frequency will be between 2 and 20 Hz. If it varies by even 20% it shouldn't be a problem. Of course it goes without saying that the circuit should be either potted or coated before final deployment.

Ooops, I hope I didn't appear to be slamming anyone. Apologies to anyone who felt that way.

Regarding external RC oscillators.
I was talking about PIC designs. In general, you would run the PIC a lot faster than the flash rate required. Otherwise the boot-up sequence will take forever.
Most of them have an internal RC oscillator optiion which you ust enable, so it saves you two external components and gives you a 1% accurate moisture-proof clock at 4MHz - with lower options in the newer designs.
At 4MHz the chip only consumes 1mA or so, so its power consumption it tiny compared with the LEDs.
When the circuit needs to be off, it is traditional to put the PIC into 'sleep' mode where it only consumes a few microamps, but can spring into life in a few microseconds and start operating again when a pin is pulsed (by the on-off switch for example).

That said a 2 to 20Hz external RC clock must be possible, and would be most interesting to work with. The R would have to be quite high, and the C quite large. The PIC design is 'fully static' which means it should be able to run at any freqency from DC to its maximum.
It could be tough to get the design to boot up initially as there are some internal protection timers.

Steve
 
Last edited:
One more question, if anyone is still reading: I can't find a simple explanation of what battery voltage I should choose. LiIon packs seem to come in 3.6V, 7.2V, 14 etc. and it seems with a buck or boost circuit I can get whatever voltage I please (probably 3.2-ish for rebels? yes?), but what are the tradeoffs?

Liion cells are a good choice as they are light and small for a given capacity.
They have to be charged correctly as there are genuine dangers if they are abused too much (and that isn't actually much) - search CPF for examples and heed Newbie's warnings.
It is best to avoid charging Liion cells in series without a balancing circuit.

If you dischage them below a certain voltage, they are damaged, so you always need a protective voltage cut off.

The output voltage range spans the forward voltage range of most white leds, so with one cell and one led, you really need some form of buck-boost circuit.

Sometimes a couple of NiMH cells and a boost circuit saves headaches.


Steve
 
Top