Heater control - ArduinoPosted By Maciej Kapkowski |
You will need elements as you can see on the included picture
Than sketch ( software) as following:
#include
#include
dht DHT;
Timer timer;
#define DHT_PIN 2
#define PWM_PIN 3
void setup() {
timer.every(1000, updatePWM);
}
void loop() {
timer.update();
}
void updatePWM() {
int chk = DHT.read22(DHT_PIN);
if(chk == DHTLIB_OK) {
byte pwm = map(constrain(DHT.humidity, 60, 100), 60, 100, 0, 255);
analogWrite(PWM_PIN, pwm);
} else {
analogWrite(PWM_PIN, 255);
}
}
You will also need library for DHT sensor and optionally Windows operated software to monitor heaters, temperature and humidity by USB from computer.
I dont know how to publish here .zip files or .exe. so please send me your email to [email protected] and you will receive files.
Regards
Maciej
Than sketch ( software) as following:
#include
#include
dht DHT;
Timer timer;
#define DHT_PIN 2
#define PWM_PIN 3
void setup() {
timer.every(1000, updatePWM);
}
void loop() {
timer.update();
}
void updatePWM() {
int chk = DHT.read22(DHT_PIN);
if(chk == DHTLIB_OK) {
byte pwm = map(constrain(DHT.humidity, 60, 100), 60, 100, 0, 255);
analogWrite(PWM_PIN, pwm);
} else {
analogWrite(PWM_PIN, 255);
}
}
You will also need library for DHT sensor and optionally Windows operated software to monitor heaters, temperature and humidity by USB from computer.
I dont know how to publish here .zip files or .exe. so please send me your email to [email protected] and you will receive files.
Regards
Maciej