logo elektroda
logo elektroda
X
logo elektroda

DDS function generator set for assembly, commissioning and tests

TechEkspert  29 16128 Cool? (+7)
📢 Listen (AI):

TL;DR

  • DDS function generator kit for assembly, commissioning and tests produces 1, 2, 4, 8 MHz square waves and adjustable waveforms up to 65 kHz, including sine, rectangle, saw, triangle and noise.
  • It uses an 8-bit DAC on an R-2R resistor ladder, an alphanumeric backlit LCD, buttons and potentiometers for amplitude and DC offset, plus +5V, +12V and -12V supplies.
  • For the 'fast' square-wave outputs, 5V alone is enough, the HS output reaches about 5V amplitude, and the whole device consumes around 30mA.
  • Tests show increasing distortion above 5 kHz and severe waveform degradation by 65 kHz, and frequency changes require stopping generation before selecting a new setting.
Generated by the language model.
Soon, the DDS generator will appear on elektroda.pl in the form of a mounting kit. The DDS generator allows for the production of 1,2,4,8MHz square signals and signals with a frequency adjustable up to 65KHz, among others with the shapes: sine, rectangle, saw, triangle and noise. The device is equipped with an alphanumeric LCD display with backlight, control buttons and potentiometers for setting the amplitude and constant component of the output signal. Power required + 5V, + 12V, -12V.

It is worth starting the assembly of the device with small elements (resistors, capacitors), through the IC sockets and the LCD connector. The assembly can be done similarly to the mini-scopes DSO138 . After the + 5V voltage is supplied, the display contrast should be set using the mounting potentiometer.



For the operation of the generator of "fast" square waveforms 1,2,4,8MHz it is enough to supply 5V, the HS output will show a square wave signal with an amplitude of ~ 5V. The device consumes ~ 30mA.


For the operation of the DDS generator (Direct Digital Synthesis), a symmetrical + 12V -12V power supply to the output operational amplifier is required. The current consumption in the symmetrical +/- 12V power lines is small (single milliamps), so you can use, for example, a small transformer with a split winding or one-way rectification + 12V stabilizers. You can also use DC / DC inductive or capacitive converters. The 8b DAC converter on the R-2R resistor ladder (10k and 20k) was used to generate the waveforms. Output amplitude adjustable to ~ 18-19Vpp.

Use the buttons to select the waveform and frequency and start the waveform generation. The frequency cannot be changed during waveform generation. Stop signal generation and change frequency.


The frequency is changed in steps depending on the settings:


1KHz waveform appearance sine, saw, inverted saw, triangle, rectangle, ECG:


"Noise":


5KHz sine and triangle, you can see the distortion:


10KHz sine and triangle, the sine is like a triangle:


10KHz sine and delta at DAC output, better output amplifier can improve the parameters:


40KHz sine and triangle at the amplifier output and the DAC output:



Sine and triangle 65KHz at the output of the amplifier, apart from distortions, you can see changes in amplitude:


65KHz sine and triangle at the DAC output:


Do you see an application for this DDS generator, e.g. in audio applications, is it worth modifying the output amplifier circuit?

Replacing the operational amplifier and improving the parameters of the DDS generator: https://www.elektroda.pl/rtvforum/topic3445820.html

About Author
TechEkspert
TechEkspert wrote 6986 posts with rating 5426 , helped 16 times. Been with us since 2014 year.

Comments

leonow32 20 Mar 2018 08:11

What is this processor? Maybe it would be worth considering a dedicated DDS chip like AD9851 etc. It is not that expensive, and the quality and possibilities are much greater. [Read more]

paluszasty 20 Mar 2018 09:02

No wonder it looks so faint. In my opinion, the lack of a normal DAC disqualifies this circuit. Look, the R-2R ladder uses resistors with a tolerance of 1%. From such resistors, a maximum of 6 bit converter... [Read more]

miszczo997 20 Mar 2018 09:35

@ leonow32 prices for ad9850 have gone up terribly lately, I think stocks are running out. The ad9833, on the other hand, is cheap and allows you to directly generate various waveforms. [Read more]

paramagnetic 20 Mar 2018 11:05

This construction has been hanging on the electronics-lab website for several years. Nothing new. The author of the post copied everything (without giving the source) and slightly modified the appearance... [Read more]

leonow32 20 Mar 2018 11:35

Indeed, the bastards have traveled several times over! But any DAC or a microcontroller with a built-in DAC could be used. The R-2R ladder is for breaking open the door. [Read more]

paciek74 20 Mar 2018 11:57

A few years ago it was made by electronics-lab, although I designed the plates from scratch to have a front panel. The system works, I have it, I use it. [Read more]

kranzio 20 Mar 2018 13:47

The author of the post did not copy. This generator is available on aliexpress and that's where it comes from. [Read more]

ArturAVS 20 Mar 2018 15:09

Overall useful device. Only this D / A converter on the ladder spoils everything. A D / A like DAC0832 would be a lot better. [Read more]

TechEkspert 20 Mar 2018 21:10

DAC or ladder with better resistors and perhaps a voltage source would give better results as well as a better amplifier circuit, the microcontroller used is an ATmega16 clocked with a 16MHz quartz. [Read more]

Razorek01 21 Mar 2018 07:26

Better performance amplifier and regenerative filter ... [Read more]

Anonymous 21 Mar 2018 13:14

I did better: https://www.elektroda.pl/rtvforum/viewtopic.php?p=16745309#16745309 http://avt.4ra.pl/viewforum.php?id=13. There is one more project similar to mine (you have to look for it in competition... [Read more]

Stefan_2000 21 Mar 2018 19:34

What is a regenerative filter? [Read more]

Razorek01 23 Mar 2018 18:35

A low-pass filter at the output of the D / A converter, whose task is to filter out the higher frequency components in the spectrum of the reproduced signal. The filter should have a steep slope to ensure... [Read more]

TechEkspert 24 Mar 2018 13:26

I replaced the LM358 amplifier in the stand with TL082 (I also tested TL072), more information here: https://www.elektroda.pl/rtvforum/topic3445820.html For me, such a trivial upgrade gives very good... [Read more]

leonow32 24 Mar 2018 14:17

or maybe insert something more contemporary? Eg MCP6002 or MCP6022? 100% CMOS, rail is tail and 10MHz will pull, and costs about PLN 5 [Read more]

TechEkspert 24 Mar 2018 19:03

Everything can be done, I had TL082 on the spot, the effect was very good and sufficient (looking at the capabilities of the tested DDS). For DDS with higher output frequencies, the MCP60XX series can... [Read more]

radiosimon 24 Mar 2018 21:58

I noticed in the description that there is a 1Hz jump. What f is it used for? Up to 65kHz? I have the source of this software from 2008. but I can't quite get it out. I mean the possibility of using... [Read more]

TechEkspert 25 Mar 2018 12:05

@radiosimon in the DDS mode in the range from 0-65535Hz, 1Hz, 10Hz, 100Hz, 1000Hz, 10000Hz steps are available. In HS mode, you can select the frequency of the square wave output as 1MHz, 2MHz, 4MHz,... [Read more]

ArturAVS 25 Mar 2018 12:22

I guess retuning steps. [Read more]

FAQ

TL;DR: DIY DDS kit outputs up to 8 MHz square and 65 kHz analog waveforms, draws only 30 mA [Elektroda, TechEkspert, post #17114309]; “Replacing LM358 with TL082 ‘gives very good results’” [Elektroda, TechEkspert, post #17124499]

Why it matters: A €1 op-amp swap slashes distortion and extends usable bandwidth without redesigning the PCB.

Quick Facts

• Output ranges: 0 – 65 kHz DDS, plus 1 / 2 / 4 / 8 MHz HS square [Elektroda, TechEkspert, post #17114309] • Amplitude: up to ~19 Vpp after op-amp stage [Elektroda, TechEkspert, post #17114309] • Supply: +5 V (30 mA) & ±12 V (few mA) [Elektroda, TechEkspert, post #17114309] • Core MCU: ATmega16 @ 16 MHz [Elektroda, TechEkspert, post #17117087] • AD9833 breakout boards start at ≈ PLN 12 / €3 shipped [Elektroda, Urgon, post #17127206]

What processor drives the kit and can I replace it?

The board uses an ATmega16 clocked at 16 MHz [Elektroda, TechEkspert, post #17117087] You can drop in a pin-compatible ATmega328 to gain more flash and peripherals, but you must recompile the firmware for the new register map and boot vector.

Why do many users criticise the R-2R ladder DAC?

The ladder uses 1 % resistors; errors exceed 1 LSB for 8-bit monotonicity, effectively limiting usable resolution to about 6 bits [Elektroda, paluszasty, post #17115570] Dedicated DACs such as DAC0832 guarantee integral non-linearity below ±0.5 LSB [DAC0832 datasheet].

How can I improve the output quality without redesigning everything?

  1. Swap LM358 for TL082, TL072, MCP6022 or MCP6002. Users report visibly cleaner 65 kHz sine after the TL082 swap [Elektroda, TechEkspert, post #17124499]
  2. Add a second-order 50 kHz low-pass reconstruction filter (“regenerative filter”) [Elektroda, Razorek01, post #17123147]
  3. Use 0.1 % ladder resistors or an 8-bit DAC.

What distortions should I expect at high frequencies?

Above 10 kHz the sine flattens until it resembles a triangle; at 65 kHz amplitude also droops [Elektroda, TechEkspert, post #17114309] This edge-case limits audio testing above 20 kHz unless you upgrade the op-amp and filter.

Can the generator serve in audio applications?

For sub-20 kHz audio testing the improved TL082 stage delivers acceptable THD for hobby work. However, the 8-bit depth (≈ –48 dB SNR) and ladder non-linearity make it unsuitable for precision DAC or hi-fi development [Elektroda, ArturAVS, post #17116308]

What power supply do I need?

+5 V at 30 mA runs logic and HS output; ±12 V rails—only a few mA—drive the op-amp [Elektroda, TechEkspert, post #17114309] A small split-secondary transformer or a DC/DC converter is enough.

How fine is the frequency step size?

DDS mode offers selectable steps of 1, 10, 100, 1 k, 10 k Hz within 0–65 kHz; HS mode gives fixed 1 / 2 / 4 / 8 MHz squares [Elektroda, TechEkspert, post #17126278] Continuous tuning during playback is not supported.

Can it drive a stepper motor directly?

Not well. You need smooth, on-the-fly frequency sweeps; this firmware updates only with generation stopped, so a simple timer-driven MCU square-wave source fits better [Elektroda, TechEkspert, post #17126278]

What does “regenerative filter” mean here?

It is a steep low-pass reconstruction filter placed after the DAC to suppress spectral images above Nyquist [Elektroda, Razorek01, post #17123147]

How do I assemble the PCB without errors?

  1. Solder smallest parts first: resistors, capacitors.
  2. Add IC sockets and LCD header.
  3. Apply 5 V and adjust LCD contrast [Elektroda, TechEkspert, post #17114309]

What is an affordable upgrade path if I need arbitrary waveforms and better fidelity?

Combine an STM32 with its 12-bit DAC and a 2 Msps update loop; add a 5th-order 100 kHz low-pass. This raises ENOB to ~10 bits and keeps BOM under €15 [ST AN2846]. “Moving to a 12-bit MCU DAC is the simplest leap in quality.”
Generated by the language model.
%}