Maker Pro
Maker Pro

Function Generator

Number

Jun 9, 2013
65
Joined
Jun 9, 2013
Messages
65
This weekend I am trying to build a function generator that can have a selective range (frequencies are not specific, I just want to have range) between the frequency & the duty cycle. My reference manual for the NE555 timer in astable mode showed how to wire it up accordingly, and I used a 555 calculator to get a range of values for R1, R2 & the capacitor.

My thinking is this, and as such is the basis behind this whole thread, is that can I substitute R1 & R2 of fixed values, to two potentiometers? I believe this will alter the duty cycle, so to have control over frequency I want to instead use a variable/tuning capacitor. This way I have control over the entire circuit and can adjust it on the fly, without having to substitute any components.

I would like to know if this is feasible and will work. A mock up was made using my iCircuit app (which I love!) and I could only get a max of 128Hz, which is well below where I would like to get. My hope is to get a max of a couple hundred KHz or maybe 50KHz max, I'm not greedy in my selection so long as it's in the Kilohertz range I'm quite content.

My logic says this will work, as all I am doing is swapping fixed values for values that can be controlled & vary according to my projects needs and what not. However I am not familiar with potentiometers (as far as what or how high of values I should use, and I do not know how to wire up the variable capacitor, which is another thread of mine & can be viewed Here.

If a schematic is needed I will gladly post, but it is the same as the datasheet, it's just swapping fixed values for changing values. :)
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
yes, you can make the resistances variable, however you need to consider that there are certain minimum resistances you can have. Making them both zero ohms is a big no-no, for example.

One option is to place a fixed resistor in series with the variable resistor so that the minimum resistance is enforced.

However this is not the easiest way of controlling a 555. It will result in the range of duty cycle available changing as you change frequency.
 

Number

Jun 9, 2013
65
Joined
Jun 9, 2013
Messages
65
yes, you can make the resistances variable, however you need to consider that there are certain minimum resistances you can have. Making them both zero ohms is a big no-no, for example.

One option is to place a fixed resistor in series with the variable resistor so that the minimum resistance is enforced.

However this is not the easiest way of controlling a 555. It will result in the range of duty cycle available changing as you change frequency.

Thank you for the input about not having them at both equal to zero, as I did this last night using two pots & an LED; however it was not connected to anything other than some DC Voltage from a lantern battery. I'll remember this for future use!

What would you recommend for an easier way of accomplishing this? I have seen a lot of kits that have schematics, most using a microcontroller or some other IC that I don't have. My first thing that I to turn to was the 555. But if there's (and I'm sure there is) a better way of getting the frequency generation that I'm looking for, please do share!

I'm also going to explore different ways to get variable capacitance.:D
 

will.moraes

Jun 11, 2013
1
Joined
Jun 11, 2013
Messages
1
Hi
I believe we will have a better "yield," using lm566, obtaining the desired frequency so variable and can choose two types of wave, square wave and a triangular wave.
simple-function-generator-by-lm566.jpg
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
I think the issue with the 566 circuit is that the duty cycle is fixed.

Here is another option:

5964832448_f0ecb172a6-1.jpg


(from here)

It also has a number of problems, and I'd make some changes.

1) R1 should go between pin 3 and the left diode
2) R2 should go between pin 3 and the right diode
3) a resistor of approximately 120 ohms should go between C and the two diodes.

This will allow R1 and R2 to control the mark and space times respectively. Using log pots will probably assist you as you want the resistance to change more slowly at low values (you'll have to experiment to connect them up the right way)

This circuit will not allow you to set the frequency and then alter the duty cycle, you set the on and off times and the frequency is determined by that.
 

Number

Jun 9, 2013
65
Joined
Jun 9, 2013
Messages
65
Wow. Thanks a bunch for the schematics! That's a bit more than I was expecting to get, so I appreciate it!

I don't need to have super tight control over the duty cycle, I'm more interested in the frequency range. What would happen if you substituted R1 & R2 for very large or very small capacitors? I would elect to try this out on my own, but I don't want to fry anything or ruin anything, if I can just could just have some patience and ask!

My thinking is that would allow very fast or very low discharges, affecting the frequencies of the generator. I would also think that if you substituted the 10nF capacitor for resistors it would give you a fixed max or min frequency? Just some thoughts and questions I thought would be interesting before I try it out on my own,

Again, thanks for the schematics, I will try to build that on Wednesday and try them both out. =]
 

Number

Jun 9, 2013
65
Joined
Jun 9, 2013
Messages
65
I went and bought a 556 time. Actually two. I'm wondering if using two 556, essentially four 555 timers, can give me some added benefit. I would like to think that more is better, but my experience is rathered limited in regards to the 555.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
The LM566 circuit in post #4 is interesting. I had never heard of the LM566. (Not to be confused with the LM556, which is a dual LM555). Apparently it's a voltage-controlled oscillator, but neither Digikey nor Mouser lists it, so I imagine it was discontinued a while back.

I don't think you'll be able to use multiple 555s, or 556es, to create a better design.

I would go with Steve's suggestion - a 555 with two separate timing resistances, one for the ON time and one for the OFF time. There are other options apart from the 555, which is an old design (though good for a lot of applications).

If you stick with the 555, for operation at 50 kHz I would suggest one of the more modern replacements, such as the TLC555 or the ICM7555. IC process technologies have come a long way since 1972, when the original 555 was released. Not just its technology, but even its designer has now expired (http://www.eetimes.com/electronics-news/4394166/Hans-Camenzind-dies).

The 555 "architecture" is so ubiquitous that Digikey has a category for them! Go to http://www.digikey.com/product-sear...g-programmable-timers-and-oscillators/2556130 and look in the "Type" field.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
An updated circuit as per my suggestion the other day (and I concur with Kris)

attachment.php
 

Attachments

  • 555-2.jpg
    555-2.jpg
    13.8 KB · Views: 2,067

Number

Jun 9, 2013
65
Joined
Jun 9, 2013
Messages
65
Does the voltage supply have to be 12V or can it range so long as it's within the parameters of the 555? I could put two of my 6V Lantern Batteries in series to get 12V?

Also what sort of frequencies could this produce? My frequency counter is old & dying it appears, so until I get a new one, I'm just guessing. =P What purpose does the diode on R1 & R2 serve? I know you'd want them for inductive loads to prevent spiking, but I have not seen them configured in such a way as your schematic does.

Thanks again everyone, I greatly appreciate and can definitely say that I've learned a few things, so thank you. =]
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
You can use any supply voltage within the 555's specifications. Some of the newer 555 variants have different supply voltage limits so check the data sheet if you use one. The circuit will work better at 12V because the output stage does not swing fully to the rails; there is a roughly fixed voltage drop from +V to the output when it's high, and from the output to 0V when it's low. The higher the supply voltage, the less effect these voltage drops will have. These voltage drops, and the presence of the diodes, will also mean that the frequency will vary somewhat with the supply voltage. This dependence can be avoided by using two MOSFETs instead of the diodes; let me know if you want to see a schematic of this.

Edit: Actually, Steve is right. The circuit won't work very well at lower voltages, because of the accumulated voltage drops in the output stage and in the diodes. I'd say 6V would be the minimum workable voltage; this would depend slightly on which manufacturer and which type of 555 you use. It's definitely better to use 12V.

The frequency range can be changed by changing the value of C. With the circuit in post #9, the high and low times for the output signal are set independently of each other. Assuming R3 is fairly small, the amount of time that the output spends in its high state is roughly 0.7 * R1 * C, and the time spent in the low state is roughly 0.7 * R2 * C. (In these calculations, R1 and R2 refer to the actual resistance of those potentiometers at their current position, and are in ohms; C is measured in farads.) If you add those two time periods together, you get the total cycle time; if you take the reciprocal of that, you get the frequency.

To understand the diodes, you need to understand how the 555 astable circuit works. When pins 2 and 6 are connected together and connected to a capacitor to ground, and feedback is applied to the capacitor from the output on pin 3 (or the discharge pin, pin 7, but that's another story), the device oscillates. The voltage on the capacitor swings between two fixed thresholds: 2/3 of the supply voltage, and 1/3 of the supply voltage. These thresholds are fixed inside the 555. (They can be adjusted via pin 5, but that's another story.)

When it's connected like that, the 555 operates as a Schmitt trigger (Wikipedia it). Its behaviour is defined as:
1. When pins 2/6 are above 2/3 of VCC, the output is forced low.
2. When pins 2/6 are below 1/3 of VCC, the output is forced high.
3. When pins 2/6 are between those thresholds, the output retains its current state.

So on startup, condition 2 is true, and the output goes high. The capacitor charges up through R1, the diode, and R3 until it reaches 2/3 of VCC, at which time condition 1 becomes true, and the output goes low. The capacitor then discharges through R2, the other diode, and R3 until its voltage goes below 1/3 of VCC, and the cycle repeats indefinitely.

The diodes are needed to provide separate charge and discharge paths for the capacitor, so that the high and low times can be set independently.

There are many tutorials on the web that explain the 555's general operation. Probably the best explanations are those written by the various companies that manufacture 555s and similar devices: National Semiconductor (LM555) (now part of Texas Instruments), Fairchild (LM555), ON Semiconductor (they call theirs the MC1455 for some stupid reason), Signetis (NE555) and others.
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
The two diodes are there so that charging and discharging go through separate routes (R1 and R2). This allows the charge time and discharge time to be set independently, and thus the mark-space ratio

The circuit will probably operate from about 6V to 15V (although it would be getting marginal below 9V). Two 6V batteries in series would be fine.
 

Number

Jun 9, 2013
65
Joined
Jun 9, 2013
Messages
65
Outstanding information! Very much, thank you. I'm going to try this out and see what I can get. I'll post some results hopefully tomorrow at some time.
 

CluQu

May 22, 2013
14
Joined
May 22, 2013
Messages
14
I did this and took a view on the scope. It took some time building it as my schematic reading ability is a little new. For the record this is my (Number) alt account. Unfortunately my iPad does not have a character for my password. So I cannot sign in via the iPad.

The frequency was a little off but I think that is the frequency counter, not the 555 circuitry. The duty cycle, however, is way off from where the 555 calculator said it would be. It appeared to be about 95% on. Not sure how that would be but regardless I was still thrilled that it worked. :D

Edit:
Is it necessary to use the diodes? The way I'm trying trying to lay this out on the breadboard, is very confusing.
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Which circuit did you build?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
For my circuit the duty cycle should have varied as you manipulated the pots. One would control mark, the other space.

What were you seeing as you adjusted them?

Don't worry about pin 7. Pin 3 is doing the dirty work.

edit: and what values were the 2 pots (R1 and R2), R3, and C as shown on that schematic?
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Has 'Number' changed his username, or has CluQu hijacked this thread without mentioning that he has just joined it?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
"Number" can't enter his password on his iPad and has logged in as another user (Number2 might have been better :D)

See post #14 above.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Ah, I wondered what that was all about.

He probably chose not to use Number2 for obvious reasons... The toilet scene from one of the Austin Powers movies come to mind... "Number Two, who is your boss?" etc :)
 
Top