heating controller: solar panel, oil burner, stove. NEED HELP AND ADVICE


this is my first time with arduino and electronics so please be forgiving.

i want to make a controller for my home heating system and if it possible be able to control (change temp. setting, see statistic, etc. by phone - Bluetooth).

so, i have three source of heat: solar panels (water), oil burner, wet stove.
first part of plan is to connect all electrical components correctly (to make sure nothing blowup), second step is the program.
third connect controller with phone by android or have a option to send sms to turn on/off oil burner.

let’s start

the heating system should looks like that (photo attach)

please don’t focus on the plumbing (that’s only sketch), electronic and programing is more important.

program (second step) should do:

  1. if T5 >T2 pomp P2 work
  2. if T3>55’C , P3 work but only if O1 is switch off (automatically P1 and M1 is off, because they will be connect directly to O1 power)
  3. option to on/off O1 by click on the phone (or by modul GSM in the future e.g sim800L)
  4. additionally options 2 and 3 they are conditioned by other sub-option of 5 zones (where hot waterwill flow, so what will be heat):
    a)olny hot water in the tank- M3 open, b)only underfoor h.- M2 open, c)only radiators- M4 open, d) all heating, no tank- M2 i M3 open, e) all M2 M3 M4 open.
    so, before turn on O1 start making fire T3, one of the zone have to be pre-sellect.

also if T1 >60st.C (and O1 and P3 are off), P4 will turn on (dump extra hot water to underfloor h.).

that’s all, nothing more … but it’s to much complicate for me right now. :confused:

and third part: all should be controll by simple phone app (android) e.g. turn on/off oil burner (maybe timer), change temp. in tank, change zone, see statistics etc.

there are elements what i have already

  • arduino nano

-logging data module

-relay 8 ports

-bluetooth modul At-09, ble-4.0

-extension board nano v3.0

  • temp. sensors DS18B20

i connect everything by all info what i’ve found in internet.
also i tried to do simulation in THINKERCAD but many of my elements are not exist in the program, stiil no win. i didnt want to connect power just in case of blow off :o

this is what i already found online:



and about bluetooth

i only showing the links to proof my hour’s spend in google.

i think first two are the best.

so i put together all what i found and this is my first program:

const int TANKSENSORT1 = A0;
const int TANKSENSORT2 = A1;
const int PANELSENSORT5 = A2;
const int STOVESENSORT3 = A3;
const int FLOORSENSORT4 = A4;

const int RELAYO1 = 3;
const int RELAYM2 = 4;
const int RELAYM3 = 5;
const int RELAYM4 = 6;
const int POMP2 = 7;
const int POMP3 = 8;
const int POMP4 = 9;

const int diffON = 6;
const int diffOFF = 3;

void setup(){


digitalWrite(RELAYO1, LOW);
digitalWrite(RELAYM2, LOW);
digitalWrite(RELAYM3, LOW);
digitalWrite(RELAYM4, LOW);
pinMode(POMP2, OUTPUT);
digitalWrite(POMP2, LOW);
pinMode(POMP3, OUTPUT);
digitalWrite(POMP3, LOW);
pinMode(POMP4, OUTPUT);
digitalWrite(POMP4, LOW);


void loop(){
float solarPanelTemperature = ((analogRead(PANELSENSORT5) / 1024.0) * 5000)/10;
float hotWaterTankTemperature = ((analogRead(TANKSENSORT2) / 1024.0) * 5000)/10;
if(solarPanelTemperature > (hotWaterTankTemperature + diffON)){
digitalWrite(POMP2, HIGH);
solarPanelTemperature = ((analogRead(PANELSENSORT5) / 1024.0) * 5000)/10;
hotWaterTankTemperature = ((analogRead(TANKSENSORT2) / 1024.0) * 5000)/10;
}while(solarPanelTemperature > (hotWaterTankTemperature + diffOFF));
digitalWrite(POMP2, LOW);

float stoveTemperature = ((analogRead(STOVESENSORT3) / 1024.0) * 5000)/10;
if(stoveTemperature > 55){ digitalWrite(POMP3, HIGH);
stoveTemperature = ((analogRead(STOVESENSORT3) / 1024.0) * 5000)/10;
}while(stoveTemperature < (55));
digitalWrite(POMP3, LOW);
// musi byc dodane autoamtyczne wylaczenie pieca O1 jesli T3>55, a jesli T3<55 piec moze byc wlaczony

float hotwaterTemperature = ((analogRead(TANKSENSORT1) / 1024.0) * 5000)/10;
if(hotwaterTemperature > (60)){ digitalWrite(POMP4, HIGH);
hotwaterTemperature = ((analogRead(TANKSENSORT1) / 1024.0) * 5000)/10;
}while(hotwaterTemperature < (60));
digitalWrite(POMP4, LOW);
// still system have to be sure that O1 or stove P3 not working.
// if one of those is on (O1 or P3) ‘heat dumping’ options cant start

// still missing:
// bluetooth modul
// or logging data modul (statistics)
// before heating will be on one of the zones have to be setup.(and save)
// ‘life’ option for changing the zones M2, M3, M4

and i stuck again.

i’m looking for advise about proper electronic setup and program the arduino.
i believe there are many people like me looking for help, so this post will have a bigger impact.


To make it easy for people to help you please modify your post and use the code button </> so your code looks like this and is easy to copy to a text editor. See How to use the Forum

Also you have a huge amount of information in your Post - too much to assimilate quickly. And there is no specific question.

Any computer project needs to be treated as several small parts. Write short programs to learn how to get each part working on its own before trying to combine them into a complete project.

For example write a short program to detect the solar water temperature and display the value on the Arduino Serial Monitor. Write another short program to learn how to turn a pump on and off. etc etc.

Then if you have a problem with one of those pieces it will be much easier to help.

Planning and Implementing a Program
Serial Input Basics - simple reliable ways to receive data - useful for Bluetooth.

third connect controller with phone by android

there are elements what i have already -bluetooth modul At-09, ble-4.0

With an android phone, it is far simpler to use bluetooth 2.0 and an HC-05 or HC-06 module. It also then becomes trivial to change a program developed with all input/output thorough the Serial monitor into one using bluetooth.

cattledog: With an android phone, it is far simpler to use bluetooth 2.0 and an HC-05 or HC-06 module. It also then becomes trivial to change a program developed with all input/output thorough the Serial monitor into one using bluetooth.

no problem I will get hc-05. thanks

The way to start with a project is to break it into parts. each part should be a stepping stone to the next

read temperatuers control pump read values on bluetooth write values from bluetooth

also, a flow chart of your project would help greatly.

it would help you understand, and it would help us to help you.

as for simulations, use LED's on or off for motors fade for variables like speed control.

your exact devices may not work, but the bits that represent what you are doing should.

do you have all the temperatures reading and the pump control working ?

dave-in-nj: do you have all the temperatures reading and the pump control working ?

yes i spend last 2 days (and nights) with THINKERCAD and have a new program what control 7 relays (3 by switch control zones and 4 by temp. sensors0. in thinkercad looks like it works...


also I add bluetooth controlling option for 3 zones (tank, rads, floor) and oil burner.

now I have to find the way to program data logging and rtc module shield (v3 nano 8105) to set-up time (and timer for oil burner) and to write, store and to see all statistics by phone (temp. data, working time of pomps etc.) i skip idea about gsm modul (to much right now)