Low-Cost, Two-Channel Scriptable Waveform Generator

Microcontroller addict [Debraj] decided to make his own programmable sine wave generator, and was able to put it together for under $40 USD. Other than low-cost, his list of requirements was as follows:

  • Dual sine wave output, synchronized
  • Frequency, Amplitude, and Phase control
  • Low harmonics under 1 MHz
  • Scriptable via Python

The heart of the project is the Analog Devices AD9833, a complete Direct Digital Synthesis (DDS) waveform generator system on a chip. If you’ve ever rolled your own DDS using discrete ICs or in an FPGA, you can appreciate the benefit of squeezing the phase accumulator, sine lookup table, DAC, and control logic all into a single ten-pin package. [Debraj] uses AD9833 modules from the usual online vendors for a few dollars each. He synchronizes the generators by disconnecting the reference crystal on the second module and driving it from the first one. The remaining specifications are met by the inherent characteristics of the DDS system, and the scriptable interface is accomplished with an Arduino controlling the AD9833 chips and two programmable gain amplifiers (MCP6S31). We like the confidence that [Debraj] displays by sketching the initial circuit diagram with a ball-point pen — check out the sketch and the final pictorial schematic in the video below the break.

This is a good example of combining off-the-shelf modules to quickly build a project. This approach is great for one-off builds or as a proof-of-concept test bed that can later be spun onto a custom PCB. Another reason to use modules these days is that the modules are often in-stock but the chips are unobtainable. Though it appears [Debraj]’s only needs one of these generators, it would be an easy board to layout and build — if you can buy the parts.

Continue reading “Low-Cost, Two-Channel Scriptable Waveform Generator”

Arduino Powered Portable Function Generator

It’s probably not much of a stretch to say that many of us have taken on a project or two that were little more than thinly veiled excuses to add a new tool or piece of gear to our arsenal. There’s something to be said for a bench full of button-festooned test equipment blinking away, it’s like bling for nerds. But just like getting your name written out in diamonds, it can get expensive quick.

Luckily, the hacker has enough technology at their disposal these days that DIY test equipment can help fill your bench without emptying your wallet. [Faransky] has created a very impressive Arduino function generator that doesn’t skimp on the features. Capable of generating sine, triangle, and square waves up to 10MHz with its all-digital circuitry, it’s a piece of gear that’s well worth the $30 USD or so it should cost to build your own version.

For those worrying that [Faransky] is relying on the PWM functionality of the Arduino Nano to generate waveforms, have no fear. At the heart of the device is a AD9833 waveform generator; with the Arduino, rotary encoder, and 16×2 LCD providing an interface to control it over SPI.

Unfortunately, the AD9833 doesn’t have a way to control amplitude, something which is pretty important in a function generator. So [Faransky] uses a X9C104P 100KOhm 8-bit digital potentiometer as a voltage divider on the chip’s output.

To wrap up the build, he added a 2000mAh 3.7V Li-Ion battery and TP4056 charger, with a DC-DC boost converter to get 5V for the Arduino. Though if you wanted to create a benchtop version of this device, you could delete those components in favor of a 5V AC/DC adapter.

We’ve seen our fair share of DIY function generators, ranging from minimalist builds to hardware that could pass for a commercial offering. We’ve even seen some cheap turn-key function generators, though the usual warnings about getting what you pay for apply.

Continue reading “Arduino Powered Portable Function Generator”

Adorable Homebrew Waveform Generator

waveform

For want of new test equipment, or simply a project, [Enzo] decided he would take a shot at creating his own waveform generator*. Not only is it a great project, it’s also a decent piece of test equipment, with proper signal conditioning, a nice front panel, and a built-in wall transformer.

The guts of [Enzo]’s waveform generator is an AD9833 programmable waveform generator, a neat little chip that can output square and triangle waves fro 0.1 Hz to 3.2 MHz and sine waves from 0.1 Hz to 1.6 MHz. [Enzo] is controlling this chip with a PIC16 microcontroller, with a whole bunch of analog circuitry between the digital domain and the BNC connector on the front panel.

The waveform generator is controlled by a suite of dials and switches on the front panel, giving [Enzo] complete control over his new tool.

* Here’s a Google translation, but good luck with that. Just… get Chrome or something.