NE555 tone generator variable frequency

Started by jhob, May 28, 2023, 07:58:13 AM

Previous topic - Next topic

jhob

I've made an ne555 tone generator to use for testing pedal builds from a cheap.

I would like to modify it so that I can alter the frequency of the generator tone.

Here's the circuit:


From a bit of research I think if I change R1 to a 1M pot and R2 to 1k that would achieve what I want.

Is that right or have I got something wrong here?

ElectricDruid

No, that'll work.

Changing either or R1 or R2 (or both) will change the frequency. The cap charges up through both R1 and R2, but discharges through just R2. So if you have R2 fixed, and R1 variable, you get a fixed pulse width, but varying frequency and duty cycle. If you fix R1 to a small value and then have R2 larger, you can get a more consistent (but still somewhat-variable) duty cycle.

For your purposes, just generating some audio for testing, the duty cycle probably doesn't matter too much, so have a play with it and see what you like the sound of best.

duck_arse

wow. all that shaping of the square wave, you could just take the pin2/pin6 output and buffer it for a sawtooth-ish output.
don't make me draw another line.

jhob

Quote from: ElectricDruid on May 28, 2023, 09:51:39 AM
No, that'll work.

Changing either or R1 or R2 (or both) will change the frequency. The cap charges up through both R1 and R2, but discharges through just R2. So if you have R2 fixed, and R1 variable, you get a fixed pulse width, but varying frequency and duty cycle. If you fix R1 to a small value and then have R2 larger, you can get a more consistent (but still somewhat-variable) duty cycle.

For your purposes, just generating some audio for testing, the duty cycle probably doesn't matter too much, so have a play with it and see what you like the sound of best.

Thanks, that worked!

Replaced R1 with a 1M pot and inlined the 10k resistor with that as without it would cut out if the frequency got too high, presumably outside the spec for the chip or something like that.

Just need to box it up now and I'm done.  Got a cigar box kicking around I'm going to put it in.


jhob

All sorted and boxed up.





Lesson from this one is that if you dremel down the shaft on a pot it will overheat and destroy it - use a hacksaw instead!

Rob Strand

#5
In the OP's schematic pin 2 of the NE555 should connect to pin 6 not to +V.  This error is not present in the Elektor schematic below.

Quote from: duck_arse on May 28, 2023, 09:57:42 AM
wow. all that shaping of the square wave, you could just take the pin2/pin6 output and buffer it for a sawtooth-ish output.
I think the filter is intended to give a nicer sine output than just the exponential output across the cap.   The advantage of *starting* with the exponential output is the level is automatically set by the NE555 regardless of the frequency pot setting.

To me the circuit around C6 looks wrong.  I think there should be another 10k resistor between C4 and C6. Another options could also pull C6; which now seems more likely - see below.

The problem with making the frequency variable is the level of the sine output (and triangle and exponential outputs for that matter) will decrease with frequency.


QuoteReplaced R1 with a 1M pot and inlined the 10k resistor with that as without it would cut out if the frequency got too high, presumably outside the spec for the chip or something like that.
You would do better making R2 variable so the output remains more or less square when you adjust the frequency.   Making R1 variable means the shape of the waveform changes when the frequency is adjusted:  the output high time varies and the output low time is fixed.

For R1 variable, putting 10k in series with the pot is necessary to ensure the oscillator can oscillate.   For R2 variable you don't need the 10k but it is very desirable because without it the frequency will increase rapidly at the end in an impractical manner - 10k to 50k is a good choice.



Looks like the original Elektor circuit has the sine filter error as well:
(Need a resistor between C7 and C4, could also just pull C4.
But oddly enough the kit PCB seems to have C4 loaded, like the schematic.)

https://worldradiohistory.com/hd2/IDX-UK/Technology/Technology-Modern/Archive-Elektor-IDX/IDX/00s/Elektor-2000-12-OCR-Page-0097.pdf



Seems like there's a few problems with that circuit.  Some tentative fixes.
The idea was to work out what the circuit was based on the sine output level in the Elektor (Dec 2000) article.



I'm seeing about 0.7V p-p on the square output, 2.5V p-p on the exponential output, 0.7Vp-p on the triangle output.

With the square output the buffer is being totally cut-off on the negative swing because the 1k on the divider is killing the bias on the output buffer.   The same thing isn't allowed to happen on the exponential and triangle waveforms as that would chop off the negative tips of the waveform.  Luckily as you progress down the 10ks it finds a new bias point which keeps the output buffer biased enough not to clip.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

amptramp

Another take on the 555 oscillator / waveform generator is the Fairchild µA2240 which is a 555 oscillator connected to an 8-bit divider.  I used 12 of these to update the oscillator bank of an organ.

https://www.datasheetarchive.com/pdf/download.php?id=ee46f8ad7a1d5df26b06f97b96ed5be51c30e6&type=M&term=uA2240

You can combine outputs to get various waveforms because the outputs are open-collector.

jhob

#7
Quote from: Rob Strand on May 31, 2023, 08:23:05 PM
In the OP's schematic pin 2 of the NE555 should connect to pin 6 not to +V.  This error is not present in the Elektor schematic below.

It was based on a kit I got off ebay and modified a bit.

All seems to work well enough anyway for my purposes.

A lot of what you said there went over my head but I will re-read it and try to make a bit more sense in my head what's going on in the circuit - that's the next step I need to make in my electronics journey.

Thanks

Rob Strand

#8
Quote
Quote from: Rob Strand on May 31, 2023, 08:23:05 PM
In the OP's schematic pin 2 of the NE555 should connect to pin 6 not to +V.  This error is not present in the Elektor schematic below.

It was based on a kit I got off ebay and modified a bit.

All seems to work well enough anyway for my purposes.

A lot of what you said there went over my head but I will re-read it and try to make a bit more sense in my head what's going on in the circuit - that's the next step I need to make in my electronics journey.

Thanks
Let's start with what you have:  I had a look at the Ebay kit and going over the PCB pics it looks like their schematic follows the original Elektor article but the resistor values in the PCB pics for R9 and R10 look like 10k (not 100k).  Also, The Ebay kit schematic has an error, it shows pin 2 of the NE555 going to +V when in should go to pin 6.  I checked the PCB and it correctly wires pin 2 to pin 6.   

The 10k resistors for R9 and R10 look good to me.   Those values make more sense than the 2x100ks.

You might want to check you have 10k's in positions R9 and R10.

So here's what I think you have (before your mods).




Mods:

What I'm suggesting is you should make R2 variable not R1.   If you make R1 variable the square wave becomes non-square when you change the frequency away from 1kHz.

If you already have a 1M pot then leave R1 as the original 1k.  Then make R2 the 1M pot in series with 10k (say).   That a 100:1 range in frequency.  It's a bit much for a pot as the high frequency end of the pot will be cramped up.  For now let's leave it at that with 100:1.

What you haven't said is what frequency range you expect.  The original circuit was fixed 1kHz with the 15k in there.   If you use a 1M pot + 10k resistor for R2 the low frequency limit will be about 15Hz and the upper frequency will be 1.5kHz.    You might want to consider making it 50Hz to 5khz, or, 100Hz to 10kHz.   To do that change the cap C2 to 15nF or 6.8nF. [Values assume R2 variable case.]

That's all well and good.   That circuit is very simple.  It uses fixed filtering to filter the 1kHz waveform.   When you make the NE555 frequency variable  the fixed filtering does not adjust itself to suit the different frequency.   There's no easy way to fix this.   When you set the frequency to maximum the filter frequencies are technically too low.  What you will see is the output level reduces and the waveforms change shape: the exponential and triangle waveforms become more sinusoidal.   When you set the frequency to minimum the filter frequencies are technically too high.  What you will see is the opposite, more output and the shape of the waveforms change:  now the exponential output becomes more square, the triangle becomes exponential, the sine will probably be an exponential.   The square wave is the only output that will remain normal, and the output level will stay more or less fixed.

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

GibsonGM

Quite ambitious, nice work!    If you want to Dremel a pot shaft (or other object you're worried about heat with), you can use a heat sink to dissipate that heat as you cut.   Helps if you work quick or don't do too much at one time, too.   
   
Sometimes I GENTLY clamp a pot shaft in my steel shop vice so that it hangs below the jaws.  When I Dremel the piece off, the heat is transferred to the vice rather than down into the pot's wafer.  Vice grips set to NOT dig in, or an actual heat sink clamp work well also.
  • SUPPORTER
MXR Dist +, TS9/808, Easyvibe, Big Muff Pi, Blues Breaker, Guv'nor.  MOSFace, MOS Boost,  BJT boosts - LPB-2, buffers, Phuncgnosis, FF, Orange Sunshine & others, Bazz Fuss, Tonemender, Little Gem, Orange Squeezer, Ruby Tuby, filters, octaves, trems...

jhob

Quote from: GibsonGM on June 02, 2023, 05:58:15 AM
Quite ambitious, nice work!    If you want to Dremel a pot shaft (or other object you're worried about heat with), you can use a heat sink to dissipate that heat as you cut.   Helps if you work quick or don't do too much at one time, too.   
   
Sometimes I GENTLY clamp a pot shaft in my steel shop vice so that it hangs below the jaws.  When I Dremel the piece off, the heat is transferred to the vice rather than down into the pot's wafer.  Vice grips set to NOT dig in, or an actual heat sink clamp work well also.

Irony was that the hacksaw on the second pot was a lot faster!

thanks for the tips

GibsonGM

Whatever gets it done, really :)  I use a hacksaw a lot, too. Still use a vice, but a wooden 'craftsman workmate' type rather than steel.
  • SUPPORTER
MXR Dist +, TS9/808, Easyvibe, Big Muff Pi, Blues Breaker, Guv'nor.  MOSFace, MOS Boost,  BJT boosts - LPB-2, buffers, Phuncgnosis, FF, Orange Sunshine & others, Bazz Fuss, Tonemender, Little Gem, Orange Squeezer, Ruby Tuby, filters, octaves, trems...

jhob

Quote from: GibsonGM on June 02, 2023, 09:53:13 AM
Whatever gets it done, really :)  I use a hacksaw a lot, too. Still use a vice, but a wooden 'craftsman workmate' type rather than steel.

I've got a workmate and a 'Mr Strong' bench vice, which is a really neat design!


GibsonGM

That's some serious clamping, man!  I just use the old fashioned workmate for softer things, and a big ol' chainsaw-sharpening vise for the big stuff!!
  • SUPPORTER
MXR Dist +, TS9/808, Easyvibe, Big Muff Pi, Blues Breaker, Guv'nor.  MOSFace, MOS Boost,  BJT boosts - LPB-2, buffers, Phuncgnosis, FF, Orange Sunshine & others, Bazz Fuss, Tonemender, Little Gem, Orange Squeezer, Ruby Tuby, filters, octaves, trems...

jhob

Quote from: GibsonGM on June 02, 2023, 10:23:48 AM
That's some serious clamping, man!  I just use the old fashioned workmate for softer things, and a big ol' chainsaw-sharpening vise for the big stuff!!

I actually didn't realise it could do half the stuff shown in that video until I watched it just now!

Ben N

Language note:

US folks: Vices are fun, but not much good for holding anything. For that, you'll need a vise.

UK peeps: Carry on.

Others: 🤷‍♀️
  • SUPPORTER