# Wood stove automation using the Raspberry Pi



## MisterFixIT (Jan 2, 2018)

Happy New Year!

It has been a couple of years since I started working on my wood stove automation project.   Its based on Python and currently runs on a Raspberry Pi3 Model B.   I got quite far but until now I never documented any part of what I did.    Took me about a week to take pictures and write up just the first phase.  I don't think Ill ever be done so I'll just post this before I get lost in trying to make the doc perfect.  Yes, it needs more pictures that I should be able to add soon.  Feel free to use any part of this project for your own builds.  I have learned a lot about thermocouples, analog signal digitizers, AC motor speed controllers, I2C databuses and how to drive LEDS off the Pi. 

Here is the GitHub URL for the project: 

https://github.com/yodagami/trainman

So far I have completed documenting phase1:  Reading stove and pipe temperatures with Raspberry Pi

https://github.com/yodagami/trainman/tree/master/trainman1

Next phase: Reading room temperature from a 1-wire server and temperature sensor.

Cheers!


----------



## Poindexter (Jan 2, 2018)

I look forward to reading your sketch tomorrow, getting late for me tonight.


----------



## jebatty (Jan 2, 2018)

Nice. Last winter I modified a Python program for my RPi to read, display, and log data from multiple DS18B20 temperature sensors. Haven't done it yet, but hopefully this winter I will add a program to turn devices on/off based on temperature readings.


----------



## EatenByLimestone (Jan 2, 2018)

Gonna have to show this to the wife.


----------



## velvetfoot (Jan 2, 2018)

Nice.  I'm jealous.  

I like the stuff about alinco magnets being resistant to heat.  I'm installing one of those Auber controllers to vary the fan speed, low or high, based on stove top temp.   Do you think the extra mass of the magnet would affect the thermocouple readings?  Cement will work on stove top, but not on side, I would think.

I'm not doing anything with the stack, but when I installed a thermocouple in the exhaust pipe of my VW TDI, it came with a hose clamp type of mount.  You drill the hole, put the thermocouple with a cone shaped end into the hole and strap in on with the clamp.  No threading required.  Haven't seen anything like that for stoves.  Not sure how they usually mount them.

I'd be interested in seeing how you control the air.

What I'd like to do also, if I had any talent, would be to replace the fan motor with an efficient and infinitely variable ecm motor and also have fine control of fan speed by your processor.


----------



## NoobTube (Jan 2, 2018)

Curious which Auber controllers you used and which thermocouple you used for stovetop? I'd love to have some good suggestions on which to look at. I've checked out Omega suppliers but some of their thermocouplers are so damn expensive.


----------



## jebatty (Jan 2, 2018)

K-type thermocouples work well in high temp environments, and many digital temperature controllers as well as digital temperature panel meters accept K-type sensors. I have one in the stack of my boiler which shuts down the draft fan if stack temp gets too high. Neither the sensors nor the controllers are very expensive. The bottom right sensor in the picture is the stack temp readout which uses a K-type probe. The temp controller is separate and also uses a K-type probe.


----------



## NoobTube (Jan 2, 2018)

Very cool, reminds me of my electric brewery where I use K-Type thermo probes. The problem I'm findnig is that most of the probes are non-surface mount, and the surface mount ones are pretty pricey.


----------



## MisterFixIT (Jan 2, 2018)

> Do you think the extra mass of the magnet would affect the thermocouple readings?

I don't think it will effect the reading very much.   Pics attached.  The thermocouple washer is directly contacting and flat to the top of the stove.   The magnet is on top of that and fairly small.   I was surpised to see how accurate the thermocouples were against shooting the surfaces with a Fluke IR reader.  Much better than the coil type thermometers you see in the pics.  

> Curious which Auber controllers you used and which thermocouple you used for stovetop? I'd love to have some good suggestions on which to look at. I've checked out Omega suppliers but some of their thermocouplers are so damn expensive.

I don't use the Auber controller.   I looked at them but they didn't have the flexibility and control I wanted.  I do use the Auber thermocouples and other parts.  They are just what I needed and I am so glad they sell them.   I use Adafruit P1778  thermocouple amps and a Adafruit P1085 analog to digital digitizer that is read by the Raspberry Pi3.   Parts list is in the trainman1 readme https://github.com/yodagami/trainman/blob/master/trainman1/README-trainman1.txt

T> he bottom right sensor in the picture is the stack temp readout which uses a K-type probe. The temp controller is separate and also uses a K-type probe.

Awesome!  Yes, the stove pipe surface thermocouple is a derivative of what is actually going on inside the stack.  A probe would be better but for now it gives me the burn rate data I will need for air control later.  Its been interesting to watch how the two temps progress through a burn.


----------



## illini81 (Jan 2, 2018)

Very cool.  Are you logging the temperature data, or just displaying it?  If you're logging it, lets see some temperature profiles!


----------



## velvetfoot (Jan 2, 2018)

NoobTube said:


> Curious which Auber controllers you used and which thermocouple you used for stovetop? I'd love to have some good suggestions on which to look at. I've checked out Omega suppliers but some of their thermocouplers are so damn expensive.


1 x 1/16 DIN PID Temperature Controller (For Relay) (SYL-2342)  = $46.50
1 x K type Thermocouple, Washer Probe (TC-K-WS)  = $13.95
    Sensor Cable Length Option 6 ft Cable with spade connector


----------



## MisterFixIT (Jan 2, 2018)

> Very cool. Are you logging the temperature data, or just displaying it? If you're logging it, lets see some temperature profiles!

Data is getting logged once per second to /var/tmp/trainman       I have /var/tmp mounted on RAM so it doesn't burn out the flash disk with the constant writes.   It does mean that the data goes poof when I reboot but I really don't care.    I need to go make a program to go grab the data off the Pi and graph it automatically.   Here is example log of phase#6 of this project from this mornings burn.   Yes, I know there is no date/time stamp on the data.  Im really lazy, so that part is missing as well, ha ha.

https://github.com/yodagami/trainman/blob/master/trainman6-log-20180102.txt

Right now in my phase#6 code the blower fan just uses the stove top temperature to set the fan speed.   As the stove heats up the fan speed goes up up up and as it cools down it decreases the fan speed till it turns it off.    Its a 9 speed fan (8 speeds + off).  Fan profile sets the agressiveness of the fan.   I tend to set an aggressive high fan profile when its really cold in the morning to blow the heat off the stove to get the room warmed up quickly.   Later on I will turn the fan profile down if I want it to be quieter.   I really like having the system micro-manage the fan speed for me while I macro-manage the fan profile depending on what I want.


----------



## velvetfoot (Jan 2, 2018)

MisterFixIT said:


> Right now in my phase#6 code the blower fan just uses the stove top temperature to set the fan speed. As the stove heats up the fan speed goes up up up and as it cools down it decreases the fan speed till it turns it off. Its a 9 speed fan (8 speeds + off). Fan profile sets the agressiveness of the fan. I tend to set an aggressive high fan profile when its really cold in the morning to blow the heat off the stove to get the room warmed up quickly. Later on I will turn the fan profile down if I want it to be quieter. I really like having the system micro-manage the fan speed for me while I macro-manage the fan profile depending on what I want.


Did it come with a 9 speed fan?  I'd be interested a few more details on the fan control, please.


----------



## NoobTube (Jan 2, 2018)

velvetfoot said:


> 1 x 1/16 DIN PID Temperature Controller (For Relay) (SYL-2342)  = $46.50
> 1 x K type Thermocouple, Washer Probe (TC-K-WS)  = $13.95
> Sensor Cable Length Option 6 ft Cable with spade connector



Thanks! I figure I'll run the Fan to a outlet that is controlled by the PID. I use that same PID for my brewing setup. I might have to read a little bit more into it. I'd love to be able to program the PID to control fan speed via PID Power settings e.g @ 300*F Fan power level = 50%, 450=70%, 600 = 90%, 750= 100%. Although I don't think you can program in that many variables.


----------



## velvetfoot (Jan 2, 2018)

NoobTube said:


> Thanks! I figure I'll run the Fan to a outlet that is controlled by the PID. I use that same PID for my brewing setup. I might have to read a little bit more into it. I'd love to be able to program the PID to control fan speed via PID Power settings e.g @ 300*F Fan power level = 50%, 450=70%, 600 = 90%, 750= 100%. Although I don't think you can program in that many variables.


No, not the one I got. It's relay only.  My stove already has a snap switch on it, and my PID will kick it into high speed.


----------



## yooper08 (Jan 2, 2018)

Nice!  Learned of Pi just last year.  I started thinking this fall, what if I could program my entire insert on a Pi machine....


----------



## MisterFixIT (Jan 2, 2018)

> Curious which Auber controllers you used and which thermocouple you used for stovetop? I'd love to have some good suggestions on which to look at. I've checked out Omega suppliers but some of their thermocouplers are so damn expensive.
1 x 1/16 DIN PID Temperature Controller (For Relay) (SYL-2342) = $46.50
1 x K type Thermocouple, Washer Probe (TC-K-WS) = $13.95
Sensor Cable Length Option 6 ft Cable with spade connector

I use the same Washer Probe model as velvetfoot except I got the ones with the mini-connector and the female mount connector
https://www.auberins.com/index.php?main_page=product_info&cPath=61_62&products_id=426

I plan to make a box for it someday and just have the thermocouples plug into the female mount connectors.


----------



## MisterFixIT (Jan 2, 2018)

> Did it come with a 9 speed fan? I'd be interested a few more details on the fan control, please.

Ummm, not really.   My PE classic came with a blower fan with an on off switch on it along with a knob on the side to control the fan speed.  Knowing nothing about AC fan speed control I thought I would just find a potentiometer that I could hack to make the various speeds I wanted.    Instead I found that it had a whole circuit board that I had to figure out.  I ended up buying an exact duplicate of the speed controller that the blower came with and then proceeded to remove the pot from the board and wire in a SainSmart 4 solid state relay.   One relay does 120VAC on/off.   The others provide the 8 different (2 to the power of 3) resistances required by the fan controller to get the 8 different on speeds.

I also left the existing manual speed control intact and replaced the On/Off switch on the side with a 3-position so now it does Manual-Off-Auto.    I like options .


----------



## MisterFixIT (Jan 7, 2018)

TRAINMAN2

Phase II of this project has been posted to github: https://github.com/yodagami/trainman/tree/master/trainman2

Instead of doing the acquisition of temperature off a 1-wire thermometer I decided to add the LED displays for the 2nd phase.  

The README describing the hardware build and how to get it runnig is at https://github.com/yodagami/trainman/blob/master/trainman2/README-trainman2.txt

Please excuse the poor pictures when the LEDs are turned on.   Digital cameras have a difficult time taking good shots of the displays when lit up.  When viewed in real life they are stunningly bright and colorful.   I can easily read them 20-25 feet away.

For this phase I ended up simplifiying the display board wiring.  The entire board runs off the 5 volt pins of the Pi3 but the voltage is immediately stepped down to 3.3 volts using a Buck Converter to drive the displays.   https://www.adafruit.com/product/2745

 On the PiHat board I I take a shortcut and just reuse the 4 pins on the and of the ADC header.   I soldered a 4 pin terminal block right next to the ADC headers GND,5V,SCL,SDA pins, saving space and 4 extra wires.   I should probably rework this board so the ADC header is at the opposite end.  I don't like how long the SCL,SDA wires are.  Oh well, that's for a future date.

The pictures show a 6 display setup using the full sized perma-proto board.  https://www.adafruit.com/product/1606
The wiring is fairly modular so it would be easy to make a 2, 3 or 4 display setup by removing wires and components and maybe downsizing to a half or quarter size perma-proto board.   There are a maximum of 8 I2C addresses for the displays so that is the upper limit for this product.

https://www.adafruit.com/product/1911
https://www.adafruit.com/product/2158
https://www.adafruit.com/product/2160
https://www.adafruit.com/product/1912
https://www.adafruit.com/product/2157
https://www.adafruit.com/product/2159

The trainman2.py code is pretty simple to understand.  The thermocouples are read and then just displayed on the AlphaNumeric LEDs in a loop.   

Brightness can be altered and balanced between the displays inside the python code.  I really don't like the Blue display.  I find it impossible to read from across the room so its usefulness is limited.  Yellow-Green is dim.   White is distracting and harsh to have running as a display all the time.   I use two of each of  Red/Yellow/Green for my 6 display setup.   For a 4 LED display  I would probably use Yellow-Green as the 4th color.   Most of the time I run the system with the lowest brightness profile and its easy to compensate for the dimness of Yellow-Green by boosting up just that one color in the brightnessprofile array.


----------



## MisterFixIT (Jan 14, 2018)

TRAINMAN3

Phase III of this project is adding in Automatic Fan Speed control.  

WARNING: Attempting this will void your blower fan warranty, obliterate its UL listing and is electrically dangerous because it involves modifications to wires that carry 120 Volts AC.   If you don't know how safely deal with 120VAC just don't do it.  Remember to unplug the blower fan and keep it unplugged while messing around with an open blower fan.  Using GFI outlet while messing around with it is a very good idea.

Being able to have the system automatically turn on and vary the blower fan has been really great.  I don't have to stop what I am doing and turn on the fan when the stove gets up to temperature.    If it gets really hot the the blower will go on full speed and let me know that the air control might need to be quenched off a bit.    When the burn is done, the speed is slowed down and then turned off.  I'm not wasting power running a fan that has been forgotten about.   I'm not blowing air off a cold stove creating a draft in the room.  Minimal power, Minimal noise, Minimal fuss.

My stove is a Pacific Energy Classic.  The blower is nice and quiet on moderate speed, they cost about 300$.    There is a simple On/Off switch on the side with the speed control potentiometer and the stove comes with a snap switch that doesn't do what I want when I want.    Im not a EE so I haven't studied anything remotely close to a variable speed AC fan controller so when I busted open the blower in the back I was surprised to find this ...

Speed Control KB Electronics Model KBMS-13BV
http://www.kb-controls.com/product.sc?productId=158

Inside the plastic box is a small circuit board which has a bunch of compoenents soldered onto it as well as the and the large speed control potentiomter with a small trim speed potentiometer.   

At first I thought I was done ... there is no easy way to automatically vary the fan speed.   After a bit of reasearch I discovered that the circuit board is a DIAC/TRIAC (Thyristor) circuit and they have been around for quite some time.   Instead of the potentiometer reducing the voltage to the fan motor, browning it out (which would be bad), the Thyristor chops the AC waveform so peak voltages are maintained but the time that the motor sees voltage is reduced.

Basically, the fan speed is controlled by the triggering of the TRIAC.   The potentiometer varies the resistance that controls the triggering.   Higher resistance slows the fan.   Lower resistance speeds up the fan.

Awesome!  Wanting to do more experimentation but not wanting to wreck what I have, I bought a replacement speed control and using a soldering iron and solder vacumm I removed both the big potentiometer and the small blue trim pot and in thier place attached red+orange lead wires.   I could then (with a great deal of care) play around with various resistors and vary the speed of the fan.   

That's great but how does one automatically vary the resistance via a Raspberry Pi?    It might be possible to integrate a digital potentiometer into the circuit but I would still have to deal with turning the fan on/off, so instead I chose a 4 channel solid state relay board for this purpose.

https://www.sainsmart.com/products/4-channel-5v-solid-state-relay-module

This board is nice because it is optically isolated 5Volt active high which is perfect for integrating 120VAC with the Pi.  Also the current capacity of the solid state relay (0.1 to 2 AMP) will handle the limited amperage of the blower fan.   So I used one relay to turn the fan on/off and the other 3 to vary the resistances to the speed controller.

Which resistances to use?  

Simple answer.  
- Figure out the resitance of the slowest desired fan speed (For me it was about 90K Ohms).
- Select 3 available resistors that add up to this resistance that are roughly multiples of 1x,2x,4x (For me these ended up being 12K,27K,47K).  When wired in series the resistances are additive: 12K + 27K + 47K = 86KOhms

Once that is figured out, 3 sainsmart relays are used to individually short out these 3 separate resistors.  When a resistor is shorted its resitance is removed from the series.  Using various combinations of On/Off for the relays allows for 8 different resistance and 8 different fan speeds when the on/off relay is triggered on.    Its easier to figure this out looking at the following table.   The first relay simply turns the 120 VAC power to the motor on/off.   Remember! don't stick your fingers in it when plugged in.  ZAP!

FanSpeed Relay    Resistances     Total  Speed
=====================================================
  0      0,0,0,0  Blower Motor Off              Off
  1      1,0,0,0  12K + 27K + 47K  = 86K  Slowest
  2      1,1,0,0   0K + 27K + 47K  = 74K    ^
  3      1,0,1,0  12K +  0K + 47K  = 59K    |
  4      1,1,1,0   0K +  0K + 47K  = 47K     |
  5      1,0,0,1  12K + 27K +  0K  = 39K    |
  6      1,1,0,1   0K + 27K +  0K  = 27K     |
  7      1,0,1,1  12K +  0K +  0K  = 12K    V
  8      1,1,1,1   0  +  0K +  0K  =  0K    Maximum

I was kind of stunned to see it actually work in the end.  I cleaned up the install by replacing the 2 way On/Of switch with a 3 way switch that turns the fan Manual/Off/Auto.   
The wiring is basically:   120VAC Hot/BlackWire ---> Switch ---> Speed Control ----> Fan Motor ----> 120VAC Neutral/WhiteWire.   
The Manual versus Auto setting selects which speed control is active.  (Manual for the original Speed Controller, Auto goes to the Sainsmart+Hacked Speed Controller).

4 GPIO pins on the Pi control the SainSmart relay board.  I feed it 5VDC as well as GND so it uses a 6 wire harness to connect to a 6 pin terminal block on the trainman perma proto board.   

I should have the trainman3.py code posted up soon.  

https://github.com/yodagami/trainman/tree/master/trainman3


----------



## allan5oh (Jan 14, 2018)

Very interesting project!  Wouldn't it be better with DC motors and PWM?  Or maybe I'm a bit biased.  I've done a lot of PWM stuff on DC motors.

I was thinking of doing a similar project with a blaze king.  Since the stove has a built in thermostat, you should be able to set it and forget it.  The house temperature controller would vary the speed of the fans on the stove.  If they sped up, the thermostat on the stove should compensate for the BTUs removed and open the damper slightly.  If the fans are running too much, just turn up the thermostat on the stove.  If they're too slow turn it down.

Still trying to find a programmable thermostat capable of customizable PID parameters and PWM output.

If done right the temperature of the house should be rock stable, programmable, and you would use less wood.


----------



## MisterFixIT (Jan 14, 2018)

Yeah DC Fans have alot of advantages.  I think they are quieter and if the power goes out you can run them on a car battery alot easier.

Truth be told, im lazy.   I just hacked the AC fan motor speed controller because that's what the stove came with.   Everything appears like unmodified stock PE stove until you look under the hood.

I have started to work with the PWM pins on the Raspberry Pi.   I think one of them in BCM pin #18.   Downside is that its only 3.3VDC with limited amperage.  Maybe a solid state relay would switch fast enough to be able to translate the PWM square wave into 12volts for fans???  Haven't PWM'd anything high current so I don't know .... yet! 

I like the programability of the Pi but that's just my bias doing a bunch of Python programming on them and the expansion modules you can get for them.  I also like the eMMC memory that you can get with the ODROID, much better for small monitors that collect data when the memory chip doesn't wear out.
http://www.hardkernel.com/main/products/prdt_info.php?g_code=G145457216438

Next up is the 1-wire room temperature sensor, buttons for controlling the program and Stepper Motor for controlling the air supply lever in bottom front.

If the blaze king has room on the stove thermostat shaft for a timing pully gear  or something similar...

https://www.adafruit.com/product/1253

... having stove thermostat controlled by room temperator sensor and stepper motor would be the ultimate.   Then you could set the fan to whatever you want.  High for quick heat, low for a quiet room.   Gets pretty close to a pellet stove with thermostat at that point.


----------



## MisterFixIT (Jan 15, 2018)

trainman3.py has been posted to GITHUB along with the README and some pics of the reworked board (before and after I added the fan+button teriminal blocks).

https://github.com/yodagami/trainman/tree/master/trainman3

I really like the way the blue and purple wires are shortened up a bunch on the reworked board.   They would otherwise in the way when wiring up the fan and button terminal blocks.   

The code include fan profiles and the handling of a button to control which fan profile is active.   The fan speed controller has an anti-flap mechanism built into it.   This is good because when a fan is ramped up both the stove and pipe temperatures dip slightly with the greater air flow.  Same deal on the way back down.   The temps will spike slightly  with less airflow.   The anti-flap mechanism ignores these small dips and spikes.  Without it the fan speed would ramp up/down repeatedly when transitioning through a temperature threshold, which would be quite annoying.   

    # Increase or Decrease fan speed depending on stovetop temperature
    fanprofile=fanprofiles[fanpro]
    maxfan=len(fanprofile)-1

    if fanspeed < maxfan and stovetemp >= fanprofile[fanspeed+1]:
        fanspeed += 1
        print 'Increasing Fan To',fanspeed
        set_fan_speed(fanspeed)
    elif fanspeed > 0 and stovetemp <= fanprofile[fanspeed-1]:
        fanspeed -= 1
        print 'Decreasing Fan To',fanspeed
        set_fan_speed(fanspeed)


----------



## allan5oh (Jan 16, 2018)

http://www.instructables.com/id/Temperature-Control-With-Arduino-and-PWM-Fans/


https://www.google.ca/url?q=http://...6D-8QFggLMAA&usg=AOvVaw3gkfK0YeywMJeIPYCGiXcJ

Here's a couple links with good info. Sounds like they are controlled with a 25khz 8ma max pwm signal on the control wire. The 4 wire pwm fans already have relay circuit built in. You can also run those specific fans in the top link off of one pwm circuit.


----------



## MisterFixIT (Jan 17, 2018)

Thanks for the links!  That's great info and advise.... just use PWM fans with the control already built into them.   

Ill have to do this for my Heat N Glo gas fireplace.   The AC fan it comes with is horrendiously noisy compared to my PE wood stove fan and its maybe a 1/4 the BTU.    I don't need the powerful airflow for the fireplace and I end up hardly ever using it due to the noise with the fan and the lack of immediate heat getting into the room without the fan.    Again, like the original wood stove ... it comes with a stupid snap switch to turn the fan on/off.   Blah.

Ill have to make a PWM version of the code, should be easy.


----------



## allan5oh (Jan 17, 2018)

I love the idea of the stepper motor controlling the blaze king thermostat. Now you've completely screwed up my plans!

Still getting rid of line level voltage would be nice. I have a few group 31 batteries kicking around too. Choices choices


----------



## MisterFixIT (Jan 17, 2018)

Starts getting into mechanical engineering with the steppers.   YAY! Another thing I am not good at! 

At least there are boards and programming libraries that make the coding part easy on Pi and Arduino.

https://www.adafruit.com/?q=stepper

I plan on using the NEMA-17 size motor to move the Pacific Energy air contoll lever in front.   I need to also use a couple of limit switches so the system knows when the air control lever has hit limit on each side.

For the Blaze King you probably will not need nearly such a beefy motor to twiddle the air control.  

Not sure if a servo motor would work better than a stepper ...

https://www.lifewire.com/stepper-motor-vs-servo-motors-selecting-a-motor-818841

It would be helpful to have a way of knowing the controls position.

https://en.wikipedia.org/wiki/Rotary_encoder


----------



## MisterFixIT (Jan 19, 2018)

trainman4 has been posted to GITHUB.   It adds in accurate room temperature acquistion and display on the LED.  

https://github.com/yodagami/trainman/tree/master/trainman4

Several years back before I added in the room temperature display I would often catch myself adding in a bunch of wood when the room was already at 77F.    Ooops!  Now a quick glance off to the Green LED Room Temperature display and I know how much wood I should add to make it through the evening.   I put the sensor right next to the recliner chairs, im hoping that relates accurately to how the room feels when sitting in them.

Well that pretty much documents and wraps up the current status of this project.   I need to get working on a button box for menu control and of course the automation of the air control.  That will take me a while.   Hope I can get it going before the end of the burning season.

.... more random thoughts on automating the BlazeKing and other stoves with stove thermostat control ...

1) A servo will probably not work.  Need accurate control and that means stepper motor not servo.

2) See if a timing pully such as ... https://www.adafruit.com/product/1253 can replace the plastic knob on the stove thermostat.
Use a small Timing pully on the stepper motor https://www.adafruit.com/product/1251
With a timing belt between the two this will allow the greatest number of steps and the greatest degree of control and/or
Allow the motor to be away from the thermostat shaft because ....

3) Will need a way to mount the motor inline with the thermostat on the stove.

4) A direct gearing system or just connecting the stepper shaft to the thermostat control might work but there needs to be a way to mount that motor.  The stepper I have has 200 single steps per revolution which is probably enough not counting INTERLEAVE mode.

5) There may need to be limit control on the timing pully mounted to the thermostat shaft.    Maybe drilling a hole in the side of the pulley, tapping it for a long screw and then making a plate with a couple of limit switches so you can detect when the thermostat is all the way min/max. 

6) The limiter solution also has to be mounted next to the thermostat shaft.

7) Might be possible to forgo the limiter solution if you trust the stepper counting and/or it doesn't destroy the interlink system (belt/gear/motor/shaft) when it tries to blow past the counter-clockwise and clockwise limits on the stove thermostat.   Smaller stepper motor might be better so it doesn't break stuff.

8) If it works then you will really be looking at a highly accurate way of measuring room temperature method similar to trainman4.  Then you will be able to nail a comfortable room temperature by having the system micro-manage room temp via micro-movements of the stove thermostat ... waaayyyyyy better than a human would ever want to do.   This is what computers are good for, doing the boring stuff.


----------



## MisterFixIT (Apr 17, 2018)

TRAINMAN5

There has been a good cold snap here.  Enough to test out the automated air control for the Pacific Energy Classic wood stove. 
So .... what can I say about this.   Hmmm....   IT'S REALLY FREAKING COOL!

At first I thought it wouldn't work or it would be a novelty but now its just so awesome to be able to throw wood in the stove, light it up and the system just takes care of burning what I put in there.   I don't have to worry about over-firing the stove or getting too many coals because I forgot to open up the air control at the end of the burn.   I find I am putting more thought into how much wood should I chuck in by looking at inside temps, outside temps and how long I want the room warmed up rather than messing around with the air control lever all the time trying to get a good burn.   The SO acceptance factor is huge.  She loves the little minion Pi robot that takes care of the stove.  It's hillarious.

The wild thing is that I haven't even really started getting into optimizing the code.    All I did was simply figure out how many steps (airsteps=468)  from max air to min air and then based on min (pipemin=225F) and max (pipemax=500F) pipe temperatures set the air control using a linear formula.   Dead simple.    Its not optimal but I was amazed how it works pretty good for such simple logic.

https://github.com/yodagami/trainman/tree/master/trainman5

Yeah, so software needs some work but lets talk about hardware which is almost done.   Adafruit makes a stepper motor hat for the Pi.  This goes under the trainman board.  I use stacking headers with the long pins on the motor hat so its easy to make it all work together.  Pi on bottom, stepper motor hat in middle and trainman board on top.

First the good news.   The PE super stoves have this awesome air control lever that on min air setting can crash the burn even if I stuff the box full of junipetrol kindling sticks in a wind storm.  Even better is the long travel on the lever between max air and min air allowing for more fine grained control than a lot of non-cat stoves.  The air control lever operates smoothly, making automation fairly easy to accomplish.

The challenges:
a) The air control lever hinges on a pin so its motion is actually semi-circular instead of linear.
b) How to control air lever without drilling or permanently modifying the air control lever
c) Attaching the air control to the stove without drilling or permanently modifying the stove.

Solution:  Open builds V-Slot rail and Mini-Gantry to the rescue

Here is the basic hardware list:
#   1xAdafruit #324 Stepper motor - NEMA-17 size - 200 steps/rev, 12V 350mA
#   1xAdafruit 12VDC power supply
#   1xAdafruit #2348 DC & Stepper Motor Hat for Raspberry Pi - Mini Kit
#   1xAdafruit #1184 Timing Belt GT2 Profile - 2mm pitch - 6mm wide 1164mm long
#   1xUltibots #N17D NEMA 17 Damper - Astrosyn MY17RMDAMP
#   1xOpenbuilds GT2-2M Timing Pulley - 30 Tooth
#   1xOpenbuilds V-Slot 20x20 Linear Rail
#   1xOpenbuilds Mini V Gantry Set
#   1xOpenbuilds Motor Mount Plate for NEMA 17 Stepper Motor
#   1xOpenbuilds Idler Pully Plate
#   1xOpenbuilds Smooth Idler Pulley Kit

Why this is cool:   The stepper motor, pully, vslot rail, belts and gantry allow the translation of the semi-circular motion of the air control into a straight linear motion.  All I did was to use longer bolts and some spacers on the mini-gantry and the lever is pushed left and right between these two spacers.   Easy.

NEMA 17 Damper makes things alot more quiet than hard spacers on the motor.  I use the MICROSTEP motor operation call rather than SINGLE or DOUBLE for even more quiet motor operation.

Attaching the rail to the stove:  I made a couple of spacer brackets out of 1-1/2x1-1/2 aluminum channel and just reused the holes (in the stove) and bolts that hold the Ash Pan in place to attach the V-Slot linear rail at the right distance and height to operate the air lever.   Once that is done the timing belt is tie strapped to the gantry and the belt snugged up by adjusting the positon of the the idler pully plate on the rail.    The channel works better than square tube.  Its still fairly strong but lets you get tools in the right places to attach the spacer brackets to the stove.   Yeah, the ashpan still fits over top.  It wedges in place betwen the alumium channel spacers and the stove.

So how does this work?  The trainmain5.py code makes calls to the Pi stepper library based on temps read by the thermocouples.  Pi stepper motor hat powers the stepper motor and controls its steps clockwise or counter-clockwise.  The rotation of the timing pully on the motor shaft with its teeth pushes/pulls the notched timing belt.  The timing belt loop moves the mini-gantry linearly along the v-slot linear rail.  The spacer pegs on the mini-gantry top plate engage the wood stoves air control lever moving it left and right.  No drilling or permanent modification of the stove air control lever is required.

Other parts and other thoughts:
- Limit switches:  You can get switches that mount onto the rail that can detect min/max positions.  I have them but have not implemented this yet.  The hardware doesn't seem to get harmed if I blow past the min max of the air control.  The motor will just "skip" instead of breaking the motor, timing belt or other components.   Maybe I don't need them.   Maybe they would be cool to have.

- NEMA 17 heat sink and thermal tape.  Ultibots sells these along with the motor damper.  Inexpensive so I just slapped one on my motor.  Easy.  Maybe it will help with motor longevity.  I haven't seen mine fail yet even after burning an entire season without the heat sink.

- DPST motor switch.  I want a way to allow manual motor override similar idea to my 3 position switch for fan control that allows manual operator override of the fan speed in case something goes wrong.  A simple double pole switch for the 2 coils on the stepper motor seems the easiest way to allow for manual operator override of the air control  Right now the stepper motor pretty much locks the air control into place.  Its pretty strong.  Breaking the coil circuits from the motor hat to the stepper motor should free up the lever enough for manual air control override.

- So that's it for now.  I have a lot of work to do on the air control code.  This has got to be the best and most fun part of the entire project.  Cheers!


----------



## maverick06 (Nov 14, 2018)

I am moving down this route too... I do not intend to control the stove with it, but want to be able to see the temperature from my phone and a display next to the stove. The display is easy, for me, a dumb mechanical engineer, but the web server reporting and graphing temp is much harder. I just ordered enough to get me going... Probably relying heaving on your code! Very excited! 

FWIW, my stove is controlled with a pull rod that has a stroke of about 3"... I looked into controlling it using a linear actuator. That would be the right actuator for my stove, but would be a problem when you didnt want it automated. more to follow... now to figure out hot to use a raspberry pi... read a thermocouple... and remotely monitor it...


----------



## begreen (Nov 14, 2018)

I want my stove to cook me some raspberry pie. Yum.


----------



## MisterFixIT (Nov 15, 2018)

maverick06 said:


> I am moving down this route too... I do not intend to control the stove with it, but want to be able to see the temperature from my phone and a display next to the stove. The display is easy, for me, a dumb mechanical engineer, but the web server reporting and graphing temp is much harder. I just ordered enough to get me going... Probably relying heaving on your code! Very excited!
> 
> FWIW, my stove is controlled with a pull rod that has a stroke of about 3"... I looked into controlling it using a linear actuator. That would be the right actuator for my stove, but would be a problem when you didnt want it automated. more to follow... now to figure out hot to use a raspberry pi... read a thermocouple... and remotely monitor it...



I started out with simple goals and simple dreams and next thing I knew there was all kind of stuff added to this project.  Part of me thinks I went overboard ... but then I had the pulley system off the stove for maintenance when the cold weather hit.  I sure missed not having to move the air lever at the right time and quickly put it back on and fired up the Pi.   Runs great!

Trainman6:  I still have more work to do on the air control logic.   I want to add a stove thermostat that factors in the current room temperature so the air controller will try to target a stove top temperature.   Example:   Its 65F in the morning and I want the air modulated to target a stove top temp of 650F so the room heats up quickly.  As the stove heats the room up the stove top target gets gradually reduced to 400F at a room temp of 72F.    Also like to have a way to set thermostat profiles much like I have for the automatic fan speed controller part of the program.   Then I can set a more/less aggressive heat production profile as needed.

The mechanical aspects of this project were the most challenging.  I've never messed with robotic/stepper motor anything before.   I could probably add in some kind of remote monitoring/graphing and if I did I would just write a python plugin and add it to my Nagios server that monitors everything else around the place.  I don't really recommend Nagios for beginners.  I would not call it a light weight monitoring package and It has quite the learning curve.   Right now if I want to know whats going on remotely I just ssh onto the Pi and tail the log file that I have writing into RAM so it doesn't burn out the SD card ...

tail -1000f /var/tmp/trainman

  Its crude but i'm lazy    I like the idea of using a phone app or just make a web server on the Pi with a page that displays the temperatures.   A real-time auto-updating graph of stove temp, pipe temp and fan speed would be great!   Software buttons that do what the hardware buttons do right now would also be useful. 

I tried to document the code as much as I could so it could be understood and reused.  Feel free to use/modify/hack anything in it you want and have fun!


----------



## MisterFixIT (Dec 1, 2018)

Howdy!

I have been working more on the code to control the air lever.   Previously the system just looked at the pipe temperature and set the air control 100% for 225F (pipemin) and lower,   0% for 500F (pipemax) and higher.  For temperatures in between these two set points it reduces the air in a straight line fashion.   e.g.  362F = 50% air.

The logic is easy to calculate and works great on stove startup.   In order to get an efficient burn and keep the heat from just going up the chimney a gradual reduction of air based on pipe temperature is perfect to get the secondary burn going without snuffing out the primary burn by choking off the air too soon or over-firing the pipe by not being aggressive enough quenching the air.  

However in the latter parts of the burn, when the stove is heated up, this pipetemp-controls-air-logic provides too much air.  Not only can the stove go up to 700F the secondary burn is not as robust as I would like.   The stove has too much air to optimize the secondaries and too much heat is going up the chimney.

Non-solution:  I tried regulating the air to try to fly the stove temperature to hit a certain temperature.  Basically if Temp too low->increase air, Temp too high->decrease air.  This logic wasn't stable at all.  The stove would go from 0% to 100% to 0% to 100%  There was too much momentum in the stove temperature once it starts heading up or down.

Simple Solution: Calculate air control based on stove top temperature the same way air is calculated on pipe temperature.   According to my magnetic stove top thermometer 400F (stovemin) is a good minimum temperature at 650F (stovemax) is a good maximum temperature.   So in the same manner as pipe temperature the air setting is calculated for stove temperature.  Super simple linear relationship between stove min temp (100% air) and stove max temp (0% air).     Much more stable than trying to force the stove to hit a particular temperature. 

But now there are two air settings.   One determined by pipe temperature and another determined by stove temperature.  The code simply picks the lowest air setting of the two calculated air settings and uses that to set the position of the air control.

So what this means is after ignition the pipe temperature rockets ahead of the stove temperature.  As soon as the pipe gets over 225F (pipemin) the air control is regulated by pipe temperature.   As the stove catches up and surpasses the pipe temperature the air control is regulated by the stove temperature.   Eventually the stove cools off below 400F (stovemin) and the air control is set to 100% as the stove cools off.   Full air helps burn off coals at the end of a burn.

The stove has 3 basic "states":
1) 100% air on startup and cool down.
2) 99%-0% air regulated by pipe temperature. (PIPE)
3) 99%-0% air regulated by stove temperature. (STOVE)

For fun I broke down the 100% air state into multiple sub states:  
Logically they don't do anything.  They are just for fun.
a) COOL
b) IGNT  (ignition recently started)
c) BURN (heating up but not yet at PIPE regulation state)
d) HOT (coming down from STOVE regulation state but stove is still heating up the room)
e) WARM (Probably not doing much for heat but I could probably restart the stove easily if I wanted)

More fun:  I made a crude graph of a typical burn as it progresses through these various "states".    Pipe temperature is on the X axis and Stove temperature on the Y axis.  Time is shown at various points along the line with the arrows on it (10M=10minutes, 2H=2hours). 
I like how the stove temp meanders around 600F for most of the active burn. 

So far this logic works really well.   Now I just build a fire, light it and shut the door.   The systems runs the air control and fan speed all the way from start to finish with a nice efficient burn.

Improvements:  I will probably vary the stovemax value to obtain more control over the macro burn rate.   Not sure if I will incorporate room temperature.

Cheers!


----------



## begreen (Dec 1, 2018)

I like what you are discovering, but I am not in favor of it opening up the air 100% on cool down. That would shorten the burntime and be an unnecessary waste of fuel for our Alderlea. An algorithm that recognized the difference between a cool stove on startup vs one that is cooling down would be preferable for our stove.


----------



## Ryan723 (Dec 1, 2018)

Wow. Nice work!! 

That temp-temp plot is a really neat way to see what it’s doing! 

Have you datalogged the stovetop and stack temperatures and plotted against %air? 

It would be cool to see how it actually reacts to air changes. And might help tune it a bit more if you needed to. 

I’d really like to see how a time vs temperature plot looks and compare it to what my BK Ashford does with the mechanical t-stat air control.  

Here’s a recent ‘low and long’  burn for me.


----------



## MisterFixIT (Dec 2, 2018)

> not in favor of it opening up the air 100% on cool down

Its possible to just leave the air control mid way during cool down to room temp and promote the coal formation.     Looking at the graph (It was a 3 split small size load) the air control only was set to 100% when stove cooled off to 400F and pipe was 175F.   By that time there were no flames at all.  Just glowing coals.   

Stovemin (400F) only comes into play on cool down so that could be adjusted downward if need be.

On startup (pipe temp > stove temp).   Cool down (stove temp > pipe temp).  So its possible to write logic based on that.


----------



## begreen (Dec 2, 2018)

Yes, agreed. This logic would help, particularly in PE stoves that have the secondary air supply control  coupled to the primary.


----------



## jetsam (Dec 2, 2018)

allan5oh said:


> I love the idea of the stepper motor controlling the blaze king thermostat. Now you've completely screwed up my plans!
> 
> Still getting rid of line level voltage would be nice. I have a few group 31 batteries kicking around too. Choices choices



With the BK, you would want to sit down and decide how you want the logic to work.  You are going to introduce oscillation and constant adjustment if your logic is "if the stovetop is below X turn up the thermostat".  The logic for thermostat adjustment should be pretty hands-off.  (Also, the stove already does what the OP was trying to achieve in the first place.)

One cool application would be to run the thermostat and the fan based on room temp, though. That would be a neat upgrade, though you would want to be able to set a max adjustment range for those cold days when you know you will be gone for 24 hours and don't want the fuel to be gone in 12.

This is a great project. I have a stack of pis of various generations at home. (Only one doing actual work at the moment, but they keep coming in handy for this and that over the years.)


----------



## MisterFixIT (Dec 2, 2018)

> Have you datalogged the stovetop and stack temperatures and plotted against %air? 

The air control % setting is kinda/sorta/hidden on the graph.  Look at the vertical dashed lines for the PIPE state or the horizontal dashed lines for the STOVE state.   100%, 75% 50%, 25%, 0% Air. 

The air control lever gets set every 30 seconds so pretty much can tell what the air was set to at any particular point.  

 I think Its a weird looking graph.  I would normally just plot time (T) on the X axis like yours with the various (F) temp values on Y axis, but I wanted to show:

1)  The relation of the stove temp versus pipe temp through a burn.
2)  How that difference can let you identify if a stove is heating up or cooling down
3)  How the program modulates Pipe temperature on startup.  Pipe temp reacts relatively quickly to air control.  You can see how it bounces off the Pipe=415F temperature at about 9 minutes when the air control gets shut down to about 35%.  
4) The transition from PIPE to STOVE regulation state at 12 minutes, 40% air Pipe=380F Stove=540F.  
5) After the STOVE regulation takes over the air gets quenched back even more, living between 20%-12%.  Secondaries are going off like crazy and the stove does not smoulder or over-fire.  Was only a small 3 split load so secondaries only burned for about an hour.
6) I get too many clinkers left over if I just leave the air shut off on cool down so the STOVE regulation works well to open that back up to 100% when the flames are gone.

Next up are air profiles that allow modification of the StoveMax parameter.   I think I will have some FIXED profiles like 550F, 600F, 650F, 700F as well as ones that key off the room temperature.  Aka AUTO that peel back the StoveMax as the room heats up  (e.g. Room 65F->StoveMax=700F, 68F->650F, 71F->600F, 74F->550F).   Then I can play around with what works with various scenarios.


----------



## Ryan723 (Dec 2, 2018)

Great stuff.

I’ve been thinking about keying my fan according to room temperature. Basically let the stove’s t-stat do it’s thing to maintain stove top (well, back in the case of the BK) temperature. And peel off extra heat with the fan for the room as needed.

Have you looked into PID control for your airflow? Dont know if you’re seeing much overshoot, but from my smoker controller and home brew days, a tuned PID routine might really help overshoot which in this application  might really help efficiency and extending burn time.

The RPi should have plenty of extra horsepower to handle a PID routine and there should be some readily available libraries for it.


----------



## MisterFixIT (Dec 2, 2018)

Fan control was one of the first things I put in (see pics on first post of this thread).   The PE classic came with an AC variable speed fan so I just used that instead of going the DC route but DC powered PWM fans would make a nice quiet truly variable fan solution.   

For now, the AC blower fan that came with it is nice and powerful.   My relay box lets me have 8 different fan speeds + off.    I currently have 9 fan profiles that ramp up and down the fan speed based on stove temp.    I find with the automatic air control if I want a lot of heat I can just up the fan profile and that will blow the heat off the stove.   The system will then tend to increase the air control due to the lower stove top temp and thus increase the burn rate.  

 I still I want to have another adjustment that lets me macro control the air like the fan profile lets me macro control the fan.   Sometimes I just don't want to have increased fan noise so in that case I would just bump up the air profile.    That has been my goal all along.   Macro control of the system by the human and let the program micro manage the air control and fan speed.   A scheme that lets the air control adapt to room temperature would be nice.   Then I wouldn't have to fiddle with the macro air control as the room heats up.   The system would automatically peel back the burn rate in an already warm room.

I have not looked at PID code for fan or the air but its a very interesting idea.   

https://www.csimn.com/CSI_pages/PIDforDummies.html


----------



## ValleyCottageSplitter (Dec 2, 2018)

jetsam said:


> With the BK, you would want to sit down and decide how you want the logic to work.  You are going to introduce oscillation and constant adjustment if your logic is "if the stovetop is below X turn up the thermostat".  The logic for thermostat adjustment should be pretty hands-off.  (Also, the stove already does what the OP was trying to achieve in the first place.)
> 
> One cool application would be to run the thermostat and the fan based on room temp, though. That would be a neat upgrade, though you would want to be able to set a max adjustment range for those cold days when you know you will be gone for 24 hours and don't want the fuel to be gone in 12.
> 
> This is a great project. I have a stack of pis of various generations at home. (Only one doing actual work at the moment, but they keep coming in handy for this and that over the years.)



This is definitely a cool project. I had the exact same idea for my BK as well.  Just to feed room temperature info back to the airflow control to get a fully closed loop system. Some ideas to create a "stable" system are to either have a long update period or you can used some more advanced control techniques that model and/or predict how the stove will behave at various conditions. Not sure what the raspberry PI is capable of. I do control system engineering for work so it would be interesting to be able to play with some of it at home.


----------



## jetsam (Dec 2, 2018)

ValleyCottageSplitter said:


> This is definitely a cool project. I had the exact same idea for my BK as well.  Just to feed room temperature info back to the airflow control to get a fully closed loop system. Some ideas to create a "stable" system are to either have a long update period or you can used some more advanced control techniques that model and/or predict how the stove will behave at various conditions. Not sure what the raspberry PI is capable of. I do control system engineering for work so it would be interesting to be able to play with some of it at home.



The pi is just a little ARM sbc.  Most of them out there run Linux, and the pi foundation builds a debian branch specifically for their hardware, so you are not having to compile every package and update in a dev environment (or worse yet, natively on the pi.. I heatsinked and overclocked one of my first ones, and it still took hours to build ffmpeg).

The new revision is MUCH faster than the original ones. You could use it for a (slow) desktop PC in a pinch.  Without getting into compiling the entire environment, you can run a bunch of linux distros, plus FreeBSD and Android.  Stick with Raspbian unless you have strong feelings about Debian.


----------



## MisterFixIT (Dec 2, 2018)

Changes to LED display.  Pictures attached.
This is what the alphanumeric 6 x quad LED display means now
   Top Red=Stove Temp
   Top Yellow=Pipe Temp
   Top Green=Room Temp (yeah, still missing that decimal dot).
   Bottom Red=Stove Max
   Bottom Yellow=State
   Bottom Green=Fan Profile + Fan Speed. (example: F6P3 = FanSpeed 6, Fan Profile 3)

For the PIPE and STOVE states the last two characters show air percentage from 99% down to 00% percent.   

examples in pictures: 
    PI94 = Pipe regulation, Air is set to 94%
    ST29 = Stove regulation, Air is set to 29%


----------



## MisterFixIT (Dec 3, 2018)

Best thing about Raspberry Pi is all the add-on stuff you can get for it.

Used this to make my own "hat" for this project....

https://www.adafruit.com/product/2310

Need a motor controller?  Easy ....

https://www.adafruit.com/product/2348

Crazy amount of stuff you can get for it.   Ive used the LED matrix controller and GPS for other ideas I had.

https://www.adafruit.com/category/405

Also have a bunch of Arduino projects but I like the Python/Pi on Raspbian development platform better, just personal preference.

Big downside on Pi that they haven't improved is the reliability of the SD/Micro SD chip.   This is why I write the log to RAM instead of disk.

The ODroid https://www.hardkernel.com/ can use EMMC memory but even then its not as robust as an actual SSD.   For any I/O intensive project I would rather use an Intel NUC.


----------



## Ryan723 (Dec 3, 2018)

MisterFixIT said:


> Big downside on Pi that they haven't improved is the reliability of the SD/Micro SD chip.   This is why I write the log to RAM instead of disk.



If you have the Pi networked, log one of every X measurements to an IOT platform. I’ve been using IO.adafruit and it is surprisingly good. They’ll archive a month of data for free. And it’ll be there after a device power cycle unlike the RAM disk. I’m sure there’s a python library....the arduino one is super easy to incorporate into a project. 

Added benefit is you can view data and dashboards from anywhere. The plotting and ‘gauges’ are surprisingly good!


----------



## MisterFixIT (Dec 3, 2018)

> I’ve been using IO.adafruit and it is surprisingly good. 

That's very true!  I soldered together the mightyohm geiger counter with the Adafruit OLED feather mod.   Fed the data to IO.adafruit.   Super simple and fun!

https://blog.adafruit.com/2016/02/0...adafruit-feather-huzzah-iotuesday-adafruitio/


----------



## MisterFixIT (Dec 12, 2018)

Trainman6 has been posted to github....

https://github.com/yodagami/trainman/tree/master/trainman6

This version is all code enhancements to Trainman5

1) Added stove regulation in addition to pipe regulation for the air supply control lever.  This allows for a more efficient burn than just relying on pipe temperature.
2) Moved stuff around on the LED displays and added stove state (lower yellow LED).  
example: PI55 = pipe regulation air set to 55%, ST08 = stove regulation air set to 8%
3) Air profiles give macro level of air control while allowing either a fixed stovemax or one that is dynamic based on room temperature.    Automatic profiles reduce stovemax gradually as room warms up extending burn times and keeping room from being overheated.
Current stovemax and profile letter displayed on lower red LED.  example: Profile H with a calculated stovemax=593F would be shown as 593H 
4) Air control is batched up so its not constantly moving every second.   Program now updates the air control once per minute or immediately if it is out of whack by 5% or more.
5) Better code organization.   A bunch of code in the main loop made into function calls.

Attached a couple of crude diagrams with air profiles and an updated pipe versus stove graph.  

NEXT UP:
- Wall bracket for LED display, Pi, Motorhat and Thermocouple ports
- Rotary Encoder or Switches to allow easier control over air and fan profiles.
- Manual override/kill switch for stepper motor.
- Limit switches for stepper motor operation.


----------



## maverick06 (Dec 16, 2018)

Well I am working on the raspberry pi... as a mechanical engineer programming isnt coming natural to me. C++ is ok, python is harder... Troubleshooting now.... thermocouple readings are off....think the ADS8495 is bad)

BUT for about $10 I already have a decent readout.
https://www.ebay.com/itm/76-999-K-type-Thermocouple-Dual-thermometer-display-digital-LED-temperature/263798081879?ssPageName=STRK:MEBIDX:IT&_trksid=p2057872.m2749.l2649

If you want a readout in C vice F you can do it for a little cheaper.(but i dont think in C)

and this is the probe:
https://www.ebay.com/itm/9mm-x-5mm-Probe-Ring-K-Type-Thermocouple-Temperature-Sensor-2M-6-6Ft-X8F2/173299505924?ssPageName=STRK:MEBIDX:IT&_trksid=p2057872.m2749.l2649

Some scrap wood and here is the result, very temporary for now. Room in the box for the pi whenever i get that running...

Image is a bit fuzzy...


----------



## MisterFixIT (Dec 16, 2018)

That's an awesome ebay find!  Perfect for someone wanting something inexpensive and all they need is a display of a K thermocouple probe.  People have been asking about something like this in other threads.

Had a heck of a time starting out trying to get the thermocouple amp to work.   Started out with the MAX31850K 1-wire version and one other one.  They work fine when reading air temperature but don't work at all when I attached them to the stove.   I really need one that could read a grounded thermocouple so I could directly attach it to the stove.   Started reading up on a lot of docs about thermocouples.

 Turns out the AD8495 does support a grounded thermocouple.  Its the only one I found that does.   One caveat:  Make sure the Pi is grounded to the stove.    If I don't then the voltages bounce all over the place and temps read too low.   A simple wire with clips on both ends solves this for me.   One clip attaches to the USB port on the pi,  the other one of the stainless braids on the thermocouple probes.    Bang on compared to a Fluke IR gun and rock solid stable.

DVM should tell if the amp is working or not.    I have blown up chips before,  I think I smoked one of the ADC digitizers early on.    This caused me to not solder on the little breakout boards.     I just use 0.1" female headers, cut them to size and solder those onto my permaproto hat board.  Now all the little boards just plug into them like sockets.  

Same deal with the LED arrays.  I think I smoked one of the backpacks for those as well.


----------



## begreen (Dec 17, 2018)

maverick06 said:


> Well I am working on the raspberry pi... as a mechanical engineer programming isnt coming natural to me. C++ is ok, python is harder... Troubleshooting now.... thermocouple readings are off....think the ADS8495 is bad)
> 
> BUT for about $10 I already have a decent readout.
> https://www.ebay.com/itm/76-999-K-type-Thermocouple-Dual-thermometer-display-digital-LED-temperature/263798081879?ssPageName=STRK:MEBIDX:IT&_trksid=p2057872.m2749.l2649
> ...


That's awesome and looks great for an insert. If it had a settable alarm function it would be perfect.


----------



## maverick06 (Dec 17, 2018)

I think thats commercially available for cheap. something like this. $15. 
https://www.ebay.com/itm/110V-240V-...=item5d6f0a92af:g:N4AAAOSwydpa8q56:rk:14:pf:0

That has a PID controller in it, no idea how that would actually be implemented on a stove... but I guess you could just ignore it and have it monitor the thermocouple and act as an alarm. 

I am still looking for remote monitoring, so thats not for me. Even my current setup is only a quick setup until i get around to getting remote monitoring.... 2 little kids and a job sure slows that down.


----------



## Papa Porsche (Jan 13, 2019)

Just joined the forum and this is my first post. I just built a damper control with the Raspberry Pi and have it ported to my computer and cell phone. Still building the blog for the how-to guide, but here's a teaser video with link to my blog... 

This is for a small fireplace insert that I burn nearly continuous during the winter. Interested in any comments that the forum might have. Link to blog: https://smartstove.blogspot.com/

Thanks,
Scott


----------



## begreen (Jan 13, 2019)

Welcome. Thanks for sharing. This is great stuff.


----------



## maverick06 (Jan 14, 2019)

Thats great, first project with a linear actuator i have seen so far, i like that. I have managed to get my raspberry pi to output air temperature to a web server. I havent been able to get it to read a thermocouple... Even usint the sample sketches for the chips dont work. Literally been wasting months on this. As best as I can figure out, I have managed to buy 3 MAX31855 which are faulty.... if they are wired right and cant work the sample sketches..... its got to be right... 

I havent rules out the common denominator (me) yet....


----------



## Papa Porsche (Jan 14, 2019)

Hahaha, Maverick that's the same thing I told my son - it would have taken me weeks. He looked at my code for a few minutes and figured it out. If you could post your code somewhere, he or I will take a look. Or you could use the MAX6675 like I did (for $7). Either way, the serial input on the Pi or any other device is not all that straightforward.


----------

