Direct Digital Synthesizer (DDS) (Part 9)

Part 12345678, 9

Let’s go a few steps further in the direction of a fully featured arbitrary wave generator ! The early posts describe how to generate clean waves at various frequencies. In this post, I will explain how to offset the signal and how to attenuate it.

Setting negative offsets requires… negative voltage ! Which Arduino  platforms do not provide. However, thanks to simple and cheap components, this problem will not bother us long. I will use an ICL7660 (or its numerous equivalents) to produce a negative voltage symmetric in value to its supply voltage. If your are looking for constrained voltages, supplying the chip (and consequently the whole circuit) with +5 V will be fair enough as long as your signal will roughly stay within the -4 to +4 Volts. If you need a wider range, you may just use Vin and feed your arduino platform with an appropriate DC voltage source (12 V in my case). The ICL7660 requires one booster capacitor and a filtering capacitor (100 µF or more in this case).

The principle of operation is illustrated in the next picture (figures relate to the +5V version):

First stage is the DDS that you now know well. Next is the offset suppressor at the end of which the signal will range from -1.5 V to +1.5 V (as I use 3.3 V as a reference voltage). Next is the low pass filter that has already been described followed by a simple potentiometer which acts as an attenuator. The attenuated signal enters a differential amplifier which inverting input is wired to an other potentiometer which delivers a signal ranging from -Vcc to +Vcc which correspond to the possible range of offsets to be subtracted from the wave signal.

Next picture illustrates the whole circuit driven by a generic Arduino UNO 3 platform.

Words of advise: Using a negative voltage is probably unfamiliar to many Arduino enthusiasts lacking experience in analog electronics. Care shall be taken while wiring the circuit on a bread board. Care shall be taken with polarized capacitor which do not like at all being improperly biased !

Best performances shall be achieved with components featuring tights tolerances. Resistors will be 1% in the worst case, 0.1% is strongly suggested. The basic LM324 may be replaced by any compatible quad operational amplifier: check the supply voltages ! (e.g. The TS924 will not work !).

The gain of the amplifying stage is set by R9 and R10: G= 1+(R10/R9). Set the gain according to VCC+ and VCC-. R9 and R10 shall be in the range of x10 kOhm. e.g. Select R9 = R10 = 10 kOhm in order to achieve a x2 gain.

Next picture illustrates the prototype that I assembled for early testing. The wiring may look a little bit messy: it is not. Wires should be kept short in  order to prevent noise pickup. Both the Arduino platform and the breadboard sit in a fit for purpose 3D printed shell.

Next picture illustrates the signal as read out of the DAC (@2 kHz) and as read at the output of the circuit, using a negative offset (notice the different scales).

This other picture illustrates what goes on when the offset is set too low !

Enjoy !

 

Leave a Reply

You must be logged in to post a comment.