Arduino DAC Library and Shield

This is a software library for the Analog Devices precision DAC chips AD5724, AD5734, and AD5754 that works with the Arduino-based prototype boards. A shield is presently in development to accompany the library.

Why this family of DAC chips?

Using the Arduino platform, there are many ways to get an analog output from digital data. One way is to use a PWM output and then smooth the output with external circuity. Unfortunately, while this works, it does not provide the precision one might need when working with sensitive systems such as those in industrial control i.e. controlling the power of a laser, for instance. 😉

Finding the right DAC chip to fit your needs can be a daunting task. I searched and searched until finally settling on the AD57X4 family. I chose this family of DAC chips for the following reasons:

– DAC settling time of 10uS
– 4-channel [Quad] output
– Single-supply dependency
– Unipolar or Bipolar output
– Selectable output range — six output ranges available, including the popular 0-10VDC
– Serial communication via the SPI of the Arduino

I think the only drawback to this chip is that it is so expensive. It’s not the most expensive DAC chip that I found, however. I think the value is right on though because it is such a versatile chip.

Important Information:

As these DAC chips are intended to be precision, some circuit design considerations should be made so that you get the best performance from these chips. I found a great resource in the AD5754 EVAL board PDF which explains the best practices when designing a board for this chip. This PDF also gives a full schematic of the Evaluation board which can be useful if you are designing your own shield.

There is also a wealth of information regarding these chips in the Analog Devices Circuit Note 86.

In addition to the above references, the datasheet for the AD57x4 chip suggests using a precision voltage reference chip. On my shield, I’m using the ADR421BRZ.  I’m also using the ultra-low noise, low drop-out [LDO] TPS7A4700 regulator from Texas Instruments for the supply to both the ADR421BRZ and the AD5754 chip.

Arduino Mega 2560 R3 Precision DAC Shield Information:

As of March 13, 2014, I have sent off what I believe is my final draft of this precision DAC shield to the fabricator. I should have the new boards back in a few weeks and at that time I’ll be able to assemble them and see their performance. In the mean time, here are some rendered images of the shield courtesy of OSHPark.

UPDATE July 22, 2013:

I have received my prototype boards back from the fabricator and have installed the AD5754 onto it. The library works without a flaw so I’ve decided to expand it to cover all of the capabilities of this chip. I will upload the expanded Arduino DAC library [version 1.0.1] either tonight or later this week.

UPDATE July 27, 2013:

I’ve uploaded version 1.0.1 of the Analog Devices AD57x4 DAC library. This version now supports all of the various voltages that this DAC works with. Note that I have not tested the bipolar outputs so I do not know for sure if this code works, but it should. If you have any issues then please let me know.

UPDATE November 18, 2013

I’ve uploaded version 1.0.2 of the Analog Devices AD57x4 DAC library. This version allows one to customize which Slave Select [SS] pin used on the shield. Simply add the pin number as the third argument when instantiating the DAC library and you’re all set. This has been tested and it works.

UPDATE December 6, 2013

Special thanks to Bernd Rilling for not only confirming that the library works with his shield, but also for making some welcomed changes to the library, such as being able to read the registers and a bug fix from the previous version where the user-defined SS pin was not instantiated. This latest version, 1.0.3, is much improved with this collaboration.

UPDATE November 3, 2018

Adding the schematic and BOM for Version 1.0.4 in PDF format. Note, I seem to have lost the data for version 1.0.5, which uses a different power regulator. As I recall, this is the only change.

UPDATE April 13, 2019

I received a request to add support for Daisy Chaining devices together. In doing this, I decided to not make the library backwards compatible so I have changed the version to 2.0.0b. Note, this is a Beta release as I have not been able to test it.

Download:

Daisy Chain Support (Beta)

DAC57X4 Library, Version 2.0.0b: DAC57X4_V2.0.0b

No Daisy Chain Support (Stable)

DAC57X4 Library, Version 1.0.3: DAC57X4_V1.0.3

Arduino Mega DAC V 1.0.0.4 Schematic

Arduino Mega DAC V1.0.4 BOM

Arduino Mega DAC V1.0.4 Eagle BRD File

Older Versions:

DAC57X4 Library, Version 1.0.2: DAC57X4_V1.0.2

DAC57X4 Library, Version 1.0.1: DAC57X4_V1.0.1

DAC57X4 Library, Version 1.0.0 [beta]: DAC57X4-V1-0-0-b

 

24 Responses

  1. Michael says:

    Hi LAser-Lance,

    I am concidering to order the board for my tests but without schematics it’s useless as I don’t know the parts beside the AD5754, ADR421BRZ and TPS7A4700.

    Can you provide the schematics too?

    Regards
    Michael

    • Laser-Lance Fordham says:

      Hi Michael,
      In the Eagle BRD file, all components are fully documented, including part numbers and vendor, where available. In any case, I have added both the schematic and the Eagle-generated BOM to the download section.
      Good luck!
      Lance.

      • Michael says:

        Hi Lance,

        thank you for providing the schematics. It mades it a lot easier for me as a non-professional.
        I took this information to develop an openGalvo shield for the teensy 3.6. The project will be open source respective open hardware (if you don’t have issues with that). Is there a possibility to contact you via mail? I don’t see any contact information on the website and I would like to discuss this with you directly and not via a public forum 😉 My mail is provided in the form

        • Laser-Lance Fordham says:

          Hi Michael,
          I attempted to email you, but it bounced back. Feel free to contact me via lance at laserlance.com.

  2. Wesley Kuegler says:

    Hi Lance,
    I’m a student intern working at NASA’s Langley Research Center in Hampton, Virginia. I’ve been using your library this summer to build an Arduino-driven sensor simulator system for the Mars2020 rover’s heat shield instrumentation suite. I’ve made some substantial additions to the library, the most significant of which is the ability to operate multiple DACs in daisy-chain mode. I’m planning on sharing my updated version of the library – either with you directly or in my own repository on GitHub – but I thought I’d try to get in touch with you beforehand to make sure you wouldn’t mind. You can reach me at [email removed] for the next week, until my NASA credentials expire as the internship ends. If I haven’t heard from you by then, I’ll place the updated library on GitHub and be sure to credit your website.

    Thanks for building such a useful library!

    • Laser-Lance Fordham says:

      Hi Wesley,

      It was so nice to receive your message. I’m glad you were able to get some use out of the library, especially on such a cool project! Please feel free to share as you wish, with hope that you will keep the attribution to myself and Bernd Rilling.
      I once wondered if developing open-source things was worth it, but now there is no doubt in my mind as I see how this collaboration is really making a difference. Absolutely wonderful.

      Laser-Lance.

  3. Michael says:

    Will your library work on the Uno r3?
    Great work by the way.

    • Laser-Lance Fordham says:

      Hi Michael,
      Thank you for your kind words. Yes, this library should work with the Uno r3. The library uses the SPI channel to communicate with the DAC so you would want to keep that in mind for your PCB design. The AD575* series is 5V tolerant, too, but I added a regulator to my design because I wanted to take advantage of an isolated, low-noise, input power, which can be important for a DAC. Good luck!
      -Laser-Lance.

  4. William Evans says:

    Hello Lance,

    I am interested in using this design for expansion of an arduino due based control system. Would it be possible to have access to the schematic file of your circuit please? I am a student trying to learn a bit about electronics and would like to learn from your design. I have tried downloading your files from OSHPark but cannot open them with the version of Altium I have access to.

    Thanks for your help,
    Will

    • Laser-Lance Fordham says:

      The board file that is on OSHPark can be opened with the Freeware version of Eagle. From there, you can see all of the component values and such. I do not presently have PDF versions of this schematic, and I do not distribute the sch file.

  5. Xnei says:

    Hello Lance,
    This is a very interesting project. I’m trying to think of best ways to power them up in bipolar mode. Suppose I want -3 V~ 3 V DAC output then I’ll need some negative voltage on Vss. How would you configure your powers in such case? Is it possible to power the board through USB and have ground shared to other regulated supply for negative voltage ? It would be nice if the power distribution can be unified in a single cord (+5V, GND and -5V) though.

    • Laser-Lance Fordham says:

      On my shield, I put a configurable jumper (JP2) that would allow either a unipolar or bi-polar power supply to be used. I did this because I knew that I would have an external power supply that would provide power to the analog side of the chip since I didn’t want to add any sort of voltage upconverter to achieve the 10.8V over concerns of reaching the current limit of the USB supply. It is imperative that the supply for the chip and reference be isolated from the AVSS and AVDD supply. One can add a separate regulator, or regulators in the case of positive and negative voltage, so that the isolation is maintained. This is actually a good idea if you are working in the -3V to +3V range.

  6. Logan says:

    Hi Lance,
    Could you please send me the board file, bom and schematic?

    Btw, which is the maximum output current that internal buffer is able to supply in this DAC?

    Best regards,
    Logan

    • Laser-Lance Fordham says:

      Hi Logan,

      The board file can be found at the OSH Park website. I will not be back at the computer that has the other files until after the first of the year. However, the components on the board file have been thoroughly documented [right-click the component in Eagle and select “Properties”].

      Please see Figure 26 of the datasheet for the AD5754. In this figure, it gives about a ±20mA source/sink current. This is with a 2kohm load and 4000pF capacitance. That said, the short-circuit current is 20mA so if you need more than about 15mA, you may want to use a precision buffer.

      Lance.

  7. Glenn WEst says:

    Did you finish the shield? I’m looking for one just like it, for 0-10v output.

    • Laser-Lance Fordham says:

      Hi Glenn,

      I did finish the shield, but I haven’t had a chance to setup any sort of store. If you’re interested, I’ll send along the board file, BOM, and PDF schematic, and you can have OSHPark make you a few.

      Sorry so late getting back with you.

      Lance.

  8. Josh says:

    Are you selling these shields?

    • Laser-Lance Fordham says:

      Hi Josh,

      At this time, I’m not selling them. However, if you are still interested then I can send you the board file, the BOM, and a PDF of the schematic so that you can have OSHPark make a few and build them.

      Lance.

  9. Shay Ohayon says:

    Hi,

    This project sounds exactly like what I need for my application (laser control from Arduino).
    Is there a way to get/buy one of your boards?

    Thanks!

    Shay

  10. Farrokh Chothia says:

    Hi!

    very interested in this project…. as you mention, there are a lot of DAC / Arduino examples out there, but oat of them use a low pass filter…. how are your trials going? Im looking for a solution to drive my 0>10v hydraulic solenoid valve via an arduino, but the hyd controller accepts only an analog dc signal

    cheers!

Leave a Reply

Your email address will not be published. Required fields are marked *