555 Square eave Generator design question regarding frequency - Page 1
Forum section: electronics / projects

author: Kain89
author_rank: Newbie
timestamp: August 07, 2023, 06:32:41 pm
content: Hello everyone,I'm currently working on a square wave generator for driving transformers (mainly for HV experiments and finding the best frequency to run them on), I've got the basic circuit working in simulator and on a breadboard (without the High current section attached) but Am having an issue with the timing aspect of the circuit, currently I can adjust the frequency and the duty cycle independently but what I am trying to achieve is for each capacitor for different ranges I want to limit the minimum and the max frequency of that capacitor as best as possible (I'm trying to make it so that I have say 1u - 0 - 1000hz, 10n - 1000hz - 10khz, 100p - 10khz - 200khz, 10p 200khz - 400khz Note: I know these values may not work with the current capacitances, just an example of the sort of precision I'm looking for). I've attached the schematic (providing links to the sources that inspired me, it's a sort of hybrid between the two).What I have tried is moving the 10k resistor before the capacitor switch to after (a resistor for each capacitor to try fine tune the frequency at least at one end) but this does not help but adjusting this value as it is does seem to limit the range but not as precisely as I would like, my thought on this is due to pin 2/6 needing to be connected before the capacitors without the additional resistor.If anyone have any idea's on how I might achieve this and would like the explain would be greatly appreciated.

author: Kain89
author_rank: Newbie
timestamp: August 07, 2023, 09:21:46 pm
content: Having read the inverting 555 timer tutorial linked to the ignition coil link, I have an idea of that is wrong, it says that the 4.7k resistor to ground scales the output frequency and the resistor before the capacitor controls the reset pulse width for low duty cycles. Having read this I noticed I did not consider the effect of the potentiometer at pin3 to both these resistors of what pin3 will see and how this will affect the output frequency. I will look into this tomorrow but looks hopefull to getting closer to the results I am after.

author: Kim Christensen
author_rank: Super Contributor
timestamp: August 07, 2023, 09:47:11 pm
content: Your circuit is bizarre. Why not build thestandard astable 555 circuitand drive a transistor/FET from pin 3 instead?You could also do something like this with a dual OpAmp:If you want a 20:1 range per switch setting then the POT must be 20x the minimum resistance. ie: 100K POT with 4.7K series limit resistor and .015uF would adjust from apx 460Hz - 10Khz; 0.15uF 46Hz - 1Khz, etc. It's never going to be precise without some extra rotary switch contacts and trimmer pots for every range. Just design it with some overlap and don't worry about precision. Otherwise, buy a function generator.Or if you still want to use your 555 circuit (With adjustments to RC values):

author: Terry Bites
author_rank: Super Contributor
timestamp: August 08, 2023, 07:53:23 am
content: To avoid trimming all the caps, why not use a divider. eg CD4518.Use the 555 for the clock. Or go for a single chip solution eg CD4060.

author: Kain89
author_rank: Newbie
timestamp: August 08, 2023, 05:01:48 pm
content: Quote from: Kim Christensen on August 07, 2023, 09:47:11 pmThanks for the reply, The main reason for not going with the standard astable circuit was stability with the duty cycle and frequency when changing them independently. that's where I came across the links in the schematic, tried them and was happy with the results, but still need to do some tidying with the circuit. you gave an example of the range, could you provide the equation you used for that? I tried plugging the values into the equations 1.44 / C x (R1 + 2R2) but not getting the same results. With regards using Op-amps or comparators instead of the 555, I've read that they are not good for frequencies surpassing 150khz but I will look further into this as new methods always interest me.Quote from: Terry Bites on August 08, 2023, 07:53:23 amThanks for the suggestion I have never used either so will need to look that stuff up, the CD4060 looks good from it's frequency range but never used such IC's before so a bit daunting. I think I would still run into the same problem mind of select frequency ranges but without knowing the IC's properly i can't say for sure.

author: Kim Christensen
author_rank: Super Contributor
timestamp: August 08, 2023, 05:40:34 pm
content: Quote from: Kain89 on August 08, 2023, 05:01:48 pmSince you are using pin 3 for your feedback path (instead of pin 7 + R1 as pullup), I just ignored (made zero) "R1" since it doesn't exist in your circuit as far as the "the standard astable 555 circuit" is concerned. So when the pot is fully CCW the total resistance would be 104.7K, (C = 0.015uF)... When fully CW, the total resistance would be 4.7K giving a range of 4.7K to 104.7K for R2.Yea, you'll need a high speed OpAmp (You could also use a comparator) for that circuit. Beware that some comparators need a pullup resistor and some others do not.

author: Kain89
author_rank: Newbie
timestamp: August 08, 2023, 09:38:13 pm
content: Thanks for clearing that up, I also made the mistake of not converting the units properly when putting in the capacitance into the equation so now getting the values you presented. having done some calculating it's a shame to find I can't get a nicer range of increments of 100khz with only a pot (would need a 72M Pot that don't exist, gonna have a look at the CD4518 divider ic and see if that might serve justice here or I'll have an over a dozen capacitors just to get the range i want but in smaller increments. Thank you both for your help, input and suggestions.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 08, 2023, 10:29:10 pm
content: Quote from: Kain89 on August 08, 2023, 09:38:13 pmA tapped counter will give you a wide dynamic range, but it does not give you variable duty cycle across those ranges.For a wide dynamic rangeandVariable Freq and Duty, you either need a MCU, or a sawtooth/triangle and slicer circuit.It's hard to avoid switching in CAPS in that case.If you want to use a calibrated kHz knob/scale, and decade ranges you will need a higher precision approach, like function generators used.Otherwise, just connect a frequency counter, and ignore the range (mis) alignments.There are still XR2206 modules out there (addit: and MAX038 modules ) that use knobs as adjustment.Some designs change the slopes of the triangle wave to set duty, which is useful for 5~95% range.If you want to go to extremes of duty, then a slicer on the triangle wave will let you cover 0~100%Addit 2: Aliexpress also have many PWM modules based on N76E003 (etc) MCUs which spec 150kHz PWM (basically that MCU's Sysclk / 100 for 1% PWM steps)

author: Kim Christensen
author_rank: Super Contributor
timestamp: August 08, 2023, 10:35:07 pm
content: The problem with having such a wide range on a single POT is that it becomes very hard to adjust at the lower end. Better to have multiple ranges like you originally planned.The key with the ranges is to design it so each one is a "copy" of the next with an overlap between each range. Only 4 capacitors needed:100-1100Hz1Khz- 11Khz10Khz- 110Khz100Khz- 1.1Mhz(Notice that the upper frequency is always 10x the lower one for each range)The problem I see with using a divider IC like a CD4518 is achieving PWM duty cycle on the divided frequency. Any PWM from the source oscillator will be eliminated by the divider IC.