Help needed designing square wave osc (555)

Hi, I've been trying to calculate "standard" values that would make me a 555 R1/R2/C1 square wave oscillator with a 50% duty cycle operating at close to 30Hz.

Can someone assist? My numbers come out with "odd" component values.

I need a 30Hz and 60Hz oscillator eventually. Ideally a variable oscillator that could be set to 30 or 60 would be ideal.

Thanks, Dave

Reply to
Kasterborus
Loading thread data ...

Using the standard oscillator configuration (the one that uses the discharge pin) and the standard 555 (the original design made with bipolar transistors, not CMOS) it is hard to make a square wave oscillator. You will need a switch to change the capacitors to change frequency. As to strange values, have you considered using 1% resistors? They come in many additional standard values.

formatting link

Much easier to use the CMOS version and connect the timing resistor to the output, instead of having two resistors with the middle connected to the discharge pin.

But in any case, the square wave will not be a really accurate 50% square wave, with all tolerances (including the

555 threshold and trigger voltages) taken into account, especially with temperature change. If that is important to you, it is probably better to separate the frequency determining part from the square wave part and use the standard 555 (non square wave) oscillator to make twice the desired frequency at a very non 50% duty cycle) and follow it with a divide by 2, edge triggered flip flop, that will make a very precise 50% square wave at the desired frequency. There is also a little gotcha in this method, but there is no point going into it, here, unless you want to try going this way. It has to do with a known bug in the design of the 555.
--
Regards,

John Popelish
Reply to
John Popelish

--
Using that astable configuration it\'s impossible to get a 50% duty
cycle.
 Click to see the full signature
Reply to
John Fields

Only if you use the "standard" configuration - I did it once with a couple of diodes - "steering diodes" such that there was one R value for charge and a completely different value for discharge, independently selected.

But that symmetrical one that only works with a CMOS chip is much more elegant. :-)

Cheers! Rich

Reply to
Rich Grise

Well, come on, John - don't leave us hanging! Which bug is this?

Thanks, Rich

Reply to
Rich Grise

The 555 contains two comparators and a flip flop. When operating as an oscillator, the two comparators act as set and reset signals for the flip flop. The output and discharge functions are maintained after each of these events by the flip flop. That is the design concept.

Unfortunately, the internal implementation of this concept is flawed. The output in not controlled strictly by the state of the flip flop, but also, in parallel by the output of one of the comparators. When that comparator generates the signal to switch the flip flop state, it gets to the output before the actual flip flop reversal has taken place. So the output and discharge get bounced by the comparator, then a little while later (dependent on how hard the comparator is being over driven, or if the discharge reverses the comparator output very quickly) the output can head back to its original state and then, finally lock into the other state, after the flip flop finally gets flipped.

This output bounce often causes problems if it is used to drive an edge triggered function like another flip flop. It can produce two clocks in rapid succession. This problem can be moderated by adding a short time constant RC filter to the output, or, when driving CMOS flip flops, a series resistor will usually work (making use of the clock input's capacitance as part of the filter. I have also cured the effect by adding a short second time constant in the discharge path, so the comparator does not see an immediate voltage reversal when the discharge transistor comes on. The small delay makes time for the flip flop to lock in.

The problem could have been avoided in the design if the set and reset had to take irrevocable effect before the flip flop drove the discharge pin and output to a new state. But that would have also slowed the propagation time of the circuit. I have a home made an LTspice model of the internal circuit (Remember when IC data sheets showed the full schematic?) if anyone wants to look into how all this works in detail.

But the important thing is to expect the bad behavior and not waste a lot of time suspecting it is something you have done wrong when your downstream flip flop seems to not want to flip (when it is actually flipping twice for each supposed single clock edge).

--
Regards,

John Popelish
Reply to
John Popelish

for 50% that's the wrong circuit to use. drop r2 and wire r1 from pin 3 to pin 2 - that'll get you pretty close to 50%

use a variable resistor.

Bye. Jasen

Reply to
Jasen Betts

Many thanks to all who replied - the circuit with 120K/0.1uF works very well.

I want to feed this into an audio ring modulator circuit - (2 transformers, 4 Ge diodes) My carrier is coming in from a mic pre-amp

- which when I checked on my scope looked like a -10 to 10V signal. The output from the oscillator (currently running at 5v) is too small to be an effective modulator and really needs to be amplified and offset to match the range of the carrier.

I can do this if I have a differential power supply, but at the moment I just have a +12V supply - is there any way to do the shift down using just this?

(Did I explain that correctly - industry terminology has never been my strong point)

Dave

Reply to
Kasterborus

Kasterborus Inscribed thus:

Attenuate the output of the mic amp !

--
Best Reagrds:
                        Baron.
Reply to
Baron

But then wouldn't I end up with a low level signal on the output? My "power amp" (stripped PC speaker) wouldn't be able to amplify the signal to the level needed to drive the speaker.

Dave

Reply to
Kasterborus

But what's the end project? Unless you specifically want a modified signal on the output, you may not want a square wave. A sine-wave would do the same thing if your intent is merely to translate the audio input up to a higher frequency. Using a square wave will modify the signal, so you'll get more than a translation (in electronic music, the modification is what's wanted) For that matter, if this is a "scrambler", one article decades ago suggested using a radio for the second signal, making sure to use the same station at both scrambler and descrambler.

There is nothing magic about a ring modulator. You can get the same effect with other circuitry, anything that is a double balanced mixer will have the same effect. Using active components will get around the issue of needing a strong "carrier" signal, and get away from the need for audio transformers.

You can find double balanced mixers in all kinds of ICs. Sometimes they are even deceptive, since they are used as variable gain elements and using an audio signal instead of a varying DC level will make it a mixer.

Michael

Reply to
Michael Black

I wanted to make a Dalek voicebox. Modifying the signal is the desired effect.

I've seen a lot of circuite out there for voice modulators, but no-one really explains how they work. I was looking to build one from the ground up and grasp what was going on.

Dave

Reply to
Kasterborus

Hi Dave -

A couple of things...

First of all, what kind of accuracy are you going to need at 30Hz or 60Hz? Second of all, there are variations no only in initial value precision with resistors and capacitors (even "precision" components") that vary with temperature, etc, so it may not be possible to get the precision you need with a standard 555, even a CMOS version. You may want to consider using an oscillator at a higher frequency and dividing it down. Third thing... to get a square wave (even cycles of high and low), just use an oscillator at twice the frequency and divide it by two with a flip-flop (a toggle flip-flop).

Good luck.

Dave

Reply to
starfire

What you need is "4 quadrant multiplier". Ring modulators were used to perform this function in early synths because they were (back then) cheaper than the multiplier chips. They didn't typically use a transformer in synths, as far as I can tell. Transformers and diodes are still used at RF frequencies today, but for audio I suspect that there are better/cheaper multiplier chips.

The explanation for how it works is based upon the old high-school formula for the product of 2 sines. Considered as sine wave frequencies, what happens is that the output of the multiplier includes only frequencies that are the sum and difference of the original input frequencies, not those input frequencies themselves. When the input is a voice or anything else that contains multiple frequencies, you use the same formula but just consider the frequencies one at a time, times the modulator frequency.

The net result is that if the modulator frequency is (say) 60 Hz, and your voice contains frequencies of (say) 400, 500, and 600 Hz, the output will contain 400+/-60, 500+/-60, and 600+/-60 Hz.

Note that if you are only interested in this as an effect, you may be happy with a much simpler solution. A ring modulator can be regarded as multiplying the signal by a square wave, which has its own spectrum of odd harmonics. So each input frequency produces the sum and difference not only of the modulator fundamental, but with each harmonic as well. Using the example above, the modulator would have frequencies of 60, 180, 300, 420, etc. A 400 Hz input frequency would thus give 400+/-60, 400+/-180, 400+/-300, 400+/-420, etc. (Yep, that last gives -20 Hz, which reflects off of zero to make +20 Hz.)

Anyway, if you just want to multiply by a square wave (+/-1) you just need a circuit that can switch between inverting and non-inverting. This is much easier than diodes and transformers. The signal feeds both inputs of what looks like a standard differentiual amplifier. However, the resistor that normally goes between the op-amp + input and ground is replaced with an analog switch that you drive at the modulator rate. When the switch is closed, the overall circuit is a simple inverter. When it is open, the positive path has a gain of +2 and the inverter is of course -1, so you get an overall gain of +1.

SHAMELESS PLUG: You can use the FREE signal generator in my Daqarta software to mess around with this, and compare sine wave and square wave multiplication. You can not only hear the results, you can see the waveform, spectrum, or color spectrogram at the same time.

You record a test signal (your voice) and play it back as the generator output signal using the Waveform Controls - Wave - Play option. (But see below.) It will loop on the overall recording by default, with adjustable start and end points. You can use any existing WAV recording, or record your own with Daqarta's Input - DDisk option.

(Note that after Daqarta's 30-day/30-session trial period, you can no longer use it to make recordings, but most everything else continues to work forever, and you are welcome to use it that way as long as you like. You can always use WAV files recorded elsewhere.)

Make sure the main Freq control is set to 1.00, so your recording will be played at normal speed.

Now, go to Waveform Controls - AM and set the Depth to 200%, and set the AM modulator frequency to 60 or whatever you choose. That turns the AM modulator into a true 4-quadrant multiplier, so you can hear what an ideal multiplier would sound like.

The default AM modulator is a sine wave, but you can use any other wave instead, including a square wave, by selecting a different Mod Source. Daqarta can actually generate 4 separate "streams" per R/L output channel, which normally wold be summed together. But you can instead elect to use a stream as a modulator source for another stream, instead of sending it to the output. However, a stream can only modulate higher-numbered streams. So in this case you would need to have the original voice recording on Stream 1 or above, instead of the default Stream 0. Just click the [1] radio button at the top of the Waveform Controls dialog before you go to Wave - Play.

Now go back and set the stream to [0] and go to Wave - Square or whatever waveform you want. Then back to stream [1] and set the AM Source to 0 and you will hear/see the results of that square wave times the voice signal.

Let me know if you have any questions. Enjoy!

Best regards,

Bob Masta DAQARTA v4.00 Data AcQuisition And Real-Time Analysis

formatting link
Scope, Spectrum, Spectrogram, Sound Level Meter FREE Signal Generator Science with your sound card!

Reply to
Bob Masta

True ! But you would still need to provide some kind of gain control to get the effects you want. Either way its divide by two or multiply by two.

Are you driving the speaker directly ? no amp in there.

--
Best Regards:
                     Baron.
Reply to
Baron

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.