Yes, I know. An odd start to a blog post.
I used to have a log burning stove. It was great, it had a back boiler to heat water for the house and provide wood fired central heating. You could put a pot of stew on the top of it and magically have dinner ready. You could cook scones on top of it, straight on the baking tray and watch them like a hungry cat.
I had the tail end of a reel of neopixels left over from various projects, just three little pixels, and I was thinking of making them the “fire” in a little box frame I picked up for £2 from Hobbycraft. The pixels had electrical tape on them where they’d been hastily stuck to some test rig or other, and the contacts were, quite frankly, clumped up with crap worse than a set of false eyelashes. This meant they were going to have to be hidden.
I was noodling around with a bag of sensors I picked up from the cheap and cheerful stall of ABX Labs, and looking at the odd ones that I hadn’t managed to incorporate into a project yet. Lighting up some pixels is kind of standard and not hugely interesting, so I wanted the “log burner” to fire up when it detected *something*.
Temperature sensor – it’s cold, fire lights. Light sensor – it gets dark, fire lights. Tactile button… let’s not even go there.
Both legitimate solutions, but it’s not in the spirit of things, is it? This is where I grabbed the more unusual sensors (yeah, the ones I didn’t recognise) and I started looking at sales photos on ebay to identify them. Turns out I had a FLAME SENSOR. Yeah, baby. It’s totally logical to me now.
Make a fireplace that lights when you light it.
I used a micro:bit because I wanted the project to be easy to copy, even for those who don’t write standard code.
The sensor detects a flame, or it doesn’t. You can adjust the sensitivity by using a screwdriver on the onboard potentiometer, turn it left (anticlockwise) to make it less sensitive, right (clockwise) to make it more sensitive. Try it out by connecting it like this:
Once you’ve figured out how close you want the flame to be, leave the potentiometer as it is. It will now be in one of two states – flame, or no flame. You can use this as a digital signal like a keypress to trigger an event using the microbit. Just make note of which pin you connect the data pin to, and use the “on pin (whatever) pressed… ” block.
Wire up your neopixels and sensor like this.
The code I used has a HUGE nod to Phil Burgess’ jack o lantern code for the Adafruit Circuit Playground, because it’s essentially a random flicker generator, and I didn’t want to reinvent the wheel. I just modified it to use the strip connected to the micro:bit instead of the onboard Circuit Playground lights (p.s. I bloody love the Circuit Playground but it wouldn’t fit in the frame).
Now, you can keep this randomly flickering all of the pixels at the same time, or you can create a thread for each pixel to flicker individually.
Here’s the simple version:
All that remained was to give the frame some little legs (cardboard painted black) and a few log burner fittings (more cardboard painted black), and now I have a log burner you can actually light.
Of course, this is an utterly useless project as per usual, but at least I have a shrine to my aspiration of living off-grid again.
DISCLAIMER: If you use a flame sensor and you are daft or misfortunate enough to set yourself/others/your belongings on fire, then you need to think about whether you should really be allowed Nice Things. Fire is a dangerous thing and you should only play with it if you’re responsible.