Fedeasche
Published © GPL3+

Arduino-Powered Pellet Boiler

DIY Arduino pellet burner by converting an old wood boiler.

AdvancedShowcase (no instructions)5,025
Arduino-Powered Pellet Boiler

Things used in this project

Story

Read more

Schematics

scheme

Frietzing scheme of the control panel

Code

Sketch updated 10/2017 test

Arduino
My last sketch, i use a lot of delay specially to keep Arduino waiting, heating cycle is slow, so no multitask is need
I use some "subroutines" to clean main code loop.
#include <Servo.h>
#include <avr/io.h>
#include <avr/wdt.h>
Servo myServo;  // create a servo object

#define Reset_AVR() wdt_enable(WDTO_30MS); while(1) {} 

// Pin A0 sensore fiamma valore sale se c' luce
// Pin 5 resistenza
//Pin 4 ventola
//Pin 3 coclea
int res = 5;
int ventola = 4;
int cocl =3;
int fiamm= A0;
int tempPin= A1;
int senspell = A2;
int tempmin = 48;
int tempmax = 65;
float vref = 1.1;
int nread = 100;
int ledgreen = 9; //led verde per accensione avvenuta
int ledblue = 10; //led blue per raggiunto temp
int ledred = 11; // led rosso per blocco
float media ;
int serv=13;
float tempC;
int reading;



// the setup routine runs once when you press reset:
void setup() {
   pinMode (serv ,OUTPUT);
   pinMode (fiamm ,INPUT);
   pinMode (tempPin , INPUT);
   pinMode (senspell , INPUT); 
   analogReference( INTERNAL );
   pinMode (ledred ,OUTPUT);
   pinMode (ledgreen,OUTPUT);
   pinMode (ledblue,OUTPUT);
     myServo.attach(8); // attaches the servo on pin 9 to the servo object

   Serial.begin(9600);
  
  //seleziono uscite e ingressi su portd (pin da 0 a 7) 
 DDRD = DDRD | B11111100;
}

void loop() {
  
controllotemperatura:  controllotemperatura ();
                       digitalWrite (serv,LOW);
  if (media < tempmin) {
                         digitalWrite (ledblue,LOW);
                         digitalWrite (ledgreen,HIGH);
                         puliziainizio ();
                         cicloaccensione();
                         
cicloriscaldamento:      cicloriscaldamento();
                         controllofiamma ();
                         controllotemperatura ();
                   while (media >=55 && media <=65){
                             Serial.println ("media compresa");
                             digitalWrite(serv,HIGH);
                             funzionerallenta ();
                             controllofiamma();
                             controllotemperatura ();}
                            
                             
                             if (media > tempmax) {
                             Serial.println("caldo");
                             digitalWrite (ledgreen, LOW);
                             digitalWrite (ledblue,HIGH) ;
                             funzionespegnimento();
                             Reset_AVR();}
                            else goto cicloriscaldamento ;
       
}        
           digitalWrite (ledgreen, LOW);
           digitalWrite (ledblue,HIGH) ;
}

Credits

Fedeasche

Fedeasche

0 projects • 12 followers

Comments