Jump to content
spirilis

Quad Thermocouple BoosterPack (MAX31855)

Recommended Posts

This was a project begun last winter in the hopes of having an array of thermocouples to monitor my old woodstove when operating it ... Well I never got around to finishing it, but I have a fancy new woodstove as of this fall, and I would love to monitor its temperature curves likewise!

 

This BoosterPack is fancied as a baseboard plugging underneath the LaunchPad, with four holes for mounting studs in case I ever decide to fix it inside a permanent enclosure (probably one made of aluminum due to the heat).  I could have pushed the Thermocouple terminal blocks out a little further to fit more launchpads, as I feel this is a bit tight.  I chose a Tiva-C LP for my pics because it fits nicely but the BoosterPack is designed with low-power features, contrary to the MAX31855's own design.

 

This BoosterPack features the Maxim MAX31855 thermocouple receiver chip; this is a precision IC with built-in ADC and digital logic which performs continuous conversions of the thermocouple data and exposes the latest data at the master MCU's demand over SPI.

 

As the MAX31855 never really "shuts down", I have introduced logic to allow the MCU to switch on/off the entire thermocouple (MAX31855) power domain, utilizing a TI TXB0108 Level Shifter as a bus transceiver to disconnect all the SPI and four Chip Select lines from the MAX31855's to prevent parasitic power from the I/O lines from clandestinely powering the chips when they're not needed.  TI TPS27081A positive-logic PFET power switches are used to switch the Thermocouple power domain on/off and for slew-rate control of the TXB0108's OE pin.  (I bought a bunch of these for cheap from avnet a couple years ago, figured I should use them!)

 

The BoosterPack features my own "remappable" design, where the 40-pins have breakout pads just inside the BoosterPack layout and each of the user-configurable circuit nets (TC power switch, TC#1, 2, 3, 4 SPI Chip Select) can have their default boosterpack pin assignments cut (cut solder-jumper) and a jumper wire soldered from the function's pad to a BoosterPack pad of choice.

 

While this doesn't use any standard connector for the thermocouples, I have found dismantling a standard connector and snipping the terminals down to suitable width allows one to shove them into the terminal block without having to splice the thermocouple's wires or insulation.  I'll post a pic of that later on when I get a setup going with my woodstove.

 

post-15991-0-64030700-1452313600_thumb.jpg

 

post-15991-0-44554200-1452313532_thumb.jpg

 

post-15991-0-34575900-1452313556_thumb.jpg

 

 

DipTrace Schematic (PDF): DipTrace_Schematic_-_Multi-Thermocouple-BPak.pdf

 

DipTrace EDA files (schematic, PCB layout): Multi-Thermocouple-BPak_draft1_0.zip

 

Elecrow 10x10 PCB Gerbers: Quad_Thermocouple_BoosterPack_v1_0_10x10.zip

 

I don't plan to sell any of these at the moment, but if anyone's got a burning desire to have one I might be willing to have my arm twisted to buy more BOM and build some :)

 

I haven't got a real thermocouple attached yet, but I was able to confirm that I can read what appears to be valid MAX31855 data from the one populated, including watching the "ambient temp" reading rise as I held my finger against the chip:

Quad Thermocouple BoosterPack Test #1
TC#1 Result: 7FFD16F1
(sleep 2sec)
TC#1 Result: 7FFD1701
(sleep 2sec)
TC#1 Result: 7FFD1701
(sleep 2sec)
TC#1 Result: 7FFD1701
(sleep 2sec)
TC#1 Result: 7FFD1811
(sleep 2sec)
TC#1 Result: 7FFD1A61
(sleep 2sec)
TC#1 Result: 7FFD1B51
(sleep 2sec)
TC#1 Result: 7FFD1BB1
(sleep 2sec)
TC#1 Result: 7FFD1BF1
(sleep 2sec)
TC#1 Result: 7FFD1C31
(sleep 2sec)
TC#1 Result: 7FFD1B71
(sleep 2sec)
TC#1 Result: 7FFD1A41
(sleep 2sec)
TC#1 Result: 7FFD19A1
(sleep 2sec)

Energia sketch:

#include <SPI.h>


static const int TC_POWER = 40;
static const int TC1_CS = 39;

void setup()
{
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("Quad Thermocouple BoosterPack Test #1");
  SPI.begin();
  SPI.setDataMode(SPI_MODE0);
  SPI.setClockDivider(SPI_CLOCK_DIV16);
  
  delay(2000);
  
  // Init TC#1 Chip Select high so it's not selected
  pinMode(TC1_CS, OUTPUT);
  digitalWrite(TC1_CS, HIGH);
  
  // Activate TC power domain
  pinMode(TC_POWER, OUTPUT);
  digitalWrite(TC_POWER, HIGH);
}

void loop()
{
  // put your main code here, to run repeatedly:
  int i = 0;
  uint32_t res = 0;
  uint32_t b = 0;
  
  // Wait 300ms for TC#1 to do a conversion
  delay(300);
  // Select TC#1 and read its 32-bit contents.
  digitalWrite(TC1_CS, LOW);
  for (i=0; i < 4; i++) {
    b = SPI.transfer(0);
    b <<= 8 * (3-i);
    res |= b;
  }
  digitalWrite(TC1_CS, HIGH);
  
  Serial.print("TC#1 Result: ");
  Serial.println(res, HEX);
  
  Serial.println("(sleep 2sec)");
  delay(2000);
}

Share this post


Link to post
Share on other sites

Wrote a whole entire library to support the boosterpack with a user-friendly C++ interface..... and after a couple hours of coding it, I put it down last night to sleep and tried it out first thing this morning, it worked perfectly!  Sorry to gloat, that's just one of those nice things when you realize you've grokked the software/firmware side of things so well you write a library perfectly on first try ;-)

(Ok, there was 1 compile bug but it was minor, was returning an integer error code when the return value for the method was an enum.)

 

Now on the other hand, the MAX31855 isn't that complicated...

 

Library - https://github.com/spirilis/QuadTC- implemented in C++ templates, the header has a single template argument "tc_count" so it only allocates enough buffers for the # of populated TC's it supports.  The code is in a ".tpp" file that is #include'd inside the header, so the template mechanism works right.  That's something I've never done before but it worked!

 

Sketch-

#include <SPI.h>
#define QUADTC_DEBUG 1
#include <QuadTC.h>

QuadTC<1> myTC;

void setup()
{
  // put your setup code here, to run once:
  Serial.begin(115200);
  SPI.begin();
  
  myTC.begin();
}

void loop()
{
  // put your main code here, to run repeatedly:
  
  myTC.start();
  delay(300);
  myTC.retrieve();
  myTC.stop();
  
  switch (myTC.getFault(1)) {
    case SHORT_VCC:
      Serial.print("Thermocouple fault: "); Serial.println("SHORT_VCC");
      break;
    case SHORT_GND:
      Serial.print("Thermocouple fault: "); Serial.println("SHORT_GND");
      break;
    case DISCONNECTED:
      Serial.print("Thermocouple fault: "); Serial.println("DISCONNECTED");
      break;
    default:
      // Read thermocouple and print to terminal
      Serial.print("Thermocouple temp: ");
      Serial.print(myTC.getThermocoupleFahrenheit(1)); Serial.println(" F");
      Serial.print("Cold-Junction temp: ");
      Serial.print(myTC.getAmbientFahrenheit(1)); Serial.println(" F");
  }
  
  delay(10000);
}

Pics:

post-15991-0-65108800-1452437971_thumb.jpg

 

post-15991-0-53494400-1452437980_thumb.jpg

 

The thermocouple featured has a bracket for securing it to a chimney / flue pipe.  Sourced from auber instruments - http://www.auberins.com/index.php?main_page=product_info&cPath=20_3&products_id=291- Odd though, mine is the 2" probe, but they don't offer it anymore, preferring the 4" probe so it's less influenced by the mounting site.  Don't think that'll be a big problem for me (a 4" probe would fit inside a 6" chimney flue pipe too).

 

I noticed auber instruments carries a panel-mount mini K thermocouple jack for reasonably cheap, that's nice.  Would also be cool if they carried the PCB solderable ones... Omega builds them but you need a minimum order of 100 or something.  TI uses them in their thermocouple boosterpack.

 

The essence of this QuadTC library is that it manages a positive-logic power domain switch along with SPI Chip Selects and interpretation of the data.  So it would work in a final project without the boosterpack, just gotta give it the correct pin#'s for the TC power switch and the SPI chip selects.

Share this post


Link to post
Share on other sites

Here we go... got it installed (no case though, just hanging loose and tapping off the extension cord currently used to power the blower fan in the back)-

 

Tiva-C LP + boosterpacks sitting upside down on the hearth behind the stove (it's cool back there, lots of airflow through that area with the stove's air intake in the bottom pedestal next to it)-

post-15991-0-97699300-1452476021_thumb.jpg

 

Installed in the chimney connector pipe-

post-15991-0-98888900-1452476030_thumb.jpg

 

Stove before lighting-

post-15991-0-71614700-1452476039_thumb.jpg

 

Stove after lighting just some newspaper and a firestarter-

post-15991-0-67486400-1452476047_thumb.jpg

 

This is not a significant load of fuel at all, so I wouldn't expect the fluepipe to get very hot.  I saw maybe 115F temps on the outside of the pipe using an IR thermometer, but it's fun seeing the "internal" temps now:

62
62
62
62
68
84
113
140
158
168
177
186
199
206
212
213
215
219
221
226
231
237
237
237
237
235
231
228
224
222
219
215
213
212
208
203
201
197
194
190
186
183
177
174
172
170
167
165
163
163
161
161
159
158
156
156
154
152
150
149
149
149
149
147
147
145
145
145
143
143
141
141
140
140
140
140
138
136
136
136
... all the way down to 66F in a very long tail

Samples are taken every 5 seconds.

 

Energia sketch, using QuadTC, Enrf24 and my Pkt library on top of Enrf24:

/* quadtc_woodstove - Report woodstove fluepipe temperatures via nRF24L01+
 * to the Base Station
 */
#include <SPI.h>
#include <Enrf24.h>
#include <Pkt.h>
#define QUADTC_DEBUG 1
#include <QuadTC.h>

#define TC_DEVICE_ID 8
const uint8_t nrf24_basestation_address[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x01 };
#define SAMPLE_INTERVAL_SECONDS 5

QuadTC<1> thermo;
Enrf24 radio(8, 9, 10);
Pkt pkt(&radio);

void setup() {
  Serial.begin(115200);
  SPI.begin();
  SPI.setClockDivider(SPI_CLOCK_DIV2);

  Serial.println("Woodstove fluepipe monitor - nRF24L01+ edition");

  radio.begin(250000, 10);
  radio.setTXpower(7);  // SI24R1 special +7dBm mode
  radio.setCRC(true, true);  // 16-bit CRC
  radio.deepsleep();
  pkt.begin();
  pkt.setModeTXonly(true);

  thermo.begin(); Serial.flush();
}

void loop() {
  // Obtain thermocouple data
  thermo.start();
  sleep(300);
  SPI.setClockDivider(SPI_CLOCK_DIV16);
  thermo.retrieve();
  thermo.stop(); Serial.flush();
  SPI.setClockDivider(SPI_CLOCK_DIV2);

  // Transmit information via nRF24L01+ using Pkt
  uint8_t tcpkt[6];
  int16_t temp;
  max31855_Fault flt;

  tcpkt[0] = TC_DEVICE_ID;  // Our device ID

  temp = thermo.getThermocoupleCelsius(1);
  tcpkt[1] = (uint16_t)temp & 0xFF;
  tcpkt[2] = (uint16_t)temp >> 8;

  temp = thermo.getAmbientCelsius(1);
  tcpkt[3] = (uint16_t)temp & 0xFF;
  tcpkt[4] = (uint16_t)temp >> 8;

  flt = thermo.getFault(1);
  switch (flt) {
    case SHORT_VCC:
      tcpkt[5] = 0x02;
      break;
    case SHORT_GND:
      tcpkt[5] = 0x03;
      break;
    case DISCONNECTED:
      tcpkt[5] = 0x01;
      break;
    default:
      tcpkt[5] = 0x00;
  }

  pkt.send(0x10, nrf24_basestation_address, 6, tcpkt);
  pkt.flush();
  Serial.flush();

  sleepSeconds(SAMPLE_INTERVAL_SECONDS);
}

Share this post


Link to post
Share on other sites

Fwiw, I've always heard on Hearth.com that the surface temp of a decent chimney connector is about 1/2 the actual internal temp as read by a probe thermometer or thermocouple.  That seems to be accurate here as I read 115F via IR thermometer at the same time the TC was reading 235F or so.

 

With a typical 20+ pound load of firewood burning with some criss-crossed kindling on top doing the top-down fire thing, the fluepipe can get into the upper 300's (fahrenheit) when hit with an IR thermometer.  Will be very excited to see what that reads from a thermocouple.

Share this post


Link to post
Share on other sites

Lit the stove tonight!  Interesting results... that flue vents a fair amount of heat even after the draft control has been "closed off" for the cruise.  Non-catalytic clean-burning woodstoves are like that from what I've heard, it's not that it's wasting tons of heat but that by its nature it gets more heat out of the wood with its upper firebox smoke-burning zone and it does have to waste some heat to keep the draft going strong enough to sustain that.  One of those things where you have to "spend heat" to "make heat"...

 

First off, the fire!

post-15991-0-18880000-1452555566_thumb.jpg

 

Second, graph of current results:

 

post-15991-0-25280500-1452555602_thumb.png

 

This goes on for hours with a long-tail drop in flue temp which should drop more dramatically when all the flames disappear and the wood is mostly just charcoal.  At that stage, the bulk of the heat comes out of the sides and front of the stove, not the stovetop and what air is wafting over the fluepipe.  Super large, heavy, custom masonry furnaces called "Masonry Heaters" do a better job of extracting all the gaseous heat (flame) by using an extra long, clay/masonry flue chamber that folds and goes all convoluted before exiting to the chimney... alas, this is just the metal box variety ;)

 

The "AAS", for those who are curious, is a special mechanism in this woodstove that lets you start your fire, set the draft control to your intended "cruise" setting for when the stove's fully up to temperature, then "latch" it so an inner passage opens up to fan the flames (as if you had the draft control fully open, which is what you are supposed to do when "starting" a woodstove).  It uses a bimetal spring and metal bracket to "de-latch" the draft control so it settles down to your manual setting once the stove is up to temp, but not before.  Really a cool feature although this is the first edition of the stove that has it, and there were a few.... glitches to work out.

 

It's an England's Stove Works Madison, BTW.  ESW is a steel woodstove manufacturer in Monroe, VA who sells through mass market vendors like Home Depot and Lowes.  I like 'em ... "good and cheap" sums it up.

Share this post


Link to post
Share on other sites

This is awesome, really nice work!

 

Now it would be interesting to see a few more temp sensors scattered around the house to see how they lag the furnace temp :)

 

 

Sent from my iPhone using Tapatalk

Share this post


Link to post
Share on other sites

I noticed auber instruments carries a panel-mount mini K thermocouple jack for reasonably cheap, that's nice.  Would also be cool if they carried the PCB solderable ones... Omega builds them but you need a minimum order of 100 or something.  TI uses them in their thermocouple boosterpack.

 

Yeah, had the same problem some time ago when I made my Quad-TC PCB.

 

post-31435-0-37999300-1452596616_thumb.jpg

 

Couldn't find any PCB solderable Type K jacks for a reasonable price in lower quantities. So I soldered the TC leads directly to the board. Anyway, it works without problems.

Unfortunately I didn't use hardware SPI, so I can not try your library right now :(  Will do so for my next revision (8 MAX31855, but as "classic" booster pack for the launchpad).

Share this post


Link to post
Share on other sites

The full burn from start to finish (well, it's still simmering but only a few coals left, just enough to keep the downstairs room where the stove is located warm, which incidentally is also the makeshift vestibule where folks put on their socks & shoes before going outside):

 

post-15991-0-72417700-1452608047_thumb.png

 

That overfire ticks me off because I should know better.  There's a compressed sawdust wood briquette product I use for my "endurance" fuel and it's dangerous to stack that stuff too high - it is super dense, burns very long, and up near the insulated ceramic baffles it'll burn uncontrolled since the secondary-combustion burn tubes have unlimited oxygen supply.  Typical light-density hardwood splits like poplar are OK up there because they're self-limiting - they shrink as they burn down and their coals don't last terribly long, but the wood briquettes swell as they burn (making the problem worse) and as I said, they are super dense, there's just a LOT of fuel there.  The inside of the burn tubes were glowing red and the whole baffle was glowing reddish-yellow in spots... The baffle can take it just fine, burn tubes (made of thick stainless steel) can take it too but will warp faster with that kind of usage (so instead of lasting 5-8 years, maybe a few less), but it's just more frightening than anything else.  Plus all the heat I wasted up the chimney!  Yargh.

 

Quick pic taken during that episode, this is with the draft control (which adjusts primary air only) fully closed to the hard stop:

post-15991-0-37028300-1452608278_thumb.jpg

 

The flames were so vigorous they were just shooting right into the glass and bouncing off.  Wish I had taken a video instead.  I have a lot of phrases for that situation, "gone nuclear" and "opened the gates of hell" come to mind ;-)

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...