Well of course there’s fire in the burner that’s how it works. After today however the Arduino should be able to sense the fire since I added a photo resistor,  commonly known as a flame sensor, bought at a furnace supply store. With the Arduino’s ability to sense flame, the addition of automatic self starting should be enabled.  The ability to determine if fuel is building up should also add safety to an already proven safe unit.

The sensor I obtained is a flame sensor used in a normal oil or gas fired burner.  The flame sensor allows me to sense the light corresponding to a fire currently burning. The sensor cannot determine if the fire went out or if the flame sensor can no longer see it but functionally it makes no difference to me.  I am interested in either condition and the response is the same to both conditions, turn off the fuel feed.    If the fire went out, no need to keep feeding fuel, that will simply clog the  feed chute and make a mess.  If the fuel has backed up the feed chute so much as to shield the flame sensor, there is excess fuel, turn off the fuel feed.  Physically the sensor is mounted to “look” through the back of the feed slide.  This positions was chosen purposefully to determine if fuel was backing up.

Because the flame sensor is a resistor, I am using a voltage divider circuit to measure the voltage and then using the software to check the voltage with a if – then statement.  The software determines if the voltage is high enough to indicate flame or too low indicating dark.  I have been  recording various sensor data to the micro SD over the heating season, so I will record the voltage overnight and we can see the range of data tomorrow.  If anything this should be a good time of year for the test since the fire is needed to maintain the temperature in the building, it is mid 30’s F here today, but the fire is not required to be too vigorous since the temperature is not extremely cold.

Pictures and data to follow.

Work out the software bugs to test burn, Step 8 of a DIY Record

Over the summer and fall I have written and tested a number of programs to have the building blocks of a working program.  I knew the key this year would be the ability to log data.  Of course to log data and have it mean something you have to have good data.  So I spent several days working the bugs out of OpenLog, which works but I would not recommend.  I also spent some time figuring out a combination of moving averages which resultx in stable data.

Of course the integration process was a train wreck.  The arrays used for moving average data smoothing were declared wrong so that bug had to be found and fixed.  The Serial LCD needed to be replaced, and my soldering iron wouldn’t work.    A few of the functions are timed and there were some issues with those functions.  The code for Open Log was not robust enough, once I worked out all those issues, which took most of the weekend, it is finally ready to test.

I had a plow in the shop for repair and soaked up the spilled hydraulic fluid off the floor with some sawdust, actually pellets that got wet.  So the hydraulic oil soaked sawdust is in the hopper to be burned.  It’s burning now, so tomorrow I should have some excel data which will help me make decisions to improve the software.  At this point I am not sure it will be valid however, it is really taking a long time to come up to temperature with the sawdust.   Another data point.

Boiler hooked up and burning for the first time

Boiler hooked up and burning for the first time

Milestones, why we need to take a minute.

There is so much to do in life,  so much to to make, test, verify, improve, install etc.   that it is good to look back on goals completed and know that progress is being made.  I think that is why I like programming so much, it is near instant feedback to test and observe the results.  In my outside of night work hobby life I am finally going to get a machine out of my shop that has been there nearly a year.    That is going to free up a lot of physical space, but mentally I know it is going to be huge.  A constant reminder of time and money gone.  YEA!

On the project side I received a package I ordered from to complete a phase of the OpenLog testing.  My plan has been to create a temperature recorder with a real time clock using a Arduino Uno  logging time and temperature data to OpenLog’s microSD card recorder.  Here is the finished code, that compiles and works.

Temperature and Time recorder test

This code records time and temperature to a microSd card, this is a test program to prove the ability and
allow the code to be used in other programs as part of a larger code development

A thermistors is attached to analog pin 0
The Real time clock SDA pin is attached to analog 4, the RTC SCL pin is attached to analog pin 5

The circuit:
Arduino Digitial Pins
0 RX to MicroSD TX
1 TX to MicroSD RX
2 to MicorSD GRN

* Thermister, Analog in 0
* RTC SDA, Analog pin 4
* RTC SCL, Analog pin 5

Created 9/10/12

#include <math.h> // include the library code for thermsiter functions
#include <Wire.h>
#include “RTClib.h”


// define I/O pins

// define constants for clarity

// define variables
int statLED = 13;          //toggles LED
int resetOpenLog = 2;      //reset OpenLog

int hour = 0;              // clock hour
int minute = 0;            // clock minute

// the following variables are long’s because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.

unsigned long prevmillis = 0;     // prevmillis
long DisplayDwell = 7500; // dwell time of 7.5 secs

//define function to calculate the temperature in fahrenheit for Analog pin 0
double Thermister(int RawADC) {//beginning of function
double Temp;
Temp = log(((10240000/RawADC) – 10000));
Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));
Temp = Temp – 273.15;            // Convert Kelvin to Celcius
Temp = (Temp * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit
return Temp;
}//end of function

void OutsideTempSection() {// outside temp section
Serial.print(Thermister(analogRead(0))); //print to the lcd should be the Outside temp if thermistor is hooked up properly
Serial.print(“, “);
}// end outside temp function

void TimeSection() {//start time function
DateTime now =;
hour=now.hour(),DEC;       //get the hour from the RTC chip
minute=now.minute(),DEC;   //get the minute from the RTC chip
if (hour>=13)              //PM Section
hour=hour-12;           //printed hour is the hour
Serial.print (hour);          //prints the hour
Serial.print (“:”);           // prints a colon
if (minute<10)             //adds a “0” if the time is single digit
Serial.print (“0″);
Serial.print(minute);          //prints minuts
hour=now.hour(),DEC;       //get the hour from the RTC chip
if (hour>=12)   // prints pm
Serial.println (” PM”);
if (hour<12)                       // prints am
Serial.println (” AM”);
}// end time function

void setup()
{//Begin Setup section
// pinMode(ledPin, OUTPUT);
pinMode(statLED, OUTPUT);
pinMode(resetOpenLog, OUTPUT);

RTC.adjust(DateTime(__DATE__, __TIME__));
Serial.begin(9600);             //initiate serial communication and define baud rate
delay (1000);                   //delay 1 sec for the data logger to begin
//Reset OpenLog
digitalWrite(resetOpenLog, LOW);
digitalWrite(resetOpenLog, HIGH);

//Wait for OpenLog to respond with ‘<‘ to indicate it is alive and recording to a file
while(1) {
if( == ‘<‘) break;

//Send three control z to enter OpenLog command mode
//Works with Arduino v1.0
//Wait for OpenLog to respond with ‘>’ to indicate we are in command mode
while(1) {
if( == ‘>’) break;
//send the open file
Serial.print(“Templog.txt\r”); //\r in string + regular print works with older v2.5 Openlogs

//Wait for OpenLog to return to waiting for a command
while(1) {
if( == ‘>’) break;
// send the command to append the file
Serial.print(“append Templog.txt\r”);

//Wait for OpenLog to indicate file is open and ready for writing
while(1) {
if( == ‘<‘) break;

} //End setup section

void loop()
{//Begin Loop section
if (millis()-prevmillis> DisplayDwell)
{//start if sections
OutsideTempSection();    //checks and displays the outside temp section
TimeSection();           //displays the time
}// end if section

}//End loop section