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. Implemented on ESP32 devkit board.
Uses (PZEM-004t v3)(https://innovatorsguru.com/pzem-004t-v3/) for garhering data: voltage, current, power, energy, frequency and power factor. Commenicates via ModbusRTU interface. For handling this device PZEM-004T-v30 library is used.
Uses BH1750 digital sensor with
Uses PIR HC-SR501 sensor and digital input pin to read if motion was detected.
Uses nanopb C library. Files are generated manually using protoc and must be put in include
and src
directories, for convenience use generate_proto_files.sh script.
chmod 777 generate_proto_files.sh
generate_proto_files.sh
Use PlatformioIO to build and install code to board. For convenience use VSCode plugin.