Teensy and the ADS1256

From Matt Bilsky

Revision as of 15:34, 14 February 2019 by Matt Bilsky (talk | contribs) (Hardware Overview)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

I have been doing a lot of work with the ADS1256 as a low-cost, high-sensitivity 24-Bit analog to digital converter for my experimental setups. My goal with this tutorial is to introduce the board and its capabilities.

Tutorial Video

Software Libraries

The Arduino/Teensy code is available here (updated): GitHub Code

It is built upon the following 3 existing libraries: adienakhmad Flydroid baettigp

Also see Wozzy's post on the PJRC forum here: Teensy Forum

There are 4 primary functions:

initADS() sets up the pins and interrupts for the system. It is also where the buffer can be enabled/disabled, the mux registered to the default pin, the PGA is set, and the data rate. Enabling the buffer will thrown an error over the serial monitor because the first four bits are read only and chip specific. Feel free to ignore that. Enabling the buffer seems to give more accurate voltage readings when using a power supply or signal generator. The buffer seems to mess with strain gauge differential readings so I disabled it for my setups.

read_Value() returns a single value from the pins set to the mux register in the initADS() command. It enables high speed reading (up to 30 KSPS)

read_two_values() updates the variables val1 and val2 with the differential readings from pins 0,1 and 2,3.

read_three_values() updates the variables val1, val2, and val3 with the differential readings from pins 0,1 , 2,3 , and 4,5.


To use the libary, open the file ads_1256_custom_library using Arduino/Teensyduino. The other two files containing the register definitions and functions will then be imported to the sketch (after you put them in the same folder). If you are interested in helping to convert this into a conventional library with objects, etc. please let me know!

The Excel used to compute the timings that was discussed in the Errata video is available here: ADS1256 timing calculation sheet

Hardware Overview

The board I have been using is currently out of stock on Amazon: WINGONEER ADS1256 breakout board on Amazon (Affiliate link, but it is the same price for you if they get it back in stock)

BE CAREFUL when buying from AliExpress like this one: AliExpress board that sometimes doesn't work

I have found some of the inexpensive boards from various overseas sellers to be hit or miss. At some point in the future I would like to put out a video comparing boards from different sellers (I have 5-10 different ones in different form factors sitting in a box...).

Here is the circuit diagram used in the demonstration video:


Teensy ADS wiring diagram bb.jpg


The Fritzing part is available here: ADS1256 Breakout Board Fritzing. I haven't implemented the schematic or pcb sections of the part yet but if you are interested in helping, please let me know.

Updates and Errata Video


How Bit shifting works for reading data from the ADS1256 into the Teensy