Close
0%
0%

16 Channel Thermocouple Multiplexer for Raspi

A auxiliary board capable of handling 16 thermocouples and passing their temperatures to a Raspberry Pi via SPI

Public Chat
Similar projects worth following
An SPI board which allows temperature measurement from 16 thermocouples to a Raspberry Pi. Temperature is measured using a Maxim 31856. It will handle different thermocouple types attached and a temperature range from -200 C to + 1700 C (Thermocouple Dependant) Example Python software allows the direct display to screen and periodic logging to file.

This project is released under the Creative Commons Attribution licence CC-BY. This license lets others distribute, remix, tweak, and build upon our work, even commercially, as long as they credit us for the original creation.

Measuring Temperature

Thermocouples are thin wires of two different types. The most common are Type T which can measure a range of temperature between -270 to 370C. The unit can handle other thermocouple types for different temperature ranges. Thermocouples are connected together at one end. This end is generally referred to as the Hot Junction. The other end connects to your measurement device and is known as the cold junction. A voltage proportional to the difference between the Cold Junction and the Hot Junction temperature is generated by this temperature gradient. This voltage can be corrected and read as a temperature.

This project allows up to 16 thermocouples to be connected and their temperature read in turn. The normalisation and compensation for the ambient temperature are automatically applied and the end temperatures displayed or logged to a comma separated list in a file. Temperatures are displayed and logged in Celsius. Conversions to Fahrenheit can be done by the end user if required.

PiPlay Temperature Circuit Board

The designed circuit board consists of two Analog Devices multiplexer chips for switching between the attached thermocouples and a Maxim Precision Thermocouple to Digital converter. It also has the termination screw terminals for the attachment of the thermocouples. The board also can detect an open circuit thermocouple and flag an error to the operator.

Raspberry Pi

The project is based on a Raspberry Pi which drives the Serial Peripheral Interface (SPI) to set the Thermocouple being read and to read the temperatures. Any device capable of SPI transactions could be used if the end user prefers

Software

Software is written for the Raspberry Pi in Python which can read and display temperatures to the screen. It can also periodically log to a file in comma separated variable form. That file can then be imported to a spreadsheet and graphed if wanted.

Software is available for download in the Files area of this project. Software is in a Tarball format and a discussion on setting up your environment will be available in the Build Instructions area soon.

Screen Output

When running the screen is updated with the readings from all active thermocouples. The names provided for each channel in the .INI file will also be shown in brackets on the screen. This screen update occurs periodically as set in the variable display_interval in the .INI file.

e.g.



In this example one of the thermocouples is showing a Fault condition.  Channel 1 with the name of Tc 1. This occurs if the thermocouple becomes open circuit or disconnected.

The outputted header shows the time and the number of seconds until the display will update and the number of seconds until the next time temperatures are logged to file. These times are set within the .INI file and a further discussion of that file is shown below.

Configuration (INI) file

Configuring the software to read Thermocouples is done in a text based configuration file. Any text editor is able to edit this file. There are a number of sections which are described below.

Default

These are the global level configuration parameters.

[Default]
# Aquisition and Logging intervals in seconds
display_interval = 300
logging_interval = 600

# Logging On/Off
logoutput = On

# Maximum Log file size in Megabytes When the maximum size is reached a new file will be created and the previous file renamed with a date/time suffix.
logfile_maximum = 1

Much of these settings are self evident. display_interval and logging_interval control how long it is between displaying to the screen and logging to a file respectively. These times are in seconds.  An acquisition cycle takes approximately 10 seconds so you should not set these times more frequently. Also frequent logging can lead to self heating of the thermocouple chip and thus introduce error.

The parameter logoutput will switch on or off the logging to file. The parameter logfile_maximum will...

Read more »

TCReadV0_4_20220629.tar.gz

New version with fixed indentation problems from mix of Tabs and spaces.

gzip - 6.31 kB - 06/29/2022 at 10:48

Download

Uncertainty.pdf

This is an analysis of the measurement uncertainty of the device submitted by wisedesigns.

Adobe Portable Document Format - 2.11 MB - 06/07/2020 at 03:36

Preview
Download

Gerbers TC ver1.3.zip

Gerber files for PCB fabrication

Zip Archive - 90.17 kB - 08/23/2019 at 07:32

Download

PiPlayV1_3.kicad_pcb

KiCad PCB file ver 1.3

kicad_pcb - 288.32 kB - 08/23/2019 at 07:30

Download

x-kicad-schematic - 18.93 kB - 08/20/2019 at 07:30

Download

View all 8 files

  • 2 × U1,U2 ADG1607 Analogue Multiplexer
  • 1 × U3 MAX31856 Thermocouple A/D-SPI interface
  • 8 × C1,C2,C3,C4, C5,C6,C7,C8 100nF Ceramic 1206
  • 1 × C9 10uF Tantalum B Case
  • 4 × P1,P2,P3,P4 8 way 0.1" Pitch screw terminals

View all 6 components

  • Project Superseded by new platform, in design.

    piplay08/06/2022 at 05:41 0 comments

    This is coming soon.

    Projected that there will be stackable boards 32 Thermocouple channels for each board, theoretically up to 256 channels.

  • Cleaned up software version

    piplay06/29/2022 at 10:53 0 comments

    I have uploaded a newer version which cleaned up some rogue tab indentations. This has been tested under Pi OS version Bullseye.

  • Error with Ubuntu, Python3 and the Ncurses library.

    piplay02/18/2021 at 10:18 0 comments

    Warning: A problem has been identified with Ubuntu running this application on the Raspberry Pi. A mapping issue occurs between the ncurses library and Python3. This is being investigated with the developers.

  • 0.4 Version Release.

    piplay03/29/2020 at 08:29 0 comments

    A reported bug that prevented the software starling sometimes and getting caught in the Starting 1 loop has been coded around. Anybody who still sees this bug can you report it please.

  • Test of PCB version 1.3

    piplay12/09/2019 at 04:00 0 comments

    I have tested the V1.3 PCB and it works. My previous observation regarding the +/- symbols was in error and they are in fact the right way around. My next task is to design a enclosure to 3D print. At the moment I have the board inside the cardboard box that my Pi came in. To optimise performance you should minimise temperature gradients on the board. The best way to do this is to enclose it, even in a cardboard box!

  • Bug fix for windows smaller than printed area.

    piplay11/19/2019 at 09:31 0 comments

    A minor bug was fixed that caused the application to close if the hosting terminal window was smaller than the displayed text. This has been resolved by specifying a minimum display window.  Although this prevents the application from closing you may need to manually resize the window after the application starts to see all printed text.

  • Minor Update to Python code

    piplay11/11/2019 at 10:32 0 comments

    A small start up bug fixed and new minor version uploaded.

  • Update PCB to Version 1.3 (part 2)

    piplay08/30/2019 at 07:23 0 comments

    The Ver.1.3 PCBs arrived today. I sent the Gerber files on Monday night and the PCBs were on my doorstep Friday afternoon. The price was AU$2.00 for the boards and AU$27.00 for DHL delivery. 

    I will attempt to get one assembled and tested over the week end.

    I just noticed looking at them that I have the +- symbols on the overlay around the wrong way..........Bugger!

  • Update PCB to Version 1.3

    piplay08/23/2019 at 07:41 0 comments

    Posted version 1.3 PCB file and compressed Gerber files. The PCB has been modified but is untested. It "Should" work but it will b e a couple of weeks before I get around to testing it. If you are not feeling brave, the version 1.2 PCB is still available. It works but has 2 unnecessary resistors that have been removed in 1.3. You can fit any value from 0 to a few hundred ohms and it will work.

  • Update Circuit diagram to Ver. 1.2

    piplay08/20/2019 at 07:43 0 comments

    Updated circuit diagram to Ver 1.2

    The circuit has been revised to reflect the removal of the two series resistors. This is as a result of the observation by Hwansoo Suh questioning the function of these components. They are there to protect the input of the converter chip from excess common mode voltage. As the multiplexer will be destroyed by anything much over +3/-0.6 volts the resistor seems a bit pointless. 

    The PCB is yet to be updated. At this stage if you use the Ver 1.1 PCB any value between 0 Ohm to 1K will work. I will publish an updated version as time permits.

View all 16 project logs

  • 1
    Hardware - Attaching the Maxim chip

    The video demonstrates the start of some experiments in improving the performance of the device by improving the thermal coupling of the MAX31856 to the PCB.This will be tested in comparison to an earlier board, eventually.

  • 2
    Software - Setup your Raspberry Pi to run the Thermocouple read program.

    Make sure the SPI subsystem is Enabled

    Run the Raspberry Pi configuration tool

    sudo raspi-config

    When this starts go to the Interfacing Options, then to SPI section. You will be prompted to enable or disable the interface.

  • 3
    Software - Install the needed package libraries.

    Using the Python Package Installer (pip) install the packages required for the project.

    sudo pip install psutil
    sudo pip install configparser
    sudo pip install spidev
    sudo pip install spi

View all 4 instructions

Enjoy this project?

Share

Discussions

piplay wrote 06/29/2022 at 10:57 point

I have uploaded a new version of software, it has been tested in the 32 Bit Bullseye version of the Pi operating system. Can you see if that resolves your issue. 
Also make sure you have uploaded the supporting libraries detailed in the software install area.

What version of the Pi Operating system are you using?

  Are you sure? yes | no

piplay wrote 06/27/2022 at 09:51 point

I am trying with Version Bullseye now, It is the 32 bit version of the OP system because I only have a RASPI 3 handy. It seems to have some issues related to indentation, Python changed how fussy it was about the use of tabs and spaces. I have fixed that but have a hardware issue that I need to solve. This is on the Thermocouple board. The hardware guy will look at that tomorrow and I will look at the software again tomorrow night. For reference, we are at GMT +10 timezone.

  Are you sure? yes | no

piplay wrote 06/25/2022 at 10:08 point

Hi Not Basil Aranda, I have seen this issue before with the Ubuntu version of Pi operating system. I investigated it to the point of finding it was a version difference between the Tcurses library and the Python calls. I had not got around to investigating a solution.. Rasberry Pi Os used to run OK but perhaps later libraries have similar issues.  Let me spin up a copy and see if I can replicate the issue.

  Are you sure? yes | no

Not Basil Aranda wrote 06/25/2022 at 20:58 point

Thank you! Perhaps I should download one of the archive versions of Raspberry PI OS?

  Are you sure? yes | no

Not Basil Aranda wrote 06/24/2022 at 15:46 point

Hi, I'm encountering an error with the file (this is a fresh PI). After unpacking it with the Tar utility and running it, it's giving me a bad file descriptor error. I'm including a link to a screenshot of the errors.

https://imgur.com/EjS9OJJ

  Are you sure? yes | no

Not Basil Aranda wrote 04/19/2022 at 20:03 point

hello piplay, i am attempting to assemble this for a project of mine. Unfortunately it seems the multiplexer ADG1607 is out of stock everywhere it seems. Would you happen to have any suggestions for an alternative? Thank you for creating this project, by the way. it's amazing

  Are you sure? yes | no

piplay wrote 04/21/2022 at 05:22 point

Hi again,

 I had a quick look around and I can't find one that will run at 3.3V. It is a few years since this design but I do remember selecting these devices quite carefully. TI make a pin for pin equivalent but it requires +/-5V supply minimum. I had posted a link to that device in error earlier and have since edited this post.

  Are you sure? yes | no

piplay wrote 04/21/2022 at 09:22 point

A further look and it appears the part aggregator Worldway has stock, they may not deal with small amounts though. Worth checking

https://www.worldwayelec.com/pro/analog-devices/adg1607bruz-reel7/475258

  Are you sure? yes | no

Not Basil Aranda wrote 04/21/2022 at 18:17 point

youre amazing, sir

  Are you sure? yes | no

Not Basil Aranda wrote 02/11/2022 at 05:29 point

Hello, what were your voltage ratings on your 100nF capacitors? 25V?

  Are you sure? yes | no

piplay wrote 02/12/2022 at 01:16 point

They were 50V . It should not be a problem to use lower voltage components. The supply is only 3.3V.

  Are you sure? yes | no

wb8wka wrote 12/26/2020 at 06:30 point

Nice.  Did your experiment with silicon grease help?  You mentioned you didn't know of a application for a 16 channel temp board, well I've been looking for something like this to monitor a air cooled engine cylinder head and exhaust gas temperature and this is just the ticket.  

  Are you sure? yes | no

light0494 wrote 06/19/2020 at 18:16 point

Hi, I must tell you, that this is amazing, I was watching a similar product, but, for 4 thermocouples, a 16 channel board like this is very great, I would like to know if you are going to sell this board as a product in a future, or  is just a project for hobby, and, do your software have or will have, the adjust/calibration option for each channel?, I'm from mexico (sorry for my english), I have the idea to mount multipoint system based on something like this project with a touch display, develop an app with an GUI, and some kind of cloud implementation. here is the other board i was watching https://www.mccdaq.com/PDFs/specs/DS-MCC-134.pdf they have a python library in github, anyway, congratulations for this project, it's very great.

  Are you sure? yes | no

piplay wrote 06/20/2020 at 10:03 point

Thanks for your comments, we weren't planning on offering this as a kit or doing much more work on the current software development.  We are not a commercial operation just hobbyists.  The board has shown that it is accurate within +/-  0.5 degrees in testing done  and kindly contributed back by wisedesigns. His report is in the Files section above (uncertainty.pdf)

  Are you sure? yes | no

Tony wrote 06/01/2020 at 16:33 point

This is awesome.  Were you able to do any testing to see how much this setup effects the accuracy and precision of the thermocouples?  I know most IC mfgs suggest keeping as short of traces as possible to the connector.  

  Are you sure? yes | no

piplay wrote 06/08/2020 at 04:40 point

A document covering the uncertainty and error correction is now attached. Thank-you to wisedesigns

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates