Giter Club home page Giter Club logo

lightenergymanagementsystem's Introduction

LightEnergyMenagmentSystem

The main goal is to gather data about power consumption by led lamps and then reduce that consumption by automated control of the lamp intensity. This project uses four different devices and IoT technologies to accomplish the above goal.

Devices diagram

image

Ref Device Short Description
0 RPI 4B Hosts database, mqtt broker
1 RPI 4B Communicates with ESPs and server
2 A7670E Cat-1 HAT Provides internet connection to RPI and sends data/receives data from server
3 NodeMCU-32 ESP32 Controlls sensors and light
4 PZEM-004T Measures energy consumption of lamp
5 BH1750 Measures intensity of light
6 GLP DIM driver Driver of LED module
7 PIR HC-SR501 Detects presence of people
10 Flutter mobile app App for remote control and data presentation for user

Responsible for controlling led module. Gathers data about power consumption and light intensity using energy meter and light sensor then uses 10V PWM to dim the ligth. Can turn off/on light using relay based on peaople presence that is detected using PIR motion sensor. Measured sensor data is send to LocalRpi via BLE (bluetooth low energy), it acts as a server and sends data when LocalRpi asks for it.

Written in C++ with proto files generated for C.
Used board: ESP32 programmed using PlatformIO.

Responsible for gathering data from LampControllers using BLE and sending it to ServerRpi via cellular network using LTE module. Data is send via MQTT protocol. After receiving the data from LampController LocalRpi adds current timestamp to data. Communication with LTE module is carried out with the help of the AT commands.

Written in Rust
Used board: RPI 4B

Responsible for receivng data data from LocalRpi using MQTT. Stores data in database implemented using sqlite3. Receives data requests from MobileApp using MQTT then fetches data from database and sends it to MobileApp. Hosts mosquitto broker for MQTT.

Written in Rust
Used board: RPI 4B

Responsible for presenting data for user. Used to customize names of devices. Data is presented as graphs for periods specified by user (last month, all time). Communicates with ServerRpi using MQTT.

Written in Flutter

For data serialization protocal buffers are used. It was chosen becauese it is fast and easy to use and it generates code (yaay less typing). Current project state uses 3 messages:

  • Device - name, mac address of device
  • LampData - sensor data and timestamp
  • DataPacket - above 2 in one message
syntax = "proto3";

package light_energy_management_system;

enum MqttCommand {
    UnknownCommand = 0;
    HandleDataPacket = 1;
    GetAllDevices = 2;
    GetDeviceMeasurements = 3;
    GetDeviceMeasurementsBefore = 4;
    GetDeviceMeasurementsAfter = 5;
    ChangeDeviceName = 6;
}

message MqttPayload {
    MqttCommand command = 1;
    repeated bytes msg = 2;
}

enum DeviceType {
    UnknownDevice = 0;
    LampController = 1;
}

message Device {
    string name = 1;
    string mac = 2;
    DeviceType type = 3;
}

message Devices {
    repeated Device devices = 1;
}

enum MeasurementType {
    UnknownMeasurment = 0;
    Illuminance = 1;
    Voltage = 2;
    Current = 3;
    Power = 4;
    Energy = 5;
    Frequency = 6;
    PowerFactor = 7;
}

enum MeasurementStatus {
    Invalid = 0;
    Valid = 1;
}

message Measurement {
    float value = 1;
    MeasurementType type = 2;
    MeasurementStatus status = 3;
}

message DeviceMeasurements {
    uint64 timestamp = 1;
    repeated Measurement measurements = 2;
}

message DataPacket {
    Device device = 1;
    repeated DeviceMeasurements device_measurements = 2;
}

lightenergymanagementsystem's People

Contributors

kacpersynator avatar dependabot[bot] avatar

Stargazers

 avatar  avatar Himanshu Kumar Thakur avatar primum_et_ipsum avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.