Skip to content

arduino project that reads out NTC temperature probes and uses a simple state machine to challenge / respond the sensor values via serial console

License

Notifications You must be signed in to change notification settings

graetz23/ArduinoSerialStateTempProbes

Repository files navigation

Arduino Serial State Temperature Probes

Introduction

Arduino Serial State Temperature Cable Probes (ASSTP) drives Negative and Positive Temperature Coefficient (NTC & PTC; thermistors) probes on all available analog inputs, may display those on some I2C driven LCD display, and cycles a state machine that allows for remote controlling via serial port; e.g. using USB.

photo of my ASSTP test bench

Two projects are combined for ASSTP:

and extended by extra serial commands to allow for remotely requesting values of the six temperatures cable probes (TPs).

Building

For building the HEX file, the arduino Makefile is used. Clone or download / unzip to your system and configure the Makefile to your arduino board and where you have installed arduino Makefile type: make. Alternatively you can include all files of this project in your arduino IDE.

Hardware

Wire your NTC probe with a matching (same resistor value as the probe) resistor in series; I used 10k NTC, so 10k Ohm. Wire from the mid (between your probe and your resistor) of this voltage divider to an analog input of your arduino; e.g. A0. Wire the 5 V system's volatage and GND to the ends of your voltage divider; one end is the selected resistor, the other the end of the NTC probe; done.

Here is some circuit:

ASSTP PCB

However there are several public posts, blogs, and vlogs on internet showing schematic wiring diagram for breadboards; try searching for: NTC arduino; do not get iritated, the NTC lowers its resistance when heating up, so it is connected to 5 V, while runnig this code.

I also designed a PCB prototype shield for arduino UNO, and leonardo. It is in version:

  • v1 - prototype shield; to be soldered and tested / bug fixed.

ASSTP PCB

It is keeping six NTC connectors, where five have cable glands for cabled NTC probes and the sixth has solder eyes for an internal NTC probe. There's a 5 mm heartbeat LED connected to PIN 13 (arduino's default / builtin SMD LED) for the serial state machine, where one can see the STATEs: constantly on - ERROR, heartbeat - IDLE, and flickering - processing some RUN MODE state currently.

Additionally theres a regulated power suppler, fed by up 18 V (even 37 V) that allows to regulated the volatage for electronics up to 5.87 V in maximum - to boost some device with 5.2 V to 5.4 V instead receiving 4.8 V from some weak usb hub.

Usage

Flash arduino, afterwards open a serial client, e.g. the serial monitor (press CTRL+SHFT+m) of your arduino IDE. arduino is in STATE: IDLE and waits for retrieving COMMANDS from you. COMMANDS have the syntax: <CMD_ID>; e.g. <2>, <3>, and so on; a listing of all COMMANDS is here. arduino will reply in IDLE to some of these COMMANDs; just try for.

However, for reading the temperature values of analog input A0, try:

  1. <10> ask optionally for STATUS, and arduino should reply with: ; the current state,
  2. <11> tells arduino to go to another state: run MODE1; which is overloaded,
  3. <40> requests arduino to send °C value of CTP at A0: 22.789.

For any other analog input: A1, A2, ,A5, try sending while in run MODE1: <41>, <42>, ..,<45>.

The extended COMMAND list by this project:

  • <40> request temperature value in degree celsius (°C) of analog input A0,
  • <41> request temperature value in degree celsius (°C) of analog input A1,
  • <42> request temperature value in degree celsius (°C) of analog input A2,
  • <43> request temperature value in degree celsius (°C) of analog input A3,
  • <44> request temperature value in degree celsius (°C) of analog input A4,
  • <45> request temperature value in degree celsius (°C) of analog input A5,

if arduino is processing in run MODE1; general COMMAND: <11>.

For more details, see coolSSATP.ino file as outer world usage example. For an own adapation, e.g. for driving another type / size of LCD display, take a look to the inner world, see the ASSTP.cpp and also coolATP.cpp as how to change things inside.

Releases

The following stable releases of ASSTP are available:

  • v1.2 - renamed repo & porject to Arduino Serial State Temp Probes.
  • v1.1 - changed analog IDs from 7x to 4x; e.g. <40> .. doin' leetspeak.
  • v1 - driving a I2C 16x2 LCD display additionally.

Try cloning (git checkout <SHA>) or download and unzip from release page.

Remarks

I will use this project for driving several NTC probes in a home brewery system to monitor the temperatures independently, only using arduino and a 20x4 LCD display. The brewery automation is driven by a raspberry pi 2B running CraftBeerPi3. I am currently writing a python plugin for CBP3: craftbeerpi3ArduinoTempProbes using coolPSSM as a basis for communicating with arduino; coolPSSM is the python aquivalent that runs on ardiono as a basis coolASSM.

Everything was coded using:

have fun :-)

ChangeLog

20200411

  • release of v1.3; due to optimizations,
  • tested this project by craftbeerpi3ArduinoTempProbes and optimized it.
  • lowered all delay time:
    • coolASSM is now on 1 ms delay,
    • removed the delay in readingSerial totally; seems to be blocking, when reading - no idea, ;-)
  • added PCB screenshot and some read me,
  • added circuit screenshot and some read me,

20200405

  • renamed project

20200404

  • changed COMMANDs from <7x> to <4x>
  • updated coolASSM
  • updated coolPSSM:
    • coolPSSM request in a loop analog data A0 from this project flashed to arduino.

20200402

  • matching to coolASSM verions 20200402:
    • in coolASSM: method running was deprecated and removed,
    • in coolASSM: methods runMODE1, runMODE2, .., runMODE7 were added instead,
    • overloaded method runMODE1 instead of running
  • added signaling on built in LED (PIN 13) of several states:
    • ERROR the LED is contantly on,
    • IDLE the LED does a heartbeat with 60 bpm,
    • and for all run MODEs, the LED flashes by 10 milliseonds.
  • added photo of my test bench ;-)
  • creating README.md.

20200331

  • adding MIT License to all files.
  • adding the README.md for explanation,
  • setting up reository on github.com.