Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
e1aa4fe27a |
5 changed files with 3470 additions and 1007 deletions
|
@ -1,3 +1,11 @@
|
||||||
# weckkubator
|
# 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)
|
|
@ -1,13 +1,12 @@
|
||||||
/* Weckkubator - Weck(topf)-(In)kubator
|
/* Weckkubator - Weck(topf)-(In)kubator
|
||||||
*
|
*
|
||||||
* Version 1.1.0
|
* Version 0.1.0
|
||||||
*
|
*
|
||||||
* Fliegerjohn - 06.05.2024
|
* Fliegerjohn - 06.05.2024
|
||||||
*
|
|
||||||
* Have fun!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <Wire.h> // Support for I2C --> LCD
|
#include <Wire.h> // Support for I2C --> LCD
|
||||||
#include <LiquidCrystal_I2C.h> // Support for PCF8574 --> LCD
|
#include <LiquidCrystal_I2C.h> // Support for PCF8574 --> LCD
|
||||||
#include <OneWire.h> // 1-Wiresupport for DS18B20
|
#include <OneWire.h> // 1-Wiresupport for DS18B20
|
||||||
|
@ -15,8 +14,8 @@
|
||||||
#include <PID_v1.h> // PID-Controller
|
#include <PID_v1.h> // PID-Controller
|
||||||
|
|
||||||
#define ONE_WIRE_BUS 10 // Enable 1-Wirebus on digital 10 (PB2 - Pin16)
|
#define ONE_WIRE_BUS 10 // Enable 1-Wirebus on digital 10 (PB2 - Pin16)
|
||||||
#define fan 8 // Fan for cooling the Triac
|
#define fan 8
|
||||||
#define wecktopf 9 // Triac for wecktopf
|
#define wecktopf 9
|
||||||
|
|
||||||
LiquidCrystal_I2C lcd(0x3F,20,4); // declare LCD
|
LiquidCrystal_I2C lcd(0x3F,20,4); // declare LCD
|
||||||
OneWire oneWire(ONE_WIRE_BUS); // declare 1-Wirebus
|
OneWire oneWire(ONE_WIRE_BUS); // declare 1-Wirebus
|
||||||
|
@ -34,8 +33,6 @@ unsigned long windowStartTime;
|
||||||
// Temp adjustment
|
// Temp adjustment
|
||||||
float tempset;
|
float tempset;
|
||||||
int poti;
|
int poti;
|
||||||
int potiold;
|
|
||||||
int poticlean;
|
|
||||||
|
|
||||||
// time
|
// time
|
||||||
unsigned long previousMillis;
|
unsigned long previousMillis;
|
||||||
|
@ -76,7 +73,7 @@ void setup() {
|
||||||
myPID.SetMode(AUTOMATIC); //turn on the PID
|
myPID.SetMode(AUTOMATIC); //turn on the PID
|
||||||
|
|
||||||
// Greetings
|
// Greetings
|
||||||
lcd.print("Weckkubator 1.1.0");
|
lcd.print("Weckkubator 0.1.0");
|
||||||
delay(3000);
|
delay(3000);
|
||||||
|
|
||||||
|
|
||||||
|
@ -87,16 +84,14 @@ void setup() {
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|
||||||
// read temp
|
|
||||||
readtemp();
|
|
||||||
|
|
||||||
// run pid
|
// run pid
|
||||||
pid();
|
pid();
|
||||||
|
|
||||||
// update LCD all 250ms
|
// update LCD
|
||||||
unsigned long currentMillis = millis();
|
unsigned long currentMillis = millis();
|
||||||
if (currentMillis - previousMillis >= 250) {
|
if (currentMillis - previousMillis >= 250) {
|
||||||
settemp();
|
settemp();
|
||||||
|
readtemp();
|
||||||
lcdoutput();
|
lcdoutput();
|
||||||
previousMillis = currentMillis;
|
previousMillis = currentMillis;
|
||||||
}
|
}
|
||||||
|
@ -107,7 +102,6 @@ void loop() {
|
||||||
else digitalWrite(fan, LOW);
|
else digitalWrite(fan, LOW);
|
||||||
previousMillisFan = currentMillis;
|
previousMillisFan = currentMillis;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
|
@ -134,14 +128,13 @@ void readtemp() {
|
||||||
sensors.requestTemperatures();
|
sensors.requestTemperatures();
|
||||||
watertemp = sensors.getTempCByIndex(0);
|
watertemp = sensors.getTempCByIndex(0);
|
||||||
|
|
||||||
if (watertemp == -127.00) missingsensor(); // print error if temp -127 (sensor not detected)
|
if (watertemp == -127.00) missingsensor();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
// LCD output
|
// LCD output
|
||||||
void lcdoutput() {
|
void lcdoutput() {
|
||||||
|
|
||||||
// Output temperatureset
|
// Output temperatureset
|
||||||
lcd.setCursor(8, 1);
|
lcd.setCursor(8, 1);
|
||||||
lcd.print(pidset);
|
lcd.print(pidset);
|
||||||
|
@ -164,15 +157,11 @@ void lcdoutput() {
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
// Read Poti and calculate the settemp
|
// Read Poti
|
||||||
void settemp() {
|
void settemp() {
|
||||||
|
|
||||||
poti = analogRead(A3);
|
poti = analogRead(A3);
|
||||||
poticlean = ((potiold+poti)/2); // Make average with last value so the tempset will not jump to much
|
tempset = (20+(poti*0.04));
|
||||||
tempset = (20+(poticlean*0.04));
|
|
||||||
potiold = poti;
|
|
||||||
|
|
||||||
// jump to 80 degrees if tempset above 51 degrees.
|
|
||||||
if (tempset <= 50) {
|
if (tempset <= 50) {
|
||||||
pidset = tempset;
|
pidset = tempset;
|
||||||
}
|
}
|
||||||
|
@ -186,28 +175,22 @@ void settemp() {
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
// Missing Sensor
|
// Missing Sensor
|
||||||
void missingsensor() {
|
void missingsensor() {
|
||||||
|
// turn of all output
|
||||||
// turn of all output to stop heating
|
|
||||||
digitalWrite(wecktopf, LOW);
|
digitalWrite(wecktopf, LOW);
|
||||||
digitalWrite(fan, LOW);
|
digitalWrite(fan, LOW);
|
||||||
|
|
||||||
// Clear LCD
|
// Clear LCD
|
||||||
lcd.clear();
|
lcd.clear();
|
||||||
|
|
||||||
// keep in loop until it reads a valid temp
|
|
||||||
do {
|
do {
|
||||||
// print errormessage
|
|
||||||
lcd.setCursor(0, 0);
|
lcd.setCursor(0, 0);
|
||||||
lcd.print("Error:");
|
lcd.print("Error:");
|
||||||
lcd.setCursor(0, 1);
|
lcd.setCursor(0, 1);
|
||||||
lcd.print("Missing Sensor");
|
lcd.print("Missing Sensor");
|
||||||
// read sensor
|
|
||||||
sensors.requestTemperatures();
|
sensors.requestTemperatures();
|
||||||
watertemp = sensors.getTempCByIndex(0);
|
watertemp = sensors.getTempCByIndex(0);
|
||||||
|
|
||||||
} while (watertemp == -127.00);
|
} while (watertemp == -127.00);
|
||||||
|
|
||||||
// set back the display
|
|
||||||
setupdisplay();
|
setupdisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
BIN
images/weckkubator_v1.x_small.JPG
Normal file
BIN
images/weckkubator_v1.x_small.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 406 KiB |
BIN
images/wecktopf_joghurt_small.JPG
Normal file
BIN
images/wecktopf_joghurt_small.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 286 KiB |
Loading…
Reference in a new issue