Skip to main content

Easy Automation: DIY Diesel Heater Thermostat Free Arduino Code.

We earn commission through our affiliate products.

Unlocking Automation: DIY Diesel Heater Thermostat Code Revealed

Welcome back to the second part of our DIY Diesel Heater Thermostat series! In this installment, we'll dive into the heart of the project—the Arduino code that transforms your heater into a smart, automated system. Feel free to explore, learn, and adapt this code to suit your needs. However, before we proceed, a stark reminder: use the code at your own risk, and I assume no responsibility for any consequences that may arise.

#include <Adafruit_LiquidCrystal.h> #include <Wire.h> #include <Adafruit_Sensor.h> #include <DHT.h> #include <DHT_U.h> #define DHTPIN 2 #define RELAY_PIN_5 4 #define RELAY_PIN_6 6 #define DHTTYPE DHT11 DHT_Unified dht(DHTPIN, DHTTYPE); Adafruit_LiquidCrystal lcd(12, 11, 10, 9, 8, 7); uint32_t delayMS; bool relay5Active = false; bool relay6Active = false; void setup() { Serial.begin(9600); pinMode(RELAY_PIN_5, OUTPUT); pinMode(RELAY_PIN_6, OUTPUT); dht.begin(); sensor_t sensor; dht.temperature().getSensor(&sensor); delayMS = sensor.min_delay / 1000; lcd.begin(16, 2); lcd.setCursor(0, 0); lcd.print("BrandoSoft"); lcd.setCursor(0, 0); delay(5000); lcd.print("v3.0 - 2023 "); delay(5000); lcd.setCursor(0, 0); lcd.print("Temperature: "); } void loop() { delay(delayMS); sensors_event_t event; dht.temperature().getEvent(&event); if (isnan(event.temperature)) { lcd.setCursor(1, 1); lcd.print("Error reading temp!"); } else { lcd.setCursor(0, 1); lcd.print(event.temperature * 1.8 + 32, 1); lcd.print("F "); if (event.temperature * 1.8 + 32 < 69.8 && !relay5Active) { digitalWrite(RELAY_PIN_5, HIGH); delay(4000); digitalWrite(RELAY_PIN_5, LOW); relay5Active = true; } else if (event.temperature * 1.8 + 32 >= 73) { relay5Active = false; delay(3000); } if (event.temperature * 1.8 + 32 >= 73 && event.temperature * 1.8 + 32 <= 90 && !relay6Active) { digitalWrite(RELAY_PIN_6, HIGH); delay(4000); digitalWrite(RELAY_PIN_6, LOW); relay6Active = true; } else if (event.temperature * 1.8 + 32 > 73) { relay6Active = false; delay(3000); } } }

Cautionary Note: Before you delve into the code, please be aware of the following:

Use this code at your own risk: The provided Arduino code is intended for educational purposes, and any modifications or implementations are undertaken at your discretion. I am not liable for any damages, injuries, or adverse outcomes resulting from the use of this code. Ensure proper understanding and application of safety measures when dealing with electrical components and heating systems.

Feel free to copy and experiment with the code, but always prioritize safety. If you have any doubts or concerns, consult with experienced individuals or professionals before proceeding. Let's continue the journey of DIY innovation with caution and responsible exploration!


Read More

Read More
Read More
Read More

Read More

Read More
Read More
Read More

We earn commission through our affiliate products.


Read More

Read More
Read More
Read More

Read More

Read More
Read More
Read More

Read More

Read More
Read More
Read More

Comments

Popular posts from this blog

DIY Diesel Heater Thermostat: My Journey from Frustration to Arduino Innovation

We earn commission through our affiliate products. DIY Diesel Heater Thermostat Solution DIY Diesel Heater Thermostat Solution Have you ever found yourself endlessly searching for a thermostat solution for your diesel heater , only to discover that the manual power button requires a prolonged press before the heater responds? I certainly did, and after hours of futile attempts and exhaustive Google and YouTube searches, I stumbled upon a single video featuring a brilliant mind who ingeniously used 12v relays and a house thermostat to automate the process. Despite the ingenuity, I craved more versatility and options for my diesel heater 's control. That's when I decided to take matters into my own hands and explore the world of Arduino . Armed with determination and a cheap Arduino kit sourced from the most budget-friendly corner of the internet, I embarked on a journey to create a thermostat solution that met my specific ne...

Primo USB Rechargeable Water Bottle Pump Review: A Budget-Friendly Off-Grid Water Pump Solution

We earn commission through our affiliate products.   Living off the grid comes with its challenges, and one essential aspect is finding budget-friendly solutions for everyday needs. In this post, I want to share a game-changing water pump solution that has been a reliable companion in my off-grid lifestyle – the Primo USB rechargeable water bottle pump . Compact and Efficient Design When it comes to off-grid living, every inch of space matters. The Primo water bottle pump is a compact solution that sits on top of a water bottle container. Despite its size, this little powerhouse delivers impressive water pressure, making it perfect for pumping water into a sink with ease. It's slightly larger than a standard bathroom sink, ensuring it won't take up much space in your off-grid setup. Long-lasting Power What sets the Primo water bottle pump apart is its exceptional battery life. I can vouch for the fact that I've only had to charge this pump once in...