Public projects 1

Arduino Due Arbitrary Waveform Generator

Project tutorial by BruceEvans

  • 65 respects

Toolbox 1

Respected projects 0

 BruceEvans hasn't respected any projects yet.
  • Arduino Due Arbitrary Waveform Generator 3 months ago

    Hi manasmukherjee,

    Thanks for your comment.
    If, as I suspect, you want to disable the DAC output waveform with a trigger voltage on one of the Arduino's I/O pins, then the only way I can think of to achieve that, would be in conjunction with the Controller program by, first of all, setting the arbitrary wave to a straight line by simply clicking FILL in the drawing window, and Upload it. Then enable switches by momentarily switching pin 22 to ground. Then you can feed a negative trigger voltage to pin 40 to cycle through the Wave Shapes. When you reach the Arbitrary waveform you will have a straight line, i.e. no waveform. This is probably not what you really want, but maybe the only option without adding code.
    However, I'm currently working on version 2 (have been for many months) with heaps of new features. One is amplitude modulation controlled by one of the analogue pins. This might be a better option, but probably still months away! (If you can wait, please note that when modulation is set to zero, this would give you a DC output at half supply voltage, not zero volts. Also, in modulation mode the sample rate will be lower.)


  • Arduino Due Arbitrary Waveform Generator 10 months ago

    Hi qtron,

    This is for the Arduino Due which can only provide a few milliamps of output current, so the load must be high impedance. There are no devices to provide 50 ohms output. If you are referring to the optional 47 to 100 ohms resistor mentioned, this is not related to output impedance.
    There are 2 DAC outputs but only one can be used with this project, otherwise sample rate and other specifications would've been massively sacrificed.
    You would need an inverting amplifier and buffer after the output to provide the balanced output you mention.
    The square wave can be synchronized with the analogue (DAC) output, so that can be used as sync, although the pulse width is very short if duty cycle is set to 0% or 100%, as shown in the specifications.
    Currently, at least, it cannot be set to output a number of pulses, then stop. The waveform produced is continuous.
    If you are not already familiar with the Arduino Due I suggest you check it out on the Arduino website (and anywhere else you can find) for connections etc before you consider using it, as the connections are easily damaged, hence the optional protection circuit offered. However, connections are marked on the Arduino.


  • Arduino Due Arbitrary Waveform Generator about 1 year ago

    Hi Mike,

    I've downloaded your modified .ino file and loaded the sketch into an Arduino Due (genuine one) but although the 1kHz output waves are present I cannot control them in any way with the serial monitor (sending x, X, XX or anything else I tried).
    Perhaps the .ino file is an old one you have since replaced because, quickly looking at the code, I can't see how it could've ever worked: There seems to be a problem with the code related to your "bReadChar" in the serial read section of the sketch. Perhaps I'm missing something, but I don't have time to check further. If you have an updated .ino file I'd love to try it. Generally, your code looks pretty good.

    (Also please note that pin 7 is not always used for the unsynchronized square wave output as implied by your comment near the start of your .ino sketch. Pin 3 is used instead below 163Hz. I explained the reason in my second reply to "djadeski" above.)

    Kind regards,

Add projectSign up / Login