Homemade Function generator

Status
Not open for further replies.

billybob

Active Member
I'm building a function generator with an arduino and was wondering a simple question, can a p channel mosfet allow the sine wave and triangle wave outputs to be amplified? Or would it work more like a bjt and convert the all wave forms to a rough square wave? How do mosfets differ from bjts? I have a basic idea, but not sure its hard consulting the internet with this so I'm going to you guys.
 
First,

what is your expectation of frequency range of the tone generator you want to build?

which Arduino or Arduino-like board do you plan to use?

what voltage range output for these generated signals?

What is the highest current draw you need to support from the signal generator's output?
 
frequency - Im thinking 1 to 10k. As for the board it doesnt really matter, but I have two arduino unos. 12 to 30 volts out put to the mosfet 3 volts output from arduino.
 
If you want to create a signal with a 0-5v Arduino output and convert that to a signal generator output, the easiest thing you can do is grab an old stereo receiver (amplifier) and connect the Arduino to a right channel line-in terminal with a 0.1uF capacitor. And connect ground of the Arduino to ground ring of the line-in. You should look for a 35W receiver to get 32v peak to peak output (if I remember correctly).
Otherwise, a single transistor circuit (class A) won't really do what you want and it will be a hot mess to deal with. Look for a class AB amplifier design and a 35 to 50v center tapped transformer.
 
Or would it work more like a bjt and convert the all wave forms to a rough square wave?
Whether you get the same waveform or a squared waveform out depends on the biassing and signal levels you use.

If you make it switch hard on & totally off, you get a squared / clipped signal.
If you bias it so it's never fully on or fully off (eg. Class A, but not at high currents) you should get a similar output to what you feed in, just inverted.

That will be the same with either a bipolar or FET device, just with the appropriate bias for each.

For a simple example, use an emitter or source resistor, plus base or gate bias so that has eg. 5 or 10% supply voltage across it (thinking of the transistor as an emitter follower or source follower, at that point).
That part can be thought of as a voltage controlled current sink - the bias (or signal added to the bias) changes the emitter/source voltage, and that voltage across the resistor defines a current, by Ohms Law.


Then use a load resistor from power to the collector or drain, eg. five times the first resistor.
With that set current passing through it, it should always have five times the voltage across it, including any variations.

You have a reasonably linear 5x gain amplifier.

It can be a lot higher gain, but the biassing becomes more critical using the same basic circuit.

The way around that is to use another emitter/source resistor in series with a reasonably large capacitor, across the original one. That has no effect on the DC or low frequency gain, but at higher frequencies the two resistors are effectively in parallel so you get higher AC gain, at eg. audio frequencies.
Or it can just be a capacitor directly across the resistor, but it's easier to get distortion.

>google<
This shows two stages very similar to my description one after the other (so gain 1 * gain 2), hopefully it will help make sense:
(If you want to try something like that, make the base bias resistors at least 10x larger (eg. 47K & 10K or 220K & 47K) and the coupling capacitors bigger as well; it would have very poor low frequency response as shown. And add a decent size capacitor across power and ground).



ps. The load applied by whatever an amplifier stage such as these feeds should be a lot! higher input resistance, compared to the collector or drain load value. 4K7 load on the first stage above, feeding the low value bias resistors on the second stage, is not good and I'd expect distortion and low gain, as shown.
And, the bias resistor values should be adjusted to set the collector/drain voltage somewhere roughly half way between the emitter/source voltage and power.
 
Last edited:
How do mosfets differ from bjts?
They can perform the same functions, but BJT's are typically viewed as controlled by the current into the base-emitter junction (the junction looks like a low-impedance forward-biased diode), whereas a MOSFET is controlled by a voltage between the the gate and source (which looks like a high impedance small capacitor).

(Technically the BJT model equations show that it's a voltage -controlled device, but that's only of design interest when designing small-signal AC amplifiers).
 
WOOOOW! That is brilliant! Why didn't I think of that? Very cool thank you.
 
That is a lot of great info. thank you. My world is slightly shaken, I thought transistors were more digital, (when there is input above the required threshold BOOM! emitter and collector allow current to flow.) From what I gathered output current is directly proportional to the input at the base (correct me if I'm wrong) and mosfets are triggered by the amount of voltage where as bjts are mainly current activated. I'm new to this and it is all very fascinating to me and appreciate helping me understand these components.
 
From what I gathered output current is directly proportional to the input at the base (correct me if I'm wrong) and mosfets are triggered by the amount of voltage where as bjts are mainly current activated.

Exactly!
 
As amplifiers, they are not triggered. They are controlled. Or is it "driven"?
 
I don't think it is worth making one when you can get a ready built one such as this.
It works from a single 12 volt DC supply and gives a maximum output of 20 volts peak to peak.
I bought one recently when they were on offer at an even lower price.

Les.
 
Yeah I might end up doing that, but the process of making one would be quite rewarding if it works. Also does that only ship to united kingdom or am i reading that wrong?
 
Yeah I might end up doing that, but the process of making one would be quite rewarding if it works. Also does that only ship to united kingdom or am i reading that wrong?

The Chinese suppilers ship all over the world, look on Banggood or AliExpress for numerous such kits - which you can then build.
 
I think they will ship to the US which is where your profile shows your location. I think I have seen it available in kit form but are you confident enough to work with surface mount components.
I think this link takes you to the original design https://www.radiolocman.com/shem/schematics.html?di=69926
This will probably give enough information to build it with through hole components. It will probably cost more for the parts than buying the kit.

Les.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…