Inspiration The goal is to make a regular workstation a secure and eco-conscious hub. We had a desire to take critical environmental information and safety warnings to the everyday workflow of the user without the need of consulting an external application or dashboard. With the help of the Logi Options+ ecosystem and an IoT node, the user may have a smarter and safer workspace, as the desktop environment is able to actively track its environment and alert the user about possible risks, such as low air quality or smoke,
How we built it
Hardware: The physical node is based on an ESP32 microcontroller, and has a DHT11 sensor, which detects temperature and humidity, an MQ-2 sensor, which detects gas and air quality.
Firmware: The ESP32 is coded in C++ to be able to connect to the local WiFi network. It has a local HTTP web server that opens certain endpoints: /temp to provide the present climate data, and /gas to provide the analog data of the MQ-2 sensor .
Software Integration: We created a Node.js script that would serve as the Plugin to Logi Options+. It relies on axios and makes an asynchronous access to the ESP32 IP address every 3 seconds. The script is based on the use of Promise.all which allows retrieving the climate and the gas data at the same time and logs the environment status and generates local warning in case the reading of the MQ-2 exceeds a safety threshold (e.g., > 3600).
Challenges we ran into
Network Stability: It was necessary to ensure that the ESP32 could stay consistent with a steady WiFi connection and that it could correctly serve the HTTP endpoints without freezing the connection even with 3-second constant polling.
Asynchronous Data Handling: To allow the integration to be responsive and not to fail in case of a minor delay in the hardware, the Node.js plugin was managed to handle multiple API requests at the same time.
What we learned Interfacing embedded hardware (microcontrollers and analog sensors) with high-level desktop software by a local REST API.
Creation of strong polling engines and including of bespoke threshold-based alert logic as part and parcel of the Logi Options+ architecture.
Built With
- axios
- c++
- dht11
- esp32
- javascript
- mq-2
- node.js
Log in or sign up for Devpost to join the conversation.