De grafieken staan nu hier:
http://fulton.xs4all.nl:444/index.php/t ... e-grafiek/
Deze worden om de 1 minuut geupdate, en laten de laatste 48 uur zien.
Of beter gelijk in full screen:
http://fulton.xs4all.nl:444/test4/graphs2.htm
Ik heb de sketch aangepast voor de juiste uitvoer naar de grafieken en er alvast alle berekeningen bijgezet.
Alleen de kamertemp. en luchtvochtingheid worden gemeten, de rest is gesimuleerd.
Over de temp sensoren:
Ik denk eigenlijk dat het een goed idee zou zijn om een simpele shield te zoeken, waar minimaal 4 sensoren op aangesloten kunnen worden.
Het liefst zonder soldeerwerk, zodat een ieder, (ook zonder verstand van de Arduino) dit alles makkelijk kan samenstellen.
Een daarna/daarnaast Kockie zijn systeem gaan na-apen. Het is tenslotte goedkoop leren van andermans fouten.
De Arduino heeft nu al moeite met de hoeveelheid aan gegevens. En ik denk dat het idd beter zou zijn dit door de Rpi te laten doen.
Dus een aparte module er voor maken, met aparte grafieken, met oneindig veel sensoren als je wilt.
Nu ik wat beter begrijp hoe de grafieken werken ben ik opnieuw begonnen met die grafieken,, en hoop dit weekend nieuwe klaar te hebben.
Alles krijgt dan een wat duidelijkere naam, en dan is het ook wat makkelijker er een NL versie van te maken.
De volgende stap wordt dan de PeterMeter, hopelijk gaan deze elke seconde worden ververs, en laten dan maximaal 2 uur zien.
Maar dat gaat nog even een hoop uitzoekwerk geven..
@ Vince
Je hoeft dus alleen nog maar voor 02 te zorgen, en dan kan daarna "systeem Hans" worden toegevoegd...
Code: Selecteer alles
/*************************
StoveThing Uitvoer Eenheid
ruimte temp. AMBIENTTEMP �C
relatieve luchtvochtigheid AMBIENTHUMIDITY %
rookgastemp voor de wisselaar PREEXCHTEMP �C
rookgastemp. na de wisselaar POSTEXCHTEMP �C
o2 percentage OXYGENPERCENT %
Excess air EXCESSAIR
co2 percentage CO2PERCENT %
totaal rendement TOTALEFFICIENCY ? %
rendement voor de wisselaar EXCHEFFICIENCY ? %
rendement kachel STOVEEFFICIENCY ? %
schoorsteenverlies HEATLOSSEXHAUST %
luchtovermaat EXCESSAIR
Systeem Hans
aanvoertemp. FLOWTEMPERATUREOUT �C
retourtemp. FLOWTEMPERATURERETURN �C
volumestroom in de installatie WATERFLOW L/uur
Massa water WATERVOLUME kg
vermogen van de warmtewisselaar EXCHOUTPUT kW
StoveThing & Systeem Hans
totale vermogen TOTALPOWER kW
vermogen van de kachel ( afgifte ruimte) STOVEPOWER kW
belasting TOTALLOAD kW
hout WOODCONSUMPTIONKGH kg/uur
hout WOODCONSUMPTIONGM gram/min.
verhouding ruimte/CV SPACECENTRALHEATING
koolmonoxide Nog niet in gebruik
CO percentage COPERCENT %
koolmonoxide ppm COPPM ppm
Giftigheidsindex TOXICITY
********************************************/
/***************************************************
*
* ST_version_1.0 - 15 April 2016
*
* Some of the following code and associated libraries were written by Limor Fried and Ladyada for Adafruit. This code is used to obtain data from the Adafruit Amplifier Board (MAX31855). The board is available from https://www.adafruit.com/products/269 - BSD license. Other bits of the code were written by Nathan Seidle for SparkFun Electronics. His code (and libraries) are used to obtain data from the Sprakfun HTU21D temperature & humidity sensor. The rest of the code was cobbled together by Vincent Busch for the stovething project.
*
* ST version 1.0 outputs lambda, AFR, oxygen percentage, excess air percentage, carbon dioxode percentage and stove efficiency. NOTE: THE FORMULAS USED HERE HAVE KNOWN FLAWS AND SHORTCOMINGS - THESE ARE EXPLAINED IN THE SKETCH. THE SKETCH IS PROVIDED FOR EXPERIMENTAL PURPOSES ONLY. WITH THE EXCEPTION OF LAMBDA, THE ACCURACY OF THE DATA HAS NOT BEEN VERIFIED. Hopefully that's enough of a disclaimer.
*
***************************************************/
#include <Wire.h>
#include <SparkFunHTU21D.h>
#include <SPI.h>
#include "Adafruit_MAX31855.h"
/*-------DEFINE TEMPERATURE & HUMIDITY SENSOR-------*/
//Create an instance for the temperature/humidity sensor
HTU21D myHumidity;
/* Version 1.0 uses two thermocouples (software SPI on any four digital IO pins). The CLK (clock) and CS (chip select) are shared; thermocouple 1 is assigned DO1 (data out) while thermocouple 2 uses DO 2. Pins and thermocouples are defined below. */
/*-------DEFINE THERMOCOUPLES-------*/
#define DO1 10
#define DO2 11
#define CS 12
#define CLK 13
Adafruit_MAX31855 thermocouple1(CLK, CS, DO1);
Adafruit_MAX31855 thermocouple2(CLK, CS, DO2);
/*-------SETUP SECTION-------*/
void setup() {
Serial.begin(9600);
delay(1000);
// Start Sprakfun HTU21D temperature & humidity sensor
myHumidity.begin();
delay(1000);
}
/*-------LOOP SECTION-------*/
void loop() {
/*-------HUMIDITY AND TEMPERATURE SENSOR-------*/
/* The code below retrieves temeprature and humidity data from the Sparkfun sensor. */
float AMBIENTTEMP = myHumidity.readTemperature();
float AMBIENTHUMIDITY = myHumidity.readHumidity();
/*-------THERMOCOUPLE 1-------*/
/* The following code reads the on-board temperature module on the Adafruit MAX31855 for thermocouple 1 - it is not used here. Instead the temperature is derived from the SparkFun chip. */
// Serial.print("Internal Temp = ");
// Serial.println(thermocouple1.readInternal());
/* The code below reads the temperature from thermocouple 1, in Celsius. */
double c1 = thermocouple1.readCelsius();
/* If you prefer the temperature to be displayed in Fahrenheit, uncomment the code below (and comment out the code above). */
// double f1 = thermocouple1.readFahrenheit();
/* This sketch formats and outputs data for processing in MakerPlot. If you intend to use the Arduino serial monitor, you may wish to uncomment the following (and comment out the MakerPlot section). Note: if you have changed the temperature setting to Fahrenheit, remember to adjust the below code accordingly (to f1). */
// if (isnan(c1)) {
// Serial.println("T1 not working!");
// } else {
// Serial.print("T1 = ");
// Serial.println(c1);
// }
/*-------THERMOCOUPLE 2-------*/
/* The following code reads the on-board temperature module on the Adafruit MAX31855 for thermocouple 2 - it is not used here. */
// Serial.print("Internal Temp = ");
// Serial.println(thermocouple2.readInternal());
/* The code below reads the temperature from thermocouple 2, in Celsius. */
double c2 = thermocouple2.readCelsius();
/* If you prefer the temperature to be displayed in Fahrenheit, uncomment the code below (and comment out the code above). */
// double f2 = thermocouple2.readFahrenheit();
/* This sketch formats and outputs data for processing in MakerPlot. If you intend to use the Arduino serial monitor, you may wish to uncomment the following (and comment out the appropriate lines of the MakerPlot section). Note: if you have changed the temperature setting to Fahrenheit, remember to adjust the code below accordingly (to f2). */
// if (isnan(c2)) {
// Serial.println("T2 not working!");
// } else {
// Serial.print("T2 = ");
// Serial.println(c2);
// }
/*-------WIDEBAND OXYGEN SENSOR------------*/
/* The signal from the wideband oxygen controller is sent to analog pin 0 (A0). */
int sensorValue = analogRead(A0);
/* LAMBDA - the sensor controller is programmed to output 0 volts at lambda 0.80 and 5 volts at lambda 8.19. The difference is 7.39. These numbers are included in the formula below, and should be changed if the sensor settings are changed (read: if the controller is re-programmed). */
float LAMBDA = 0.80 + (sensorValue * (7.39 / 1023.0));
/* AFR - the AFR figure shown is a multiple of the AFR figure defined in the LM software (set to 6.4, the setting for methanol). Based on the above lambda settings, the AFR is 5.12 at 0 volts and 52.41 at 5 volts. The difference is 47.29. These numbers are included in the formula below and should be changed if the sensor controller settings are changed/reprogrammed via LM Programmer. Please note that the controller can be set to a user-defined AFR multiple.*/
float AFR = 5.12 + (sensorValue * (47.29 / 1023.0));
/* OXYGEN PERCENTAGE - the lambda value can be used to calculate the oxygen percentage in the exhaust gas. Please note that the formula used here was developed for the lean part of the lambda range (where lambda <1). Future versions of the system will retrieve the oxygen percentage directly from the controller/sensor. The formula used for now is x02=3*(La-1)/(1+3*K*La), where x02 = oxygen percentage, La = lambda, and K is either 4.76 or 4.77. The correction factor of 2.68 is compensated proportionally for values in excess of lambda 1.0. This is done in the output section (it is assumes that lambda will never be less than 1 in a woodstove). This is very much a patch! For reference purposes: outside air contains 20.95% oxygen.*/
//float OXYGENPERCENT = (3 * ((LAMBDA - 1) / (1 + 3 * 4.765 * LAMBDA)) * 100);
//float OXYGENPERCENT = 13.7; //Dit is een vaste waarde
float OXYGENPERCENT = AMBIENTHUMIDITY / 3.5714; // Dit is een dynamische waarde
/* EXCESS AIR - there are various ways to calculate access air. As the lambda value is obtained directly from the sensor (as opposed to being calculated) it is used here. The formula used is: lambda = (percentage excess air / 100) + 1. Or, expressed in terms of excess air: percentage excess air = (lambda - 1) * 100. */
float EXCESSAIR = (((LAMBDA) - 1) * 100);
/*-------STOVE EFFICIENCY -------*/
/* The flue gas temperature, the ambient temperature and the carbon dioxide (CO2) percentage can be used to obtain some indication of the woodstove's efficiency. The formula is: stove efficiency = 100 - ((MeanFlueTemp - MeanRoomTemp) x (A1 / CO2%)), where A1 is 0.65. As thermocouple 1 is attached to the flue, MeanFlueTemp = (c1) while MeanRoomTemp (temp, 1). */
//float STOVEEFFICIENCY = 100 - (((c1) - (AMBIENTTEMP, 1)) * (0.65 / CO2PERCENT)); // Deze heb ik uit gezey en naar beneden verplaatst
/*-------DATA OUTPUT TO MAKERPLOT-------*/
/*
{
// The code below outputs data in comma delimited form. This allows it to be read in MakerPlot.
Serial.print(c1); // temperature reading thermocouple 1, displayed in Celsius
// Serial.print(f1); // temperature reading thermocouple 1, displayed in Fahrenheit
Serial.print(","); // comma delimiter
Serial.print(c2); // temperature reading thermocouple 2, displayed in Celsius
// Serial.print(f2); // temperature reading thermocouple 2, displayed in Fahrenheit
Serial.print(","); // comma delimiter
Serial.print(AMBIENTTEMP, 1); // ambient temperature from SprakFun temperature & humidity sensor
Serial.print(","); // comma delimiter
Serial.print(AMBIENTHUMIDITY, 1); //humidity reading from SprakFun temperature & humidity sensor
Serial.print(","); // comma delimiter
Serial.print(LAMBDA);
Serial.print(","); // comma delimiter
Serial.print(AFR);
Serial.print(","); // comma delimiter
if ((OXYGENPERCENT < 0) && (LAMBDA >1))
{
Serial.print(0.00);
Serial.print(","); // comma delimiter
}
else
{
Serial.print(OXYGENPERCENT + (LAMBDA * (2.61/7.99)));
Serial.print(","); // comma delimiter
}
if (EXCESSAIR > 100)
{
Serial.print(100);
Serial.print(","); // comma delimiter
}
else
{
Serial.print(EXCESSAIR);
Serial.print(","); // comma delimiter
}
if (CO2PERCENT < 0)
{
Serial.print(0.00);
Serial.print(","); // comma delimiter
}
else
{
Serial.print(CO2PERCENT);
Serial.print(","); // comma delimiter
}
if (STOVEEFFICIENCY < 0)
{
Serial.print(0.00);
Serial.print(","); // comma delimiter;
}
else
{
Serial.print(STOVEEFFICIENCY);
Serial.print(","); // comma delimiter;
Serial.println();
}
*/
/*-------DATA OUTPUT SERIAL-------*/
/*
{
Serial.print("Thermocouple 1: "); // label thermocouple 1
Serial.print(c1); // temperature reading thermocouple 1, displayed in Celsius
// Serial.print(f1); // temperature reading thermocouple 1, displayed in Fahrenheit
Serial.println(); // new line.
Serial.print("Thermocouple 2: "); // label thermocouple 2
Serial.print(c2); // temperature reading thermocouple 2, displayed in Celsius
// Serial.print(f2); // temperature reading thermocouple 2, displayed in Fahrenheit
Serial.println(); // new line.
Serial.print("Ambient temperature: "); // label ambient temperature
Serial.print(AMBIENTTEMP, 1); // ambient temperature from SprakFun temperature & humidity sensor
Serial.println(); // new line
Serial.print("Ambient humidity: "); // label ambient humidity
Serial.print(AMBIENTHUMIDITY, 1); //humidity reading from SprakFun temperature & humidity sensor
Serial.println(); // new line
Serial.print("Lambda: "); // lambda label
Serial.print(LAMBDA);
Serial.println(); // new line
Serial.print("Air Fuel Ratio: "); // AFR label
Serial.print(AFR);
Serial.println(); // new line
if ((OXYGENPERCENT < 0) && (LAMBDA >1))
{
Serial.print("Oxygen percentage: "); // label oxygen percentage
Serial.print(0.00);
Serial.println(); // new line
}
else
{
Serial.print("Oxygen percentage: "); // label oxygen percentage
Serial.print(OXYGENPERCENT + (LAMBDA * (2.61/7.99)));
Serial.println(); // new line
}
if (EXCESSAIR > 100)
{
Serial.print("Excess Air percentage: "); // label excess air percentage
Serial.print(100);
Serial.println(); // new line
}
else
{
Serial.print("Excess Air percentage: "); // label excess air percentage
Serial.print(EXCESSAIR);
Serial.println(); // new line
}
if (CO2PERCENT < 0)
{
Serial.print("CO2 percentage: "); // label CO2 percentage
Serial.print(0.00);
Serial.println(); // new line
}
else
{
Serial.print("CO2 percentage: "); // label CO2 percentage
Serial.print(CO2PERCENT);
Serial.println(); // new line
}
if (STOVEEFFICIENCY < 0)
{
Serial.print("Stove efficiency (%): "); // label stove efficiency
Serial.print(0.00);
Serial.println();
}
else
{
Serial.print("Stove efficiency (%): "); // label stove efficiency
Serial.print(STOVEEFFICIENCY);
Serial.println();
Serial.println();
}
*/
// Dit is wat gesimuleerde output en alvast de berekeningen
/* CO2 PERCENTAGE - the oxygen percentage can also be used to estimate the carbon dioxide percentage in the exhaust gas. The formula is: CO2% = maximum CO2 for fuel type * ((20.95 - %O2) / 20.95). Please note that the figure for maximum CO2 for wood tends to vary, and is generally quoted for dry wood (wood rarely is). I have encountered 19.2 as well as 19.7. I have used 19.5. There are other shortcomings. */
float CO2PERCENT = 19.5 * ((20.95 - OXYGENPERCENT) / 20.95);
float PREEXCHTEMP = 789.8; //gemeten en nu ff gesimuleerd.........
//float PREEXCHTEMP = c1; //gemeten en nu ff gesimuleerd.........
float POSTEXCHTEMP = 140.2; //gemeten en nu ff gesimuleerd.........
//float POSTEXCHTEMP = c2; //gemeten en nu ff gesimuleerd.........
float TOTALEFFICIENCY = 100 - ((POSTEXCHTEMP - AMBIENTTEMP) * (0.650 / CO2PERCENT));
float STOVEEFFICIENCY = 100 - ((PREEXCHTEMP - AMBIENTTEMP) * (0.650 / CO2PERCENT));
float EXCHEFFICIENCY = TOTALEFFICIENCY - STOVEEFFICIENCY;
float HEATLOSSEXHAUST = 100 - TOTALEFFICIENCY;
float FLOWTEMPERATUREOUT = AMBIENTTEMP * 3 -16; // Ook even dynamische gemaakt
//float FLOWTEMPERATUREOUT = 54.9; // Gaat worden gemeten door Hans en nu ff gesimuleerd.........
float FLOWTEMPERATURERETURN = AMBIENTTEMP * 2; // Ook even dynamische gemaakt
//float FLOWTEMPERATURERETURN = 47.0; // Gaat worden gemeten door Hans en nu ff gesimuleerd.........
float WATERFLOW = 1000; // Gaat worden gemeten door Hans en nu ff gesimuleerd.........
float EXCHOUTPUT = (WATERFLOW *(FLOWTEMPERATUREOUT - FLOWTEMPERATURERETURN) * (4186/1000)) / 3600;
float TOTALPOWER = EXCHOUTPUT / EXCHEFFICIENCY * 100;
float STOVEPOWER = TOTALPOWER - EXCHOUTPUT;
float TOTALLOAD = TOTALPOWER / TOTALEFFICIENCY * 100;
float WOODCONSUMPTIONKGH = TOTALLOAD / 5 / 100 * TOTALEFFICIENCY; // Calorische waarde misschien uit Mysql halen ??
float WOODCONSUMPTIONGM = WOODCONSUMPTIONKGH * 1000/60;
float COPPM = 4321; // DIt is voor later als er een CO cel is....
// Zo moet het er ongeveer uitzien voor de grafieken
Serial.print(AMBIENTTEMP, 1); // ambient temperature from SprakFun temperature & humidity sensor
Serial.print(" \t"); //tab
Serial.print(AMBIENTHUMIDITY, 1); //humidity reading from SprakFun temperature & humidity sensor
Serial.print(" \t"); //tab
Serial.print(PREEXCHTEMP, 1); //Rookgastemp voor de wisselaar
Serial.print(" \t"); //tab
Serial.print(POSTEXCHTEMP, 1); //Rookgastemp na de wisselaar
Serial.print(" \t"); //tab
Serial.print(OXYGENPERCENT, 1); //Zuurstof percentage
Serial.print(" \t"); //tab
Serial.print(EXCESSAIR, 1); //Lambda
Serial.print(" \t"); //tab
Serial.print(CO2PERCENT, 1); //CO2 percentage
Serial.print(" \t"); //tab
Serial.print(TOTALEFFICIENCY, 1); //Totaal rendement
Serial.print(" \t"); //tab
Serial.print(EXCHEFFICIENCY, 1); //Rendement voor de wisselaar
Serial.print(" \t"); //tab
Serial.print(STOVEEFFICIENCY, 1); //Rendement van de kachel naar de ruimte
Serial.print(" \t"); //tab
Serial.print(HEATLOSSEXHAUST, 1); //Schoorsteenverlies
Serial.print(" \t"); //tab
Serial.print(FLOWTEMPERATUREOUT, 1); //Aanvoer temp.
Serial.print(" \t"); //tab
Serial.print(FLOWTEMPERATURERETURN, 1); //Retour temp.
Serial.print(" \t"); //tab
Serial.print(WATERFLOW, 0); //Watervolume
Serial.print(" \t"); //tab
Serial.print(EXCHOUTPUT, 1); //Vermogen van de wisselaar
Serial.print(" \t"); //tab
Serial.print(TOTALPOWER, 1); //Totaal vermogen
Serial.print(" \t"); //tab
Serial.print(STOVEPOWER, 1); //Vermogen naar de ruimte
Serial.print(" \t"); //tab
Serial.print(TOTALLOAD, 1); //Belasting
Serial.print(" \t"); //tab
Serial.print(WOODCONSUMPTIONKGH, 2); //Hout verbruik in kg
Serial.print(" \t"); //tab
Serial.print(WOODCONSUMPTIONGM); //Hout verbruik in kg
Serial.print(" \t"); //tab
Serial.print(COPPM, 0); //CO in PPM
Serial.println(" \t"); //tab
// the delay below defines how often data is sent to MakerPlot (once a second = 1000).
delay(2000);
}
// remember to change this when uncommenting/commenting out
//}