A Truly Professional Raspi Analog Input

Much to the chagrin of hardware tinkerers, the Raspberry Pi doesn’t have analog inputs on its GPIO pins. Sure, you can blink a LED with just a few console commands, but reading sensors with a bone-stock Raspi requires a little additional hardware. [Brian Dorey] just released a board that allows for 8 analog inputs on the Raspberry Pi with a 16-bit resolution that is much higher than any Arduino-based build.

[Brian]’s build is based on an earlier, similar iteration of a Raspi analog board we saw last July. Like the previous version, the new professionally made PCBs use a pair of Microchip MCP3428 analog to digital converter. These ADCs are able to sample four channels at a resolution of 16 bits; a vast improvement over the 8-bit ADCs included on every Arduino.

The boards communicate with the Raspberry Pi over an I2C serial bus using a neat stackable header. In theory, it should be possible to use several of these boards and measure dozens of analog channels, but we’ll leave a demonstration of that up to [Brian].

37 thoughts on “A Truly Professional Raspi Analog Input

        1. Omg… You have no idea about the size of the bullshit you just said, dont you? =O
          Why st*p*d people tend to think they know everything while they dont? Just be quiet.. way better than giving misinformation.

      1. This reponse is for six677; ATMEGAs have 10 bit ADC, it doesn’t matter they are 8 bit microcontrollers,one thing it’s their core architecture, and another it’s their peripherials. Just like PICs 18f, i.e. , PIC18F4550 has a 10 bit ADC, and also you can configure its PWM resolution and frequency.

    1. S7-300 CPU costs slightly more than $250 and it’s a bare CPU (except C-line). You’ll need additional modules (~$200 each) for digital and analog IO.

      On the other side, Raspi, Arduino and other toys have some IO onboard. But (I hope :) no one will ever use them for industrial applications.

      (I’m a Siemens Solution Partner and Raspi fan :)

  1. Plus, why even compare these to what’s built into the Arduino in that way? These are I2C devices, you could just as easily read them from an Ardiuno. It’s nice to make a shield/add-on that provides this functionality but it seems to be saying “take that Arduino! This guy added some parts to a Pi that he just as easily could have added to you!”

    Another note… you can do more with digital I/O than blink LEDs, so that was a bit of a needlessly dismissive comment. Yet another note, the Pi may favor digital I/O but it does support I2C, so you know, kudos for hanging I2C chips off of it…. exactly like you’re supposed to… :S

  2. At full resolution, the MCP3428 ADCs used on that board generate only 15 samples per second. While that doesn’t make it useless, it’s a pretty severe limitation.

    And surprisingly (or maybe not), the ADC Pi product description lists all relevant specs *except* for the low sample rate.

  3. 5.06V/2^15=154uV per bit!

    IME, ADC circuits typically start to require careful layout and power considerations to get full use of anything over 10 bits of resolution. I would be interested to see what precautions are in place to keep those LSBs from being swamped by power supply noise, I2C cross-talk, etc.

    However, it looks like the board would be handy even if you only got 10 usable bits out of it.

    1. +1

      Exactly what I wanted to say. Slapping an X-bit ADC on a PCB does not imply you’re automatically able to sample at that resolution. Just like having a 100MHz oscilloscope does not mean you have the ability to handle those frequencies. Anything below a mV or above 20MHz requires knowledge and experience.

  4. While I agree that this is a fairly well done board, I don’t quite know about the phrase “truly professional”. Based on the layout alone I wouldn’t call it professional… I’m sure it works, but I think we would all appreciate less opinion from the HAD writers, especially when it is often clear that they aren’t themselves professionals…

      1. I believe they just changed *which* I2C port is exposed, as the old one could carry a fair bit of internal traffic. It’ll be a code change (in your application software) not a hardware one.

      2. After re-reading the RPi blog post on the topic, the I2C pin locations remain the same on P1.3 and P1.5, but they come out of the secondary channel. So, apps could need to change depending on whether the OS now presents them as /dev/i2c-1 or still as /dev/i2c-0.

        In any case, though, I think the board above should still work with rev. 2.

  5. looking at the datasheet for this adc and aparently you can only gat 15 samples per second in 16 bit mode. if you want 60 you have to drop the resolution to 14 bit, and if can do 240 if you further drop the resolution to 12 bit. this is not totally a bad thing, but it is kind of a limitation none the less.

    1. And to be exact, MCP3428 allows up to 8 devices in one bus, by changing the address bits, thus making a total of 4 boards in one bus possible. One has to make a hardware modification to change the address of both chips on board, tho. (Having 4 three pin headers, or solder tabs, would have been nice addition to this.)

  6. I would have used a faster ADC, maybe something that can put 100Ksps at 10 bit resolution and more resolution for less speed.
    Also, the board is far from professional because:
    1) He used two chips with internal references, that means you have one reference for 4 channels and one for the other 4, you will get different readings. The right way would have been a single external reference which the user might change on desire.
    2)the pcb is not correctly routed to eliminate noise and allow for a 16 bit resolution.
    3)there is a single 100n(maybe) filter capacitor for the whole board. What happened to the 100n cap bypassing each pair of power supply pins of each IC?
    4)He shouldn’t have used voltage dividers, that’s not a good way. You don’t know the impedance of the sensor or whatever you read and that will affect your transfer function. The correct way is to either let the user put in the divider or buffer the input and then divide it.
    5)how did he manage the I2C addresses? He should have left one of the pins as user configurable(maybe it is brough to the header, i cannot tell) so that you can stack two of these boars.
    6) what’s an NPN mosfet?

    1. those chips have 2 address pins, so i guess you can run four of them off of a single i2c bus. also read my post above about sampling rates vs bit dept that this chip supports. since ive been looking for a high res adc chip with an i2c interface i always look at the datasheets for stuff like this. its actually not a bad little chip.

    2. @Bogdan, Thanks for saying it. This board is far from being properly designed, much less “Professional”. In addition to all your suggestions, I might have included a very low noise LDO on board, noise is a battle hard won with 16 bits and a connectorized design like this. The last thing you want to add into the mix is noise on the supply.

    3. I’m guessing not alot of ladies in your lives. Way too much pent-up aggression! 16 bit that, 100msec that., blah blah blah. Poon’ is all that is needed for clarity of thought.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.