@ajb2k3 Sorry, up to now I do not know how to to create a "github" and a "project" - I will need to do some "learning" on that.
In the meantime I am giving you some information in this forum:
The planned project:
Logging of data of the house heating system for "years" for diagnostical and statistical purposes
Functions needed in detail:
- measuring of about 10 temprature sensors, environmant data, oil burner run time, +++
- getting date and time from webserver via WLAN
- use buttons for start/stop of measurement, single measurement, +++
- show actual data on Lcd of M5Stack and monitor (if connected)
- write all data to SD-card
- use LED's of M5Stack-Fire for heartbeat, measurement in progress, waiting for next measurement slot, WLAN connection, +++
- optional: sending data to PC via WLAN to import them into Excel for analysis (or transfering the data from SD-card to PC via a card-reader)
- optional:Webserver for live-data and SD-card-data
- +++, tbd
... puh..., I fear, this will be long way to go (at least for me...).
The software (up to now, this is all I have so far - I wanted to start with testing and building up some experiences of using the DS18B20 sensors connected to a M5Stack-Fire):
/*
* Software for basic tests of temperature measurement on M5Stack-FIRE with several DS18B20 temperature sensors
* 1-wire-pull-up resistor = 2 kohm (did not not work with 4,7 kohm !!!!
* modified by GRELM; 2019-06-16
*/
#include <M5Stack.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 26 //DS18B20 on Grove B corresponds to GPIO26 on ESP32
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature DS18B20(&oneWire);
/* Resolution of DS18B20 temperatur measurement = power-on-default = 12 bit = 0.0625 C
*9-bit resolution --> 93.75 ms
*10-bit resolution --> 187.5 ms
*11-bit resolution --> 375 ms
*12-bit resolution --> 750 ms
*/
String monitorstring = "";
void setup() {
M5.begin();
M5.Lcd.setTextColor(TFT_WHITE,TFT_BLACK);
M5.Lcd.setTextSize(2);
M5.Lcd.clear(); //just to make sure...
Serial.println(); // to separate data from booting output
monitorstring = "Date;Time;A;B;C;D;E;F;G;H;I;J;"; // up to 10 data-colums fpr up to 10 sensors
Serial.println(monitorstring); // Monitor Headline for Excel Headline
}
void loop() {
float celsius;
float fahrenheit;
monitorstring = "Date;Time"; // change to realtime date and time of M5Stack (later)
DS18B20.begin();
int count = DS18B20.getDS18Count(); //check for number of connected sensors
// M5.Lcd.clear(); //clearing causes flickering of Lcd-display, looks nicer without
M5.Lcd.setCursor(0,0);
M5.Lcd.print("Devices found: ");
M5.Lcd.print(count);
M5.Lcd.println(" DS18B20");
if (count > 0) {
DS18B20.requestTemperatures();
for (int i=0; i < count; i++) {
String m5stackstring = "Sensor ";
celsius = DS18B20.getTempCByIndex(i);
m5stackstring = m5stackstring + String(i) + String(": ") + String(celsius,4) + String(" C ");
M5.Lcd.println(m5stackstring); // 1 line per sensor on M5Stack Lcd
monitorstring = monitorstring + String(";") + String(celsius,4); // ";" is Excel compatibel separator
}
Serial.println(monitorstring); // 1 line for all measurements on serial monitor
}
delay(500); //Measuremnt interval
}