This project will describe how to make an AWG that can produce decent sine waves up to about 2Mhz, and of course all kinds of other waveforms, for around 20$ (assuming you own an stk500 or equivalent programmer).
This project assumes the builder is familiar with assembly language, atmel microcontrollers and their programmers, oscilloscope use, and basic electronics. All novel ideas and schematics are released under the GPL, all non-schematic images are released under a Creative Commons license.
Parts:
2x 10 pF capacitors
1x crystal, preferably 16Mhz, I used 14Mhz
1x 5v voltage regulator
2x 9v battery
7x 50kohm resistors, 1%
10x 100kohm resistors, 1%
2x 4.7kohm resistors
1x 100kohm potentiometer
1x 10kohm potentiometer
1x OPA2132 op-amp, or any op-amp you're familiar with
2x 220uF electrolytic capacitors, rated 18v or higher
Finally, you will need the datasheets for the atmega16-16pu, and your opamp of choice. In the amplifier circuit, I labeled the pins by function and not by number, the datasheet will show you which pins are which (I used the same naming scheme as the datasheet).
The original html version of this project is available at http://legionlabs.nullnode.com/
The photo demonstrates a 1Mhz sine wave generated by the device.
Remove these ads by
Signing UpStep 1First circuit.
VERY IMPORTANT: Unless you want to include switches that change the waveform type/frequency... I didn't because it involves a performance tradeoff... you will be reprogramming this microcontroller frequently. Either be fancy and include ISP, or do what I did: solder an IC socket to the circuit board, and also lodge the microcontroller into another IC socket... the electrical contact between the two IC sockets is just fine, and an IC removal tool lets you pull it out with minimum force.
Alternatively, spend an extra few dollars and get a ZIF socket. If I were to redo this project, this is what I would do.
When this stage is complete, you have a functioning waveform generator... which you should proceed to test with your scope (test the bias!). A later step will include a link to a useful site that has assembly code compatible with this microcontroller that will generate various waveforms.
Next, we will ad an amplifier stage to increase the signal voltage to useful levels.
| « Previous Step | Download PDFView All Steps | Next Step » |









































PWM also normally gives you a square wave, but you could filter it.
You could also do all of this with opamps, which would be a lot of un!
It will only work well for microwave frequencies (hundreds to thousands of Mhz).
For 1Mhz, nice antennas tend to be large-ish. Antenna designs have dimensions based on how far a photon can travel in once cycle, so when you use lower frequencies, even a 1/2 dipole can be an inconvenient size. It may be possible to make a decent antenna anyway, however my limited knowledge of antenna design is not sufficient to help you out.
I apologise profusely.
This is a neat demonstration of just how much you can do with simple microcontrollers. My only reservation is that fine control of the frequency appears to be impossible- can you replace the crystal with an adjustable frequency clock? Also, I'm not quite sure I understand how your circuit is generating the signal voltages- does it provide analog outputs or is the ladder of resistors on the first circuit diagram used as a potential divider somehow?
But as pointed out, with two batteries you've got a bipolar supply with the ground being the connection between the two batteries (wired in series.)
You knew that already, of course....
Did I miss the Atmega source code, or is that on an outside link?
Thanks, I'll check out the source when you post it...