Inspiration for the project came from this thread: Automating wood stove with Pi. I was sick of having to get up and check the temperature of the stove with my thermal IR gun and wanted to be able to monitor the stove while I was away from it. Hardware and software specifics can be found at the bottom of this post.
Unlike the linked post I wanted to take a deep dive into python. I'm using a raspberry pi, a temp/humidty sensor, and a couple of thermocouples to capture the temperature of the flue, stove top, and room temperature (and humidity). I save the data to a database and then I use an extension of flask (dash) that all but eliminates the need to create .html and .css files for your web application to pull the data from the DB and display it on a webpage on my local network. As long as your on my local network you can reach the page by opening a browser and to http://<hostname>:<port>. Hostname is the raspberry pi's local IP address and the port can be anything you want, although it's easier if you pick a non-privileged port (above 1023). You'll see this:
Data is captured every 5 seconds, and the app updates every 5 seconds. I'm displaying 12 hours of data on the graph because anything more than they is hard to see when looking on my phone. The table at the top shows the most recent data as well as the rate of increase over the last minute for each measurement. I'm using plotly.express to display the graph so it's interactive. You can zoom in, and save the graph as an image if you want. If any of the measurements go over a certain limit I've defined the cells that hold that measurement get highlighted in red until the measurement decreases past the limit.
Similarly, when the measurements go above the limit the datalogger sends me an email. I was going to text my phone like the other thread, but I found that there was a chance my carrier (T-Mobile) would flag the text as spam and either delay delivering the text or not deliver it at all. I have a gmail address I only use for this purpose. I send the email to this address from itself and have setup my phone/gmail account so that if an email comes in (from this email address) I get a notification (sound) even if my phone is in Do Not Disturb mode. Any other emails do not kick off a notification. This email gets sent every 5 minutes until the measurements go below their limits. I build the contents of the email as I check each limit so an example the email would be:
I look for overall temperature, as well as rate of increase (took that idea from the other thread). So I know if I'm too hot, and if I'm on a path to being too hot. I haven't actually used the stove yet this year as we're having a warm streak right now (southern NH), but it looks like I'll start burning next week.
The Flue monitoring location is closer than 18" (probably ~11"), but it's as far away as I could put it with my stove setup. I may need to swap out the magnet that I'm using to keep the Stove Top monitoring thermocouple in contact with the stove. I don't know if the one I found will be able to withstand the temperatures from a magnetism stand point. I had to use a PCB breadboard to breakout some of the GPIO pins of the raspberry pi because the sensors share various pins. The thermocouples have fiberglass insulation that should be stable up to ~750 F. The cable doesn't actually touch the stove top except in the back and that part of the stove never gets above 500F.
STT Thermocouple Location
Flue Thermocouple Location
Wired PCB
Hardware:
Interpreter: Python 3.9
Dependencies: Dash, plotly, sqlite3, pandas, dash_mantine_components, Adafruit_DHT, time, board, digitalio, adafruit_max31856, datetime, smtplib, MIMEText, MIMEMultipart
Folder structure:
| code
/dataLogger.py
/watchDog.py
/emailAlert.py
/environment.db
-settings(table)
-woodstove(table)
-emailalert(table)
/dashWebApp.py
Future Updates:
Since I don't have any actual data I assume that I'll need to adjust my limits for alerts. I may also add additional sensors throughout the house to see how well (or poorly) the heat gets distributed. From there I may add in some logic/code to turn on box fans to better distribute the heat based on temperature.
Anyway, it was a fun project and I won't have to stress about the stove when I'm not around it. My WIFI covers a good portion of my property so I can actively check in via the app, and when I'm out of range or away from the house I'll get notifications if some goes awry.
Unlike the linked post I wanted to take a deep dive into python. I'm using a raspberry pi, a temp/humidty sensor, and a couple of thermocouples to capture the temperature of the flue, stove top, and room temperature (and humidity). I save the data to a database and then I use an extension of flask (dash) that all but eliminates the need to create .html and .css files for your web application to pull the data from the DB and display it on a webpage on my local network. As long as your on my local network you can reach the page by opening a browser and to http://<hostname>:<port>. Hostname is the raspberry pi's local IP address and the port can be anything you want, although it's easier if you pick a non-privileged port (above 1023). You'll see this:
Data is captured every 5 seconds, and the app updates every 5 seconds. I'm displaying 12 hours of data on the graph because anything more than they is hard to see when looking on my phone. The table at the top shows the most recent data as well as the rate of increase over the last minute for each measurement. I'm using plotly.express to display the graph so it's interactive. You can zoom in, and save the graph as an image if you want. If any of the measurements go over a certain limit I've defined the cells that hold that measurement get highlighted in red until the measurement decreases past the limit.
Similarly, when the measurements go above the limit the datalogger sends me an email. I was going to text my phone like the other thread, but I found that there was a chance my carrier (T-Mobile) would flag the text as spam and either delay delivering the text or not deliver it at all. I have a gmail address I only use for this purpose. I send the email to this address from itself and have setup my phone/gmail account so that if an email comes in (from this email address) I get a notification (sound) even if my phone is in Do Not Disturb mode. Any other emails do not kick off a notification. This email gets sent every 5 minutes until the measurements go below their limits. I build the contents of the email as I check each limit so an example the email would be:
High Flue Temperature: 460
High Flue Rate of Temperature Increase: 75
High Stove Temperature: 710
High Stove Rate of Temperature Increase: 100
High Flue Rate of Temperature Increase: 75
High Stove Temperature: 710
High Stove Rate of Temperature Increase: 100
I look for overall temperature, as well as rate of increase (took that idea from the other thread). So I know if I'm too hot, and if I'm on a path to being too hot. I haven't actually used the stove yet this year as we're having a warm streak right now (southern NH), but it looks like I'll start burning next week.
The Flue monitoring location is closer than 18" (probably ~11"), but it's as far away as I could put it with my stove setup. I may need to swap out the magnet that I'm using to keep the Stove Top monitoring thermocouple in contact with the stove. I don't know if the one I found will be able to withstand the temperatures from a magnetism stand point. I had to use a PCB breadboard to breakout some of the GPIO pins of the raspberry pi because the sensors share various pins. The thermocouples have fiberglass insulation that should be stable up to ~750 F. The cable doesn't actually touch the stove top except in the back and that part of the stove never gets above 500F.
STT Thermocouple Location
Flue Thermocouple Location
Wired PCB
Hardware:
- Raspberry Pi4 Model B 8GB - running rasbian 64bit
- (2) Adafruit Max31856 Thermocouple amplifier boards - Max31856
- (2) K-Type Thermocouples with fiber-glass insulation - k-type (5pk)
- (2) Ring terminals with no insulation - Ring terminals (50 pk)
- (1) #8 self tapping screw - #8 screws
- (1) DHT11 temperature/humidity sensor - DHT11
- PCB Breadboard
- Assorted wire, shrink tubing, etc
Interpreter: Python 3.9
Dependencies: Dash, plotly, sqlite3, pandas, dash_mantine_components, Adafruit_DHT, time, board, digitalio, adafruit_max31856, datetime, smtplib, MIMEText, MIMEMultipart
Folder structure:
| code
/dataLogger.py
/watchDog.py
/emailAlert.py
/environment.db
-settings(table)
-woodstove(table)
-emailalert(table)
/dashWebApp.py
Future Updates:
Since I don't have any actual data I assume that I'll need to adjust my limits for alerts. I may also add additional sensors throughout the house to see how well (or poorly) the heat gets distributed. From there I may add in some logic/code to turn on box fans to better distribute the heat based on temperature.
Anyway, it was a fun project and I won't have to stress about the stove when I'm not around it. My WIFI covers a good portion of my property so I can actively check in via the app, and when I'm out of range or away from the house I'll get notifications if some goes awry.