Inspired-glass - techy stuff!
Using a Raspberry pi to remotely monitor kiln temperature.
As a long-time, self-confessed, electronics enthusiast / ham radio operator / software & systems 'techy' - I was interested in making my glass-fusing life more interesting by mixing software with kilns.
My kiln lives in an outside workshop, which means running out into the rain in order to see how a firing schedule is progressing. This can be annoying - especially if you're venting a kiln during firing (decals, say) and you need to know 'when' the kiln's up to 500c, so you can close the lid down.
My homebuilt kiln uses a second-hand Bartlett controller (which works well), but doesn't offer any facilities for remote monitoring. There are a number of commercial controllers around that are 'network-accessible' - but they tend to be expensive.
Having played with electronics since the 1960's, and worked with computers since the 1980's - it seemed that it shouldn't be too difficult to use a modern, low-cost, single-board computer to run temperature-monitoring (and, hopefully, eventually, kiln control via a user-friendly, screen-based interface).
So far <g> - the 'monitoring' part is working - and that's what I'm describing here.
The following info is presented for personal use by people who are technically competent. It involves working around things that have high voltage, and can reach high temperatures.
I can't accept any responsibility for anything that might or might not happen as a result of you following this information - so please don't blame me for anything! Thanks.
Project Outline - remote kiln temperature monitoring
The project consists of hardware and software.
I used a Raspberry Pi3 (= rpi) - simply because I wanted to learn about programming the rpi, and this model (currently the top of the range) has built-in wi-fi, and a fast processor. For the price, this is a startlingly effective little pc-on-a-board, can drive a conventional monitor, speakers, mouse & keyboard - and has an array of General Purpose Input Output (GPIO) connections that allow it to interact with switches, indicators and other digital signals. Neat! There are other, less expensive version of the rpi, which would probably work in this application - but I haven't tried them.
The rpi cannot 'talk' directly to a thermocouple - but needs an interface board - using a clever little integrated circuit called a MAX31855 - which measures the voltage from the thermocouple and sends a stream of data representing the temperature to the rpi.
The rpi3 is available, complete with a mini-sd-card containing the computer's operating system, and a mains-to-5-volt power supply for around €60 + VAT - or less. Various bundles are available.
The type k thermocouple came from ebay - should be well under €5 including postage.
The MAX31855 is available on a tiny ready-made circuit board, with connection pins for the wires to the rpi and screw terminals for the connections to the thermocouple. Various types are available - official Adafruit boards for €10 to €20 and 'Chinese copies' (which I used) for as little as €8 with free postage.
You'll also need wire or jumper leads (5 off) to connect the MAX31855 card to the rpi.
There's a far better description than I could write about how to set all this up on the Adafruit site - here.
The free downloadable software on this site also includes a simple Python program called 'simpletest.py' which you can run to confirm that your system is all working properly.
I set my system up to use 'Software SPI' - but the simpletest.py program shows how to set your system to use Hardware SPI if you'd rather - you will then need to change the appropriate parts of my program to suit.
You must follow the instructions on the Adafruit page in order to install the necessary libraries.
You also need to install the maths library (which includes the graph-drawing software) as per this link.
My little program ab-kiln-monitor-plot.py should be downloaded and placed in the /home/pi/Adafruit_Python_MAX31855/examples folder. You can download it here
When you run it - (in a terminal window, change to the /home/pi/Adafruit_Python_MAX31855/examples folder and type python3 ab-kilnmonitor.py) , you should find that the display in the terminal window shows
"Press Ctrl-C to quit. Sampling every 60 secs"
and the graph of time vs temperature should display in a new window.
Once you have this operating on the rpi's local screen, you can then set up the rpi's wi-fi connection, and log into the rpi using VNC - installing VNC Server on the Pi and VNC Viewer on your pc or phone etc. (default log-in=pi, password=raspberry). For more details on wi-fi setup on the rpi - plenty of references on Google.
Important note. I spent many long hours trying to get the RPi to run consistently over a wi-fi link.
In the end - changing my home wlan router to one with an external aerial and replacing the Pi's internal wifi aerial with a plug-in USB dongle, also with an external aerial made it all work reliabily.
It's a long story, and I won't bore you with it - but it seems that if the wifi is marginal, and drops out, when it re-establishes the router may allocate a new IP-address to the Pi, which means you can't find it or talk to it.... - so a strong wifi link (or, for that matter a wired connection) is the way forward.
The long-term plan is to use the rpi to actually _control_ the kiln, rather than just monitor it.
The people here (https://apollo.open-resource.org/mission:resources:picoreflow) have done something very similar with a project called 'picoreflow' - using a rpi to control a reflow oven (kind of a low-temperature kiln used in soldering electronic printed-circuit boards).
Their software should work with the same hardware setup as my program - and includes a similar real-time graph-drawing facility, and the ability to input firing schedules via a graphical interface.
It's not directly applicable to fused-glass work, as the schedule is defined by 'at time x, be at temperature y', rather then the more familiar 'ramp, temperature, hold' - but it's close enough to be interesting. If you want to input a glass fusing schedule then you can work out the parameters using a spreadsheet, calculator or even (old school!) squared paper.
Their software & project are open-source - so can be easily adapted.
They're also working on a more generalised project called 'governess' - which will be adaptable to different types of control - information about this is on their webpage.
My big homebuilt kiln... - 4ft x 2ft x 1ft
Currently controlled by a Bartlett controller, but monitored remotely by the setup described above.
Photo of the thermocouple interface board - it's tiny!
Thermocouple terminals on the right, digital connections to the Raspberry pi on the left.
Photo of Raspberry Pi connected to the thermocouple board and mounted on a piece of fibre-glass board.
5 volt power plug in top left-hand corner, wiring between Pi and thermocouple board at the top centre, thermocouple connections to the green terminals on the interface board.
Relay board is for future expansion, led on the prototyping board flashes when the monitor is running.
Screen-shot from Windows 10 computer, using VNC Viewer to 'see' the screen on the Raspberry Pi via wi-fi.
Graph shows a completed firing schedule, terminal window shows the per-minute display of temperature readings.
Any questions about this - please feel free to email me - email@example.com
I would just say that if it's detailed 'how do you...?'-type questions about the RaspberryPi, or the Python language that the little program is written in, then I'm a newcomer to the Pi and Python myself. Most of what's described here is drawn from the internet, over the past month or so... so I'm not your expert <g>.
But, if there's anything you'd like to know, or any comments you'd like to make, then I'll do my best to help.
I'll also be updating this page as & when I work on the 'controller' part of the project - so keep an eye on it.
Adrian Brentnall, March 2017 - updated September 2018
Thermocouples work on tiny voltages, and are very susceptible to interference from local mains switching (like your kiln's heating elements!). The thermocouple I used has a screening wire sleeve around the two wires - I connected this wire screen to a 0v pin on the rpi, and then connected the same point to mains earth on my kiln. This reduced interference somewhat.
Being a clever (possibly too clever!) little piece of electronics, the MAX31855 can return either a temperature reading, or flag one of three error conditions relating to the thermocouple. Initially, I was getting frequent (possibly spurious) errors from the MAX31855, so my software, if it gets an error from the hardware, simply ups the error count, and asks the MAX31855 to 'have another try'.
If there was a genuine, permanent error, then the software would simply loop, and you wouldn't see the graph update.... - in a 'control' situation rather than a simple 'monitoring' program you'd want to do something more intelligent in this situation.
As I said at the beginning - if you're capable of playing with this sort of stuff (high temperatures, mains voltage, etc.) then you're doing it at your own risk!
There's the potential (especially if you're 'controlling' rather than just 'monitoring') of burning the place down, should your kiln controller get 'confused' and go into 'heat forever' mode..
I think, when I get to the 'control' stage, I shall probably build a hardware-based 'safety' circuit, which is able to cut the power to the kiln in the event of over-temperature. I have a circuit for this - but haven't implemented it yet.