Gas Burner Controller

I am a homebrewer, making all grain extract beer.

I am in the process of automating my brewery, which I am doing just for the fun of it, as automation is not really needed on a process that takes 5 hours and has about ten minutes of actual work!

My brewing rig uses a propane burner to heat water for mashing (soaking grains in hot water) and boiling the wort (the liquid extracted from the grain).

To automate the process, I needed to be able to start and stop the gas burner under program control. It needed to be safe as well, considering there is gas involved.

I decided to make a stand alone contoller with only one purpose in life: start and stop the burner safely and turn the gas off if there is no flame. Also, it should not start up or let gas escape if an external signal is disconnected or power is lost.

I will be making a Brewery Controller that will attach to this burner controller via the Command input to turn the burner on and off.

If you desire to control the temperature that is influenced by the burner controlled by this burner controller, you could buy an off the shelf PID contoller and attach the output of thr PID to the command input of this controller.

Example PID Controller.

If the link is stale just search for PID on Ebay.

The controller is based on the Arduino Uno (I used a Sparkfun Redboard which is equivalent). A switch can turn the burner on locally, or it can be turned on remotely via a single TTL active low signal on its Command Input.

The controller shows its status via 3 leds for Off, Lighting and On states. A TTL Status line indicates on/off status for remote use by the brewery controller.

The controller works off a 12Vdc input. This powers the Arduino which produces its own +5Vdc. The 12V is used to power the gas solenoid valve.

A cable from my Brewery Controller will provide 12Vdc, GND, Command signal and receive the status signal. 4 wires.

Parts List

(1) Arduino Uno or equivalent
(2) arduino compatible relay modules
(1) single pole switch
(3) leds
(3) 330 ohm 1/4 watt resistors
(1) arduino compatible buzzer module
(1) project box
(1) 12Vdc solenoid valve suitable for propane gas and fittings.
1/4" hose barb fittings X 2 to fit your valves
& hose clamps X2
(1) aftermarket BBQ igniter (modified)
Cables, connectors, wire etc


Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Controller Assembly

I used a small plastic waterproof project box. Waterproof since it is used around water in the brewery. Any openings in the box are on the bottom so any water spilled on the controller will not get in.

For ease of assembly, I assemble the parts on the shallower top of the box and use it as the control/display as well. The rest of the box can be mounted where you need it. If you need to do some work on the circuitry, you can simply remove the front panel and take it to the "laboratory"

Cut access holes for cables. Drill holes for leds, switch and cables.

Mount the Arduino, relay modules and leds. I just use a few dabs of epoxy to mount the parts. It's a little permanent and makes it difficult to replace parts, but it is "easy peasy"!

Wire the project according to the diagram provided.

Make your solenoid, sensor and igniter cables the right length for your application.

Step 2: Igniter

I bought an igniter module on Ebay for $10.

The module runs on 3Vdc. Has a switch input to connect to the burner controllers relay.

It also has an led that lights up when it's sparking.

The outputs are high voltage 12KV and will spark over a 1/4" gap to ground.

WATCH OUT! This sucker will zap you if you are not careful.

I used two aaa batteries to power the unit.

Step 3: Adding the Igniter Electrode

Got an electrode from an old replacement bbq starter.

In order to ignite the gas, the electrode needs to be positioned so as to spark in an air/gas mixture. This is accomplished by making a small "tent" out of sheet metal to capture the gas and positioning the electrode within the "tent"

I cut the electrode to the right length wit wire cutters, being careful to hold the keeper part with vise grips on the metal part so as not to damage the ceramic insulator.

The ground output of the igniter is attached to the "tent".

Step 4: Gas Solenoid Valve Installation

Install the hose barbs in your solenoid valve using teflon tape to seal the threads.

Cut the hose from the gas regulator near the burner. Install the valve using stainless hose clamps.

NOTE: make sure you install the valve with the flow arrow in the gas flow direction (see photo).

Attach the hose to your burner and the regulator to the tank.

Turn on the gas and check for leaks using dish soap & water solution. Fix any leaks befor proceding!

If no leakes, energise the solenoid valve and check for gas flow.

Your done this step.

Step 5: Flame Sensor

I used a flame sensor that measures infra red light levels. has them for $3.11 with free shipping if you're willing to wait 3 weeks to get it.

It has a sensitivity adjustment that you can use to set the flame level that it considers "lit"

It requires 5Vdc, GND and has an output signal indicating presence of flame.

I made an L-shaped bracket with a hole to "see" the flame and another hole to allow adjusting the sensitivity pot on the board. The board is mounted on a standoff. I had to cover the back and sides of the sensor led to keep ambient light out.

The bracket provides shelter from the burner heat so the sensor does not melt!

Step 6: Software

The software for this project was created using the Arduino Integrated Development Environment (IDE) and atmel Studio(not required)

Go here to get the IDE. Go to the download tab.

A finite state machine model was used in order to provide clarity neccessary to ensure no bugs that could result in unsafe operation

To learn a little about finite state machines see the following

The state machine library for Arduino is here.

There are only four states the controller can be in. Off, Lighting, On and Alarm. These states and triggers for transitions between states are described in the diagram.

You can get your own free copy of my arduino code at.


Burn It! Contest

Participated in the
Burn It! Contest

Guerilla Design Contest

Participated in the
Guerilla Design Contest

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    18 Discussions


    Tip 1 year ago

    Hi All,

    For the FSM I used v2

    2.0 2013-02-08: LINK: Versions fixed for Arduino 1.0x Terry King

    I was able to get it to compile using IDE versions:
    IDE 1.05 R2
    IDE 1.6.5 R5

    NOTE 1 The download link provided for the FSM defaults to v1.7 (See history for v2 link) I could not get this compile with any IDE version.
    NOTE 2 The hosting for FSM v2 is closing September 30th, 2018 at 23.59 GMT.
    v2 Download Link (while it still works):

    I fear the last of my parts will not arrive in time for me to complete the build prior to the Sept 30th deadline for FSM v2 hosting


    1 year ago

    Hi all,

    Hopefully there are still people here watching this page!

    I've just got most of the bits I need but having a hell of a time trying to get the Uno to talk to or at least have the firmware uploaded to it.
    If I use the latest Arduino software (v1.8*) I get an error when verifying or compiling:

    Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"

    C:\Users\hunt.moorhouse\Downloads\FSM_1-7\FSM\StandaloneBurner\StandaloneBurner.ino:1:32: fatal error: FiniteStateMachine.h: No such file or directory

    #include <FiniteStateMachine.h>


    compilation terminated.

    exit status 1

    Error compiling for board Arduino/Genuino Uno.

    When using an older version of the Arduino software (v1.5*) I get the below:

    In file included from FiniteStateMachine.cpp:30:

    FiniteStateMachine.h:69: error: 'boolean' does not name a type

    FiniteStateMachine.cpp: In member function 'FiniteStateMachine& FiniteStateMachine::transitionTo(State&)':

    FiniteStateMachine.cpp:92: error: 'millis' was not declared in this scope

    FiniteStateMachine.cpp: In member function 'FiniteStateMachine& FiniteStateMachine::immediateTransitionTo(State&)':

    FiniteStateMachine.cpp:100: error: 'millis' was not declared in this scope

    FiniteStateMachine.cpp: At global scope:

    FiniteStateMachine.cpp:110: error: 'boolean' does not name a type

    FiniteStateMachine.cpp: In member function 'long unsigned int FiniteStateMachine::timeInCurrentState()':

    FiniteStateMachine.cpp:119: error: 'millis' was not declared in this scope

    Any idea's what I'm doing wrong? I've got the the FiniteStateMachine.h and the FiniteStateMachine.ccp files in the same directory as the StandaloneBurner file. And have tried 'adding' both files to the compile again which seems to work. But still getting the same error.

    1 reply

    Reply 1 year ago

    Ok so it turns out you have to use a very specific version of the Arduino IDE. I had to use IDE 1.05 R2. Now it uploaded to the Uno fine.


    2 years ago

    Hello molloy very nice job! Why you gave power supply to the ignitor module from an AAA battery and you didn't use a buck converter from your 12v of your cable from Brewery Controller?


    2 years ago

    For people having problems with the optical flame sensor, use a thermocouple to measure whether ignition was successful or not instead. That is the way gas furnaces work. Make sure you use a thermocouple that is heat resistant enough. You could also use a pilot flame (a flame that is always on) with a thermocouple instead of the igniter.


    3 years ago

    Hello molloy,
    How can I process if I want add a temperature sensor PID module and the thermocouple ? Thx


    3 years ago

    hitting a speed bump in my build. Wondering if you can help - my flame sensor gives me 100% false positives in daylight all the way down to something like the approx. 15% setting on the potentiometer. At that level however it won't recognize a lighter flame within an inch either, (or the actual lit burner). I tested the voltage reading in analog mode to get a better idea of what was going on. For this purpose I took an upside down flower pot with a tiny drain hole in the bottom to simulate complete darkness for the sensor vs. daylight, vs daylight w/ flame close-by: darkness = ~3.000 V, daylight 0.120 V, daylight with flame 0.080 V.

    1) How did you go about enclosing the sensor and creating a heat resistant light tunnel between the burner and the sensor?

    2) Are you using this burner in daylight or in a garage?

    Thank you

    1 reply

    Reply 3 years ago

    I had that problem, and I used a long tube over the IR sensor led, to close to the flame. I used a piece of aluminum tubing I had in the junk drawer. I still had to put a drape on the window in the end....


    3 years ago

    What is the material of the standoff that connects the flame sensor to the bracket?

    - Henrik

    1 reply

    Reply 3 years ago

    Nothing special, just a plastic standoff I had kicking around. It does not get hot


    3 years ago

    Hi Chris,

    great project - seeing this instructable prompted me to get into Arduino. I'm finally have all the parts together. One question: my BBQ igniter module has two connectors with red, yellow and black cabling for connecting to the burner switch. In your diagram I believe that these are the connectors to go to the igniter relay controlled by the Arduino. How are the different color wires connected to the relay?

    1 reply

    Reply 3 years ago

    I connect the relay cotacts to in place of the on/off switch fir the initer.


    Reply 3 years ago

    I tested this on arduino 1.6.7 and can not get it to compile. Went back on the machine I built this on and compiled just fine with Arduino 1.6.5

    Dont know what to do to fix it. Maybe load 1.6.5 and try it....


    Reply 3 years ago

    Will have a look give me a couple of days


    4 years ago on Introduction

    Hello this is helpful and interesting. I was looking for something a bit different though. However, I think you may have the knowledge to help me towards my goal which is a modification to my mother-in-law's gas cooker to make it safe for her to use (she has Alzheimer's but lives at home on her own). It is similar to what you describe but instead of it having a regular and predictable programme, it needs to respond to when she wants to use it. Is this something you could help with do you think?


    4 years ago on Introduction

    Cool project, thanks for sharing! I hope you share more of your automation build with us.