Pi-16ADC

Posted on

Raspberry Pi HAT (expansion board) designed for the Raspberry Pi B model 40 pin connector. Pi-16ADC uses a LTC2497 chip that adds sixteen (16) single end or 8 differential Analog to Digital Converter (ADC) ports for collecting data from analog sensors or devices. With a sampling Data resolution 16 bits on all 16 ports. Sample code in Python is available to program analog sensor connections to a Raspberry Pi over an I2C address if needed. Solder-less connections via screw down terminal block and additional solder points are provided for each input channel and ground.

Pi-16ADC

Features

Each terminal block connection is paired as Channel-Ground. (ex: Channel-0 and Ground is in the top left corner. Channel-1 and Ground is the next pair going clockwise). *To minimize spurious readings and stray noise pickup, it is recommended to use the channel-ground pair as provided. It is also recommended to connect unused channels to the ground with a short jumper wire when a channel is not in use.
All terminal block connections are marked on the board. Each terminal block Channel also has a corresponding solder point next to it. These are also labelled and are shown below.

Setup

Pi-16ADC communicates with the Raspberry Pi using the I2C bus.
To set the address, 3 jumpers A0, A1 and A2 are provided.
Each jumper can be
1) Connected to +5V – state defined as “High”.
2) Connected to Ground – stated defined as “Low”.
3) Removed – state defined as “Float”.
27 possible addresses can be defined using the I2C address jumpers (listed in sample code).
Check I2C is Setup

The default address is 0x76 (A0=High, A1=High, A2=High)

Clone Repository or Download Code
git clone https://github.com/gilmedel/Pi-16ADC
The python code uses time, smbus, sys, os, subprocess python scripts. Starts by initializing the i2c bus, address, and channel to be used, sets reference variables used for Voltage, reading,

Connect Analog Sensor

Connect analog sensor output to channel0 on the terminal block connector and common ground. The signal must be between .2-2.5V (-2.5 to 2.5 V for differential comparison)

To run code from Terminal setup a virtual environment for Python and activate and install any missing dependancies

python3 -m venv pi16_test-env
source pi16_test-env/bin/activate
pip install smbus
python3 pi16adc_test.py
Running Test python code
Running Test python code

In this example a soil moisture sensor is connected.