Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino and ESP8266 Based Smart Climate Control and Lighting System

View and Edit Project In Cirkit DesignerImage of Arduino and ESP8266 Based Smart Climate Control and Lighting System

Circuit Documentation

Summary

The circuit is designed to manage and monitor an environment using various sensors and actuators. It includes a solar power management system with an MPPT SCC, a 12v battery, and a solar panel. The circuit also features a 12v to 5v step-down power converter to supply 5v to the low-voltage components. Sensing is done via a DHT11 temperature and humidity sensor, an LDR light sensor, and a PIR motion sensor. Actuation is controlled through a 4-channel relay module that switches an LED bulb and a fan. Communication is handled by an HC-06 Bluetooth module, and an Arduino UNO microcontroller is used for control logic. An ESP8266 NodeMCU provides additional connectivity options, and an RTC DS3231 module keeps track of real-time.

Component List

MPPT SCC

12v Battery

12v to 5v Step Down Power Converter

KY-015 DHT11

Sensor LDR LM393

Resistor (10k Ohms)

PIR Motion Sensor (Wokwi Compatible)

Solar Panel

Relay 4 Channel 5v

LED bulb AC / Bombillo AC

Power Inverter

Bluetooth HC-06

Arduino UNO

ESP8266 NodeMCU

RTC DS3231

Fan

Wiring Details

MPPT SCC

12v Battery

12v to 5v Step Down Power Converter

KY-015 DHT11

Sensor LDR LM393

Resistor (10k Ohms)

PIR Motion Sensor (Wokwi Compatible)

Solar Panel

Relay 4 Channel 5v

LED bulb AC / Bombillo AC

Power Inverter

Bluetooth HC-06

Arduino UNO

ESP8266 NodeMCU

RTC DS3231

Fan

Documented Code

Arduino UNO Code (sketch.ino)

#include <DHT.h>
#include <Wire.h>
#include <RTClib.h>
#include <SoftwareSerial.h>  // For Bluetooth

#define DHTPIN 2       // Pin connected to DHT11
#define DHTTYPE DHT11  // DHT 11 sensor
#define RELAY_LIGHT 3  // Pin connected to Relay for Light
#define RELAY_FAN 4    // Pin connected to Relay for Fan
#define LDR_PIN A0     // Pin connected to LDR
#define PIR_PIN 5      // Pin connected to PIR sensor

DHT dht(DHTPIN, DHTTYPE);  // Initialize DHT sensor
RTC_DS3231 rtc;            // Real-Time Clock instance
SoftwareSerial bluetooth(10, 11);  // RX, TX for Bluetooth

void setup() {
  Serial.begin(9600);  // Start serial communication for debugging
  bluetooth.begin(9600); // Start Bluetooth communication
  
  // Initialize DHT sensor
  dht.begin();
  
  // Initialize relays as outputs
  pinMode(RELAY_LIGHT, OUTPUT);
  pinMode(RELAY_FAN, OUTPUT);
  
  // Initialize PIR sensor as input
  pinMode(PIR_PIN, INPUT);
  
  // Initialize RTC
  if (!rtc.begin()) {
    Serial.println("Couldn't find RTC