Light Sensor Overview

Latest Data

JSON

Send Text

Controls

ESP32 Camera Stream

This project uses an ESP32 to collect light, temperature, and humidity values. The data is sent securely to a Node.js backend where it is stored in a database and displayed in real-time on this page.

The chart in the Light Sensor Overview, shows the all the updates of the latest hour, and the last 23 hours are shown in average every minute.
The light is measured in a range from 0 to 4100.
Latest Data shows the full data of the latest 3 updates.
Controls changes the state api, which the esp32 uses to change state. Depending on what has been marked on the control colors.
Frequency changes the frequency of the buzzer, which is turned on the buttons.

  • POST /api/sensors – Submit new sensor data
  • GET /api/sensors – Retrieve all stored data
  • GET /api/sensors/latest – Get the most recent entries
  • DELETE /api/sensors – Clear the database
  • GET /api/devices/state – Get the current light states
  • POST /api/devices/light – Update the light states
  • POST /api/devices/frq – Set the buzzer frequency

The ESP32 connects over Wi-Fi and posts data to the backend. Lights and a buzzer can be controlled remotely through the control panel above. Below is the physical setup:

ESP32 Setup

The next element to be added will be a live camera. The purpose it show that shomething actually happens when the control lights are pressed, in real time.
The camera opens up for more things. Such as having an input element on the website, where one can eneter text, that can be displayed on a small oled screen, connected to the esp32.
Changing the communication between the esp32 and the website into MQTT, might make the transfer of data faster, but it might also cause the esp to slow down a lot, as I have experienced previously using TCP instead of the current polling.