Close
0%
0%

Inexpensive function generator

An open source inexpensive function generator

Similar projects worth following
The device is an open source, inexpensive, Direct Digital Synthesis functiongenerator. The device is aimed to be used as a stand alone device, or as amodule in a larger circuit. The primary aim of the device is to offer reasonableperformance at a very low cost, allowing it to be a tool for anyone doingelectronics related things.Specifications:• Single 12 V DC supply required• 10 MHz output (limited at 20MHz)• Sine, triangle and square waveforms available• 10 V p-p amplitude• +/- 5 V DC offset• 50 Ohm output• Logic level square wave output• External control via serial port• External control of voltage parametersTindie kit:https://www.tindie.com/products/untemed/10-mhz-function-generator-diy-kit/

Motivation
For a long time I've been looking for a inexpensive function generator that can perform well in the MHz range. I tried getting various modules from ebay but all of them ended up with disappointment due to lacking performance.
So the only thing left to do is to design one from scratch with the specs I wanted and with the price that is on par with what can be bought from China.
The goal of the project is to make a open source function generator with features that would make it a actually useful device for hackers and makers with a price so that that anyone can afford to buy/make one. The device is meant to be very versatile, so it can be used in various applications as well as a module in a larger system (hack friendly).

Project purpose
There are a lot of function generator kits available online, but all of them some sort of problem.
Usually they are low bandwidth or just too expensive for what a beginner maker might be able to afford.
Having something that with a 20$ BOM or less makes it within reach for even the beginner makers giving them a tool that they will be able to use for quite a while.
Being open source also means that the the firmware can be modified and since all of the useful internal signals are exposed it can be used as a module without the screen and potentiometers making it hacker friendly. Another benefit is that anyone could build it from scratch and improve it contributing to the project as any other open source project.


Parts used
- AT89C51, it is good enough for the job, and also very cheap reducing the BOM
- AD9834 DDS IC, reasonably cheap and offers most of the functionality required
- AD811 opamp, also very cheap on ebay with enough bandwidth for the output amplifier, tho I will try to replace it with the AD8021 so I can reduce the dependency from sourcing parts from Chinese suppliers
- MC34063 to generate the -12V rail
- LM324 to handle the amplitude and DC offset controls
- 74HC4053 to generate the square wave signals
- 1602 LCD


Once the current design is completed, I'm maybe going into looking how to cut costs even down starting with replacing the DDS ic with a low cost FPGA which will enable many new features.

Block diagram of the current circuit:

fgen_pinout.png

Connector pinout

Portable Network Graphics (PNG) - 511.89 kB - 07/11/2018 at 23:54

Preview
Download

DDSFG-manual.pdf

User manual

Adobe Portable Document Format - 874.25 kB - 07/11/2018 at 23:53

Preview
Download

funct_gen_v1.0.zip

KiCad project

x-zip-compressed - 1.36 MB - 07/07/2018 at 18:49

Download

Function_Gen_source.zip

Code Blocks project for the firmware. Uses the SDCC C compiler.

x-zip-compressed - 84.83 kB - 07/07/2018 at 18:28

Download

atmega328_alternative.PNG

Instead of the 89C51 the ATmega328 can be soldered instead under the 89C51 footprint, this picture shows the wiring.

Portable Network Graphics (PNG) - 61.04 kB - 05/19/2018 at 22:05

Preview
Download

View all 8 files

  • V1.0 PCBs arrived

    DL10108/08/2018 at 19:39 0 comments

    The v1.0 PCBs are here!

    You can purchase the v1.0 kit on the tindie page.

  • Tindie kit

    DL10107/16/2018 at 11:38 0 comments

    There is now a tindie kit available for purchase of the v0.4 prototype.
    At the moment I only have the leftover parts from the prototypes, but I ordered more parts and new boards so I can have more kits in stock.

    https://www.tindie.com/products/untemed/10-mhz-function-generator-diy-kit/

  • User manual

    DL10107/12/2018 at 13:18 0 comments

    I've wrote a user manual on how to operate the device once in its original form Link.

  • Project files released

    DL10107/07/2018 at 18:50 0 comments

    I've finished doing various bug fixes, so now the files have been published.
    The next step is to write s user manual.

  • Bugs

    DL10107/02/2018 at 15:15 0 comments

    I've found a few minor bugs with the firmware that need to be fixed.
    Once that is done I'll do a minor PCB revision with only layout changes.
    When I'll have everything completed and fixed I'll publish the project files.

  • Firmware first version completed

    DL10106/20/2018 at 01:29 0 comments

    I've completed the first version of the firmware with the basic functions and frequency sweep.
    Unfortunatly only about 140b of program memory is left so there isn't much space to add more features without upgrading
    the mcu.

  • v0.4 completed

    DL10105/19/2018 at 21:42 0 comments

    I got the v0.4 pcb-s and soldered the parts and it works!
    Everything now works as it should, all the voltages are matching as they should (previous version had some offsets).
    Now the only thing left is to finish the firmware (and find two 100 ohm resistor somewhere).
    Also the knobs are a bit large, so I'm looking for alternatives on ebay to replace them so the scale on the pcb is more visible.

  • v0.3 completed

    DL10105/10/2018 at 00:27 0 comments

    I finished with the v0.3 and it works with a few minor bodges.
    Now I'm about to order the v0.4 which should hopefully be the final version with the final modifications.

  • v0.3 PCB ordered

    DL10104/11/2018 at 13:00 0 comments

    I finished routing the v0.3 PCB and ordered it.

    Now it can also use the ATmega328 instead of just the 89C51.

  • v0.3 Schematic

    DL10104/08/2018 at 18:26 0 comments

    I managed to add square waves to the output waveform types with a 74HC4053 without affecting the price too much.
    Now I have to make a new PCB and test it out.
    Link: Schematic

View all 17 project logs

Enjoy this project?

Share

Discussions

Yann Guidon / YGDES wrote 02/18/2018 at 16:35 point

I'm curious about the jitter, which is a big issue with a DDS.

  Are you sure? yes | no

DL101 wrote 02/18/2018 at 23:54 point

The datasheet of the DDS puts it at: 120 ps rms 3 MHz sine wave

  Are you sure? yes | no

Yann Guidon / YGDES wrote 02/18/2018 at 23:58 point

nice but it should be measured for many frequencies :-)
particularly frequencies that are relatively prime to the main clock :-)

Then again it also depends on your requirements.

  Are you sure? yes | no

DL101 wrote 02/20/2018 at 21:22 point

I can go to the local uni and borrow the lab to do measurements once its done, but I can't do miracles without increasing the bom. The point of this is to have something good enough for most common applications.

  Are you sure? yes | no

Ted Yapo wrote 02/19/2018 at 00:11 point

If the title were "Low Phase Noise Function Generator," I'd agree that it requires measuring.  As it is "Inexpensive Function Generator," I'm willing to trust the good people at Analog Devices. :-)

  Are you sure? yes | no

DL101 wrote 02/20/2018 at 21:23 point

Yes, I'll try to make is as good as I can without increasing the bom.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates