Skip to content

CasaMonitor: Home condition monitoring & control with: sensors, LEDs, fan, automation, real-time data, and customizable settings.

License

Notifications You must be signed in to change notification settings

justin-marian/casamonitor

Repository files navigation

AVR Atmega328P Build with PlatformIO Build Status

License C C++

Introduction

  • Node-RED API Dashboard: SW
  • Harware Interface: HW

CasaMonitor is a project designed to enhance home comfort by allowing users to adjust environmental conditions directly from a computer, thereby improving energy efficiency during home activities, at this link you will see how it actualy works: Diagram flow

Main Idea 💡

The project aims to provide an integrated system for monitoring and controlling environmental conditions and energy consumption in a living space. Sensors and a microcontroller (µC) connected via USB collect real-time data on temperature, humidity, and energy usage, allowing users to adjust these conditions through a graphical interface.

Project Goal 🎯

The goal is to give users better control over their living environment, optimizing comfort and energy efficiency. By using this system, energy costs can be reduced, and a more sustainable living environment can be achieved.

Utility of the Monitor 🏡

CasaMonitor's control panel offers multiple benefits:

  • Improving comfort by automatically adjusting temperature and humidity.
  • Efficiently monitoring and managing household energy consumption.
  • Optimizing the use of available resources.

System Overview

The system uses Node-RED for managing data flow and logic between devices. It connects hardware devices and ensures no data loss during sensor data reception. The system communicates with the Node-RED API via USB.

CasaMonitor Idea

Arduino UNO, USB Cable, Power Supply

  • Arduino UNO R3 ATmega328P: The main microcontroller used for interfacing with various sensors and actuators.
  • USB 2.0 A-B Cable: Connects the Arduino to a laptop for data transfer and power.
  • Power Supply (12V, 2A): Provides a stable 12V output suitable for powering multiple components like the LED strip, IR sensors, INA219, DHT22, and the cooling fan.

Sensors: Temperature/Humidity, Current/Voltage, and Photoelectric

  • DHT22 Temperature-Humidity Sensor: Connected to digital pin 12 on the Arduino, it measures environmental temperature and humidity. A pull-up resistor ensures stable data communication.
  • INA219 Current-Voltage Sensor: Uses I2C protocol for communication, measuring current up to ±3.2A with 10µA resolution, and bus voltage up to 26V.
  • IR Photoelectric Sensor (DS30P1): Detects motion up to 30 cm, connected to digital pin 8 on the Arduino. Provides PNP output for easy integration with control circuits.

Control Components: Lighting and Cooling

  • IRF520 MOSFET Driver: Controls high-current loads like the LED strip and cooling fan, supporting PWM signals for dimming the LED brightness.
  • 12V LED Strip: Provides dynamic lighting, controlled by the MOSFET through the Arduino.
  • 12V 40mm Cooling Fan: Activated based on temperature readings to maintain optimal room temperature.

Prototyping and Connectivity

  • Breadboard and Jumper Wires: Used for assembling and testing the circuit. Ensures flexibility for future modifications.
  • ON-OFF Switch: Allows manual control of the lighting system, easily accessible for quick operation.
CasaMonitor Idea

Software Design

The project uses various development environments and libraries to achieve its functionality:

Node-RED Interaction
CasaMonitor Control Panel
  • Development Environment: PlatformIO
  • Libraries: Node-RED, AVRlib

1. Light Sliders

Max Light:

  • For IR light or ON-OFF button.
  • Adjusts light intensity and ON-OFF value.
  • Used if motion or ON button is active.
  • Defaults to Min Light if inactive.
  • Sets range; min > max does nothing.

Min Light:

  • Sets minimum light intensity without IR or ON-OFF.
  • Activates minimum intensity when other options are inactive.

2. Cooler Button

  • Activates fan for cooling.

3. Data Interface

  • Temperature, Humidity, Current, Voltage, Power:
  • Shows real-time values.
  • Linear graphs track changes over time.

4. Control Interface

  • Sets light intensity and temperature preferences.
  • Buttons for lights and fan.

5. Temperature Slider

  • Sets desired temperature.
  • Fan activates if real temperature is higher.

The platformio.ini file is the main configuration file for the PlatformIO environment. It contains various settings that define how the project is built, uploaded, and monitored. Below is the detailed explanation of the platformio.ini configuration used in the CasaMonitor project:

[env:ATmega328p]
platform = atmelavr                         ; Specifies the platform as Atmel AVR
board = ATmega328p                          ; Defines the board as ATmega328p
framework = arduino                         ; Uses the Arduino framework
board_build.f_cpu = 16000000L               ; Sets the CPU frequency to 16 MHz
board_build.mcu = atmega328p                ; Specifies the MCU as ATmega328p
upload_port = COM4                          ; Defines the COM port for uploading firmware
monitor_port = COM4                         ; Sets the COM port for serial monitoring
monitor_speed = 9600                        ; Sets the baud rate for serial communication
lib_deps =
  adafruit/DHT sensor library@^1.4.3        ; Library for DHT temperature and humidity sensors
  adafruit/Adafruit INA219@^1.1.1           ; Library for INA219 current sensor
  adafruit/Adafruit Unified Sensor          ; Unified sensor library for Adafruit sensors
  adafruit/Adafruit BusIO@^1.7.3            ; I2C and UART communication library

About

CasaMonitor: Home condition monitoring & control with: sensors, LEDs, fan, automation, real-time data, and customizable settings.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published