Maker Pro
Maker Pro

Multi-phase sine wave LED oscillator

RagnarokEOTW

Mar 23, 2015
6
Joined
Mar 23, 2015
Messages
6
Hello. I'm Ragnarok. I'm sorry to say I'm very rough around the edges when it comes to electronics - my knowledge is based on some rather distant lessons and what I need to know to not electrocute myself when I'm doing stage technician work - so while I'm somewhat confident I'm on the right track here, I'd like to both check I'm not making mistakes and I actually understand what I'm putting together.

I'm a bit of a wargaming nut, and I'm working on a very big scratch-built vehicle that I'd like to go above and beyond on.
(For any of you that do know the Warhammer 40,000 universe, it's a Warhound Titan, but I'm building it in 54mm scale, about twice the size of the official model).

The model will mount what's supposed to be a plasma weapon, and what I'd like to do is make the "barrels" out of translucent plastic and have them lit with blue-green LEDs.
I'd thought about hitching in a very basic oscillator, but during a conversation with a friend, there was a bit of a misunderstanding, and he thought that rather than merely having the glow flicker, it would actually "travel" along the length of the barrels. And that all sounded cool enough that I went off to change my plans.

It's not been too difficult to poke around Google and remind myself of what a three phase sine-wave oscillator looks like. Most of them look more or less like part A of the picture below:

Three%20phase%20and%20LED.jpg


(Sorry, I have no circuit diagram software, so I threw together a sketch with my graphics tablet. I promise that, whatever that mess looks like, I do actually know how to use it.)

... I'll come on to part B in a minute, but for now, part A, as I don't want to just take any old circuit diagram and not understand what's happening.

This is completely rudimentary stuff, I know, but I'd like to see if I actually know what's happening. So, here's me trying to apply my limited knowledge. Please correct me where I'm wrong.

R1, R2 and R3 are all the same and usually seem to be between 1kΩ to 3.3 kΩ in most versions of the circuit I've come across. They're obviously current limiting resistors that stop the transistors shorting the power supply (or each other, which is why they're all individually current limited, not one current limiting resistor for the whole circuit).

R4 (and R5 & R6) control the rate at which C1 (and C2 & C3) charge or discharge, therefore setting the time constant and the frequency of the oscillation.

It's C1 (etc) that switches T1 (etc - sorry, I realise I failed to label the transistors*). When there's charge in C1, there's a potential across T1's base to the Emitter, current flows, switching T1 on so current can flow from the Collector to the Emitter. Output 1 then goes low, and C2 therefore discharges through R5 (switching T2).

*While I'm at it, also assume I will include a switch in the circuit!

When C1 is empty, there's no potential, no current, T1 is off, Output 1 is high, and C2 then charges through R1 and R5.

~~~~~

So, assuming I'm not making drastic mistakes, at this stage, I have a few questions:

1) When I switch the circuit on, what starts the oscillation? Is it simply the tolerances of the parts? Because without that, it looks like all capacitors would charge simultaneously until an equilibrium was reached with the rate they were discharging through the transistors.

2) A few versions of the circuit had an extra resistor at the point marked Q, of the same resistance as at R1, R2 or R3.
I'm guessing that the purpose of this would be so the resistance that the capacitors discharge through is the same as the one they charge through (which presumably results in a better sine-wave?)

3) If I wanted four or five phases instead, do I need to do anything more complex than just copy the repeating unit here? Having more phases would allow me to use more LEDs and improve the "resolution" of the lighting effect.

4) I'm assuming the frequency is calculated the same way as a normal phase-shift sine-wave oscillator:

f = 1/(2 * pi * R * C * SQRT(2 * number of stages))

I'm looking for a frequency somewhere in the region of 0.2 to 0.5 Hz (I'm not certain yet, so I will probably actually have R4, R5 and R6 as preset potentiometers so I can decide what looks best), so I'm assuming I need R * C to be in the region of 0.1s to 0.3s, depending on exactly how many stages I have.

~~~~~

And on to circuit B. This is the very rudimentary circuit I plan for each phase to drive.

R7 is the current limiting resistor (and will probably be shared between all the mini-arrays).

R8... well, I've thrown this in as it occurs to me that the LED's voltage drop will clip the sine-wave, and I don't want them spending too much of the cycle off (as I'm hoping to run everything on a relatively low voltage, ideally 2.4V, but no more than 4.8V)

... and on the front of clipping the sine wave, it's also just occurred that I probably need a further resistor limiting the current supplied to the transistor's base, as otherwise it may spend much of the cycle fully "on" (at least as far as the available current is concerned).

~~~~~

Hmmph. Sorry about that rambling mess. I'm really rusty, and I want to make sure I know what I'm doing rather than screwing up, so any advice you can give will be very useful.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Google the 4017 and 555 chips. You'll find lots of led chaser circuits.

I just Googled "4017 555 led" and that brings up a few. :)
 

RagnarokEOTW

Mar 23, 2015
6
Joined
Mar 23, 2015
Messages
6
Hmm. While a decade counter circuit would be simpler, I want an analogue effect with the LED arrays fading more gradually on and off, and the potential for more than one array (partially) on at once.

I guess the 4017's output could be smoothed with capacitors (and perhaps even having each LED array triggered by more than one output on the counter) but then it's not going to be quite so simple as a circuit.

EDIT: Actually, you know what? It's going to be diffused through transparent plastic, so digital isn't too much of a problem. I'll need to check whether the 4017's output will drive the high intensity LEDs I've got, and I'd've preferred to keep it on a lower voltage, but it does drastically simplify things.

That said, if anyone does want to make sure I'm not misunderstanding the oscillator above, that would still be much appreciated!
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
The 555 is the limiting factor for the minimum voltage for this circuit. An alternate oscillator that operates at a lower voltage will allow you to operate the whole circuit at a lower voltage.
 

RagnarokEOTW

Mar 23, 2015
6
Joined
Mar 23, 2015
Messages
6
It's not really a problem. I did have other motivations for changing the model's circuit to 4.8V, at that voltage it's easy to find 555 ICs that'll work at that.

I do however now have a different question. With the 555, increasing the voltage to the control pin reduces the range through which the timing capacitor has to charge, therefore increasing the output frequency, yes?

As such, I'm thinking about extending the basic chaser circuit to include a "firing" effect for the model.

Press a button, start some capacitors charging (at a rate limited by a suitable resistor) and driving the 555's control pin from this voltage (so that the chase effect speeds up as the caps charge), then at a suitable voltage have the caps discharge through some high power LEDs that are mounted so the whole translucent part of the model flashes brightly (probably white rather than the blue I'm intending for the chase effect).

I've got a couple of ideas for how to get a momentary switch to charge capacitors to a set voltage once and then discharge through a load, mostly involving using a zener diode to reset a latching circuit, but seeing as people quickly detached me from the misconception that my last idea was the right one, I'm wondering if there's a smarter suggestion.
 

RagnarokEOTW

Mar 23, 2015
6
Joined
Mar 23, 2015
Messages
6
Right, I dun goofed somewhere.

Not with the basic circuit, that's fine:
CIMG7345_1200.jpg


A 556 driving two 4017b decade counters (I wanted to be able to have both sides run at slightly different frequencies, thus drifting in and out of phase*), and then throw in some NPN transistors and capacitors to switch the LEDs (they're beyond the current capacity of the 4017 and I wanted a softer fade effect).
* Since I took the photo, I have added an SPDT switch that allows both 4017s to be run from the same side of the 556, plus a reset toggle, should I want them in sync

There's been a certain amount of creative layout (the caps are 8mm diameter, so they've had to be staggered to fit the 7.62mm board spacing) and soldering (the LEDs are coming in from the back of the stripboard and are soldered on the topside to the legs of other components), but it's all working fine. (Here's one of the videos from my project log).

What isn't working fine is my attempts to utilise the control voltage pin.

This is what I cooked up for that. (Sorry, it's an even messier drawing than last time)

CIMG7353_800.jpg


The right hand side is a fairly conventionally configured monostable, driving a NPN transistor that will be connected to a number of small LED clusters.
It's meant to be triggered by the falling clock pulse from the left hand side of the 556 and flash the LEDs for about 0.5 sec.

The left hand side is also monostable, although I used a RC layout closer to that of an astable configuration with R4, a 100k resistor, between the Discharge and Threshold pins because I wanted the capacitor to discharge more gradually.

This is because I'm trying to use the voltage in C1 to drive the control voltage pin of the astable 556 that's running the 4017s, via the 500k adjustable resistor R6. R6 is supposed to serve two roles - a voltage divider to allow control of the maximum voltage at the control pin, and also to reduce the rate at which C1 charges as it approaches the threshold voltage, thus resulting in more of the charge cycle being in the high end of the voltage range (making for a more pronounced effect on the LED chase speed).

This seemed simple enough - as the voltage in C1 will max out at the threshold voltage of the 556 I was trying to control (both 556s being controlled from the same battery pack), the control voltage it supplies should be proportionally correct even as the batteries discharge.

... nope. Even though Pin 1 (discharge) is at 0V to ground (when the monostable isn't triggered) and should be earthing C1 and Pin 2 (threshold), they're constantly hovering at 2.4V, briefly jumping to 3.2V when the monostable is triggered.

Pin 9 (Right output) is also constantly high, rather than only being briefly triggered by the falling clock pulse from Pin 5. It will turn off in the instant that Pin 5 (left output) goes high when it's triggered... but that's the only time it's off.

It is marginally possible that I've managed to cook the 556 (my first attempt at assembling the circuit failed to connect C1 and C3 to ground - D'oh!). I have a spare, but I'm not planning on plugging it in just to find out I've cooked that as well.

Should this circuit work for providing the control voltage, or have I screwed up mega style?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Internally the 555 has a voltage divider made of three 5k resistors.

The top is connected to Vcc, the bottom to ground, and the two taps used for the threshold voltages for the comparators. The control pin is connected to the uppermost tap on the voltage divider.

Because the impedance at this point is effectively around 3k3, your attempt to alter this voltage from a very high impedance source (the 500k pot) is doomed.

The voltage going to the control pin needs to come from a much lower impedance source.
 

RagnarokEOTW

Mar 23, 2015
6
Joined
Mar 23, 2015
Messages
6
Ah! Yes, I kept looking at the internal circuit diagram and thinking that the way the control voltage was delivered to the comparator didn't actually look like it could override the internal divider's voltage, but that just didn't twig.

Right, that explains a lot, I shall go away and rethink...
 

RagnarokEOTW

Mar 23, 2015
6
Joined
Mar 23, 2015
Messages
6
Right, having gone away and thought, I'm thinking about just overriding internal voltage divider in the astable 556 that's driving the 4017s, and thus supplying a voltage by a slightly indirect manner.

Connecting the control pins to the supply via a 1 kΩ resistor (with a series switch) widens the range the capacitors have to charge through, but I can then retune the potentiometers to get the circuit back to the right frequency. Switching off/disconnecting the 1kΩ then causes the 556 to jump to a higher frequency, much as I want.

(I considered pulling the control pin down towards ground, but my thoughts are that the 556 would probably start acting up if I pulled it as low as I'd need to get the desired frequency - I'm not that far above its minimum voltage).

I could just about put up with the completely effect work if I had to (although the possibility of replacing the grounding capacitor with something beefier should be a possibility to soften the effect?), but I'd like a more gradual transition... and with that in mind, I'm thinking about voltage controlled resistors, which starts to sound like working with JFETs.
I've read around a bit, but I've not worked much with FETs of any type before, so it is getting outside my normal expertise... and I know I might be going off on a daft tangent again.

So would JFETs help me rescue the principles of the above control circuit (driving the JFET, rather than the control pin directly), or do I need to rethink entirely about how to supply the variable voltage?

EDIT: Actually, the quick and dirty solution with a 10-100 μF grounding capacitor to soften a blunt switching of the 1kΩ resistor might actually do the job...
 
Last edited:
Top