ThermoPiggy

From NebarnixWiki
Jump to navigationJump to search

Problem Statement

The XH-B310 is an inexpensive and wonderful temperature display. It can be powered from 12V or a 9V battery, and displays the K-type thermocouple temperature on a large LED display. The best part is that they can ready up to 800 degrees C! These are super useful for keeping an eye on a reflow oven temperature, or a distillation or liquid temperature during chemistry experiments and so on. The possibilities are really endless. It is also, oddly, cheaper than a thermocouple IC breakout board several times over.

Unfortunately the developers did not think to provide the temperature data to the user in any sort of easily digestible form. Using these to feed data into a smarter system is unfortunately not so easy. This is truly disheartening as the system uses an STM8 micro-controller, which could easily provide temperature data at 9600 baud on a spare pin.

System Overview

It should be possible to piggy-back an arduino nano onto the analog signals output by the various sensors to the board's ADC. This is not as ideal as just getting the result from the micro for many reasons, but it does mean it is entirely possible, and indeed quite likely, that each board will display a slightly different reading. This will have to be acceptable...

XH-B310 Overview

Back of the unit
Front of the unit, LED display removed

The XH-B310 is a clever design and can be broken down into the following components:

  1. 5V Regulator - To provide a constant voltage to the LEDs
  2. 3.3V Regulator - Powers the rest of the board
  3. op-amp - 76x gain stage for thermocouple voltage
  4. analog mux - which switches between passing the + (for normal operation) and reading the - (for calibration)
  5. 2.5V precision reference for the ADC
  6. 10k thermistor to sense ambient temperature
  7. a diode for reverse polarity protection
  8. An stm8s003f3 microcontroller

To calibrate the offset voltage, the unit pulses the MUX every 67 seconds for a little over a second and reads the negative pin of the thermocouple.


Interface

Intercept Points

Cold Junction

The ambient temperature of the cold junction is measured using a thermistor.

Process Junction

The process junction is read through an analog MUX, and then multiplied by an op-amp with a gain of 1+66=67x.

Offset Voltage Cal

The solution here is to either discard point that differ greatly (or maybe just require several in a row to change the alert status of the setpoint being reached or reset) or even better would be to intercept the MUX control signal, and use it to our advantage.

Arduino

ThermoPiggy bb.png


An Arduino nano was used due to the low cost and high availability.

The source code can be found here: https://github.com/nebarnix/XH-B310_Backpack