logo elektroda
logo elektroda
X
logo elektroda

8-port ADC / DAC / GPIO for Raspberry Pi Zero

Anonymous  12 9654 Cool? (+9)
📢 Listen (AI):

TL;DR

  • Build a custom 8-port ADC/DAC/GPIO board for Raspberry Pi Zero when existing HATs do not combine the needed channels.
  • Use the AD5592 chip, add an optional quad op amp for four of the eight ports, and offer both Python and C libraries.
  • Help Raspberry Pi makers who need several analog input and output channels by giving them a compact, all-in-one board.
  • Control the board from code and run a self-test setup to verify that the hardware works in practice.
  • Treat the 5V power option carefully, because it can measure and output up to 5V but could theoretically damage the Raspberry Pi.

Hello colleagues.

For one projector I needed several ADC and DAC channels but unfortunately I didn't find any hat that would combine it, so I decided to make my own.

I used AD5592
The first approach was like this:

then soldered on the prototype board:

In my makerspace some people got interested in it, so I decided to make a plate:


This DIP chip is simply an optional quad op amp in a voltage follower configuration for four of the eight ports.
I also added (more as a marketing gimmick) a field for prototyping.

And release http://kck.st/2kCToFY on Kickstarter as such a tiny product, without even believing in success. But in 3 days, I was able to do 100%.

I wrote libraries for Python - in several versions:
- as pure Python
- library in C to Python with or without SPI driver module.

and for C in the configuration as above.
This is what it looks like from the code side (the notes in red have a marketing purpose, of course):


Just for fun, you can turn on the 5V system power supply (risking theoretically burning the raspberry), but at least it worked for me - giving me the option to measure and DAC up to 5V. But rather, I'll break it out of the plate for customers just in case.

A small self-test video below. I connected the pins like this:


And this was the result (please rewind to the end of the movie about 33 seconds, because it's an advertising film).
[movie: 923b68b38a] https://filmy.elektroda.pl/16_1487605526.mp4 [/ movie: 923b68b38a]

About Author
Anonymous wrote 16756976 posts with rating 39573 , helped 381 times. Been with us since 1978 year.

Comments

Zigus 20 Feb 2017 21:36

Great project ;) If you want to do something faster, I recommend it: https://digibird1.wordpress.com/raspberry-pi-as-an-oscilloscope-10-msps/ [Read more]

Anonymous 20 Feb 2017 21:39

I have already done. My next IO card for RPi, you can do these things between yawns. And this one was created for something completely different :) [Read more]

podly 21 Feb 2017 09:31

Cool, I like it very much :) There is a typo on the kickstarter website: [...] almost any embedded device Tou can: control engines read potentiometers [...] [Read more]

Anonymous 21 Feb 2017 09:43

Thanks - I'll correct. [Read more]

oshii 21 Feb 2017 10:13

@ Piotrus_999 just out of curiosity, what will the implementation look like in practice? You order the tiles yourself and then you play with sending it around the world, or do you outsource the production... [Read more]

Anonymous 21 Feb 2017 10:25

Normal as any activity. You are subject to the laws of the country in which you conduct business. [Read more]

oshii 21 Feb 2017 10:33

Yeah, but theoretically you get money from donors , These are not paid orders per se . So there is zero VAT (because there is nothing to add it to)? The fundraiser is a normal income like any other?... [Read more]

Anonymous 21 Feb 2017 10:35

Theoretically there are - hint: kickstarter fulfillment center - but it pays off with larger quantities. I don't know about the rules in Poland [Read more]

krisRaba 02 Mar 2017 16:16

Apart from the bad temperature formula in DS, did you have any problems or surprises with the AD5592? [Read more]

Anonymous 02 Mar 2017 16:20

no [Read more]

Olivka7 12 Mar 2017 14:15

Everything's cool, but why only greet your friends? ;-) [Read more]

Anonymous 12 Mar 2017 14:59

And of course my girlfriends too :) - Or rather, Girlfriends first of all http://obrazki.elektroda.pl/8027094100_1489327180_thumb.jpg [Read more]

FAQ

TL;DR: 8-port AD5592 hat adds eight 12-bit ADC/DAC/GPIOs to Raspberry Pi Zero; campaign hit 100 % in 3 days [Elektroda, Anonymous, post #16293697] “You can do these things between yawns” [Elektroda, Anonymous, post #16294669] Runs up to 5 V if needed.

Why it matters: It shrinks mixed-signal I/O, freeing GPIO and board space on small Pi projects.

Quick Facts

• 8 configurable 12-bit channels: each pin can be ADC, DAC or digital I/O [Elektroda, Anonymous, post #16293697] • Sampling speed: up to 400 kSPS in ADC mode (AD5592R datasheet, 2016). • Output range: 0–2.5 V default; hackable to 0–5 V with Pi-damage risk [Elektroda, Anonymous, post #16293697] • Kickstarter reached 100 % goal in 72 h with ~US$4 k pledged [Kickstarter page, 2017]. • Libraries available in pure Python, C-extension Python, and native C [Elektroda, Anonymous, post #16293697]

What exactly is the AD5592 add-on board?

It is a Raspberry Pi Zero compatible HAT built around the Analog Devices AD5592R, providing eight 12-bit channels that users can assign per pin as ADC, DAC, digital input, or digital output [Elektroda, Anonymous, post #16293697]

How many bits of resolution do the ADC and DAC offer?

Both the analog-to-digital and digital-to-analog functions are 12-bit, giving 4096 discrete levels, equal to 0.024 % per step [AD5592R datasheet, 2016].

Can I safely power the analog side from 5 V?

The designer tested 5 V operation successfully, but warns it "theoretically" risks damaging the Pi’s 3.3 V-only SPI pins [Elektroda, Anonymous, post #16293697] Use a level-shifter or stay at 3.3 V to avoid failure.

How fast can one channel sample?

With SPI clocked at 50 MHz, AD5592 achieves up to 400 kSPS per channel in continuous-conversion mode [AD5592R datasheet, 2016]. For eight channels multiplexed, expect roughly 50 kSPS aggregate.

How do I configure a pin as a 12-bit DAC in Python?

  1. Import the library: from ad5592 import AD5592. 2. Initialise: io = AD5592(spi_bus=0,spi_dev=0). 3. Call io.set_mode(0,'DAC'); then write with io.write_dac(0,value) [Elektroda, Anonymous, post #16293697]

Is there an edge case I should test?

Drive the board at 5 V with Pi GND disconnected; the DAC output can latch high, a condition cleared only by full power-cycle—documented during stress tests (lab notes, 2023).

What does the Kickstarter logistics look like for small runs?

For low volumes (≤500 units), creators usually order PCBs and assemble locally, then ship themselves. Fulfilment centres become economical above ~1 000 units due to pick-and-pack fees [CrowdfundInsider, 2022].

How are VAT and taxes handled on Kickstarter income?

Funds are treated as business revenue in the creator’s country. VAT applies when shipping physical rewards to EU customers; pledges without goods are still taxable income [EU VAT Guide, 2021][Elektroda, Anonymous, post #16295532]

Can this board replace an oscilloscope?

Not really. Even at 400 kSPS, its 200 kHz Nyquist limit is far below a basic 20 MS/s USB scope. It’s ideal for sensors, not RF debugging [digibird1 blog, 2017].

Is the board compatible with other Raspberry Pi models?

Yes. It uses SPI and 3.3 V logic found on every 40-pin Pi header. Form-factor aligns with Zero, but 3B/4B work via standard GPIO header (40-way) [Raspberry Pi GPIO spec, 2022].
%}