Compare commits

..

1 commit
v1.x ... main

Author SHA1 Message Date
e1aa4fe27a
Add pictures to README.md 2024-05-07 10:14:14 +02:00
5 changed files with 3470 additions and 1007 deletions

View file

@ -1,3 +1,11 @@
# weckkubator
Weck(topf)-(In)kubator
Weck(topf)-(In)kubator
Control box:
![](/images/weckkubator_v1.x_small.JPG)
Testrun with yoghurt:
![](/images/wecktopf_joghurt_small.JPG)

View file

@ -1,13 +1,12 @@
/* Weckkubator - Weck(topf)-(In)kubator
*
* Version 1.1.0
* Version 0.1.0
*
* Fliegerjohn - 06.05.2024
*
* Have fun!
*/
#include <Wire.h> // Support for I2C --> LCD
#include <LiquidCrystal_I2C.h> // Support for PCF8574 --> LCD
#include <OneWire.h> // 1-Wiresupport for DS18B20
@ -15,8 +14,8 @@
#include <PID_v1.h> // PID-Controller
#define ONE_WIRE_BUS 10 // Enable 1-Wirebus on digital 10 (PB2 - Pin16)
#define fan 8 // Fan for cooling the Triac
#define wecktopf 9 // Triac for wecktopf
#define fan 8
#define wecktopf 9
LiquidCrystal_I2C lcd(0x3F,20,4); // declare LCD
OneWire oneWire(ONE_WIRE_BUS); // declare 1-Wirebus
@ -34,8 +33,6 @@ unsigned long windowStartTime;
// Temp adjustment
float tempset;
int poti;
int potiold;
int poticlean;
// time
unsigned long previousMillis;
@ -76,7 +73,7 @@ void setup() {
myPID.SetMode(AUTOMATIC); //turn on the PID
// Greetings
lcd.print("Weckkubator 1.1.0");
lcd.print("Weckkubator 0.1.0");
delay(3000);
@ -87,16 +84,14 @@ void setup() {
void loop() {
// read temp
readtemp();
// run pid
pid();
// update LCD all 250ms
// update LCD
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= 250) {
settemp();
readtemp();
lcdoutput();
previousMillis = currentMillis;
}
@ -107,7 +102,6 @@ void loop() {
else digitalWrite(fan, LOW);
previousMillisFan = currentMillis;
}
}
//------------------------------------------
@ -134,14 +128,13 @@ void readtemp() {
sensors.requestTemperatures();
watertemp = sensors.getTempCByIndex(0);
if (watertemp == -127.00) missingsensor(); // print error if temp -127 (sensor not detected)
if (watertemp == -127.00) missingsensor();
}
//------------------------------------------
// LCD output
void lcdoutput() {
// Output temperatureset
lcd.setCursor(8, 1);
lcd.print(pidset);
@ -164,15 +157,11 @@ void lcdoutput() {
//------------------------------------------
// Read Poti and calculate the settemp
// Read Poti
void settemp() {
poti = analogRead(A3);
poticlean = ((potiold+poti)/2); // Make average with last value so the tempset will not jump to much
tempset = (20+(poticlean*0.04));
potiold = poti;
tempset = (20+(poti*0.04));
// jump to 80 degrees if tempset above 51 degrees.
if (tempset <= 50) {
pidset = tempset;
}
@ -186,28 +175,22 @@ void settemp() {
//------------------------------------------
// Missing Sensor
void missingsensor() {
// turn of all output to stop heating
// turn of all output
digitalWrite(wecktopf, LOW);
digitalWrite(fan, LOW);
// Clear LCD
lcd.clear();
lcd.clear();
// keep in loop until it reads a valid temp
do {
// print errormessage
lcd.setCursor(0, 0);
lcd.print("Error:");
lcd.setCursor(0, 1);
lcd.print("Missing Sensor");
// read sensor
sensors.requestTemperatures();
watertemp = sensors.getTempCByIndex(0);
} while (watertemp == -127.00);
// set back the display
setupdisplay();
}

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB