This article describes how to create a DIY smart multi-sensor with HomeGenie Mini smart-sensor firmware and ESP32-C3/S3 SoC.
Found in nearly all modern gadgets, sensors gather and measure data about the environment or other factors. Examples include position, height, speed, temperature, vibrations, air quality, touch, color, smoke and gas, tilt, light, and proximity, to name a few. But this is not just about showing data, sensors are used to analyze and collect more accurate input in order to offer improved responses, functionality, or services.
A simple and common application is the control of lighting, for instance, through the use of a motion and light sensor to automate switching on and off, which is one of the features implemented by the smart-sensor firmware through the default schedules:
- Motion.Activated
Triggers when motion is detected and light level is below a configurable value. It switches on all bound modules. - Motion.Timeout
Trigger when no motion is detected for a configurable period of time. It switches off all bound modules. - Motion.Blink
Triggers whenever motion detection state changes and it toggles the bound modules on/off
The video below shows how to configure the Motion.Blink
schedule with the integrated RGB status led and other lights.
Product features:
- Powered via USB type-C connector (5V)
- Easy Wi-Fi configuration via Bluetooth or WPS button
- Motion sensing up to 5 meters (optimal range is 0 to 3.5 meters)
- Light level sensing (0-1000 value range)
- Onboard RGB LED
- Built-in scheduler to create automated actions based on time or other device events
- Free and easy to use client (HomeGenie Panel app)
- Open source Firmware and API
The onboard RGB LED can be used to signal when motion is detected, or to report other user-defined states using different colors.
Smart Multi-Sensor kit v1.0 (igloo)
This kit consists of a translucent, small enclosure measuring 2,2 × 2,2 × 3,6 cm and a PCB shield for ESP32-C3/S3 Zero development board that can embed various sensors.
PCB shield
On the upper side of the PCB there are the light sensor and the motion sensor, while on the lower side there are the two 9-pin header rails on which the ESP32 board is connected.
The PCB can eventually also host the following components:
- DHT-11 or DHT-22 temperature and humidity sensor (4 pin connector on the left side)
- TCS3472 color sensor (7 pin connector on the right side)
However, to keep it simple (yet smart =)), the kit only includes the components that are required to implement motion + light sensing.
Components listing
- 2 single row female headers 9 pin (pitch 2.54mm, head 8.50mm)
- 1 10kOhm resistor
- 1 Light-Dependent Resistor (LDR)
- 1 right-angled 3 pin female connector
- 1 Motion sensor module SR602
Casing
Printed using translucent PETG material, the enclosure takes about 30 minutes to print with a 0.4mm nozzle and 0.20mm layer height on an A1-mini 3D printer.
Assembly instructions
Project files
Smart Sensor kit
PCB Gerber download REV. 1
Enclosure 3MF download REV. 1
Smart Sensor project files by G-Labs licensed under CC BY-NC 4.0
Create this device now! 🪄
Connect your ESP32 / ESP8266 microcontroller to the USB port of this computer, select the desired firmware version, and click the "Create device" button to upload HomeGenie Mini firmware to the device.
1. Select device type
2. Select firmware flavor
3. Let the magic happen!
Installing firmware directly from this page works only in browsers with Web Serial API enabled.
See the Device setup page for further information about configuring a HomeGenie Mini device.
Source code
This firmware pre-compiled binaries and source code are available on GitHub:
folder_open smart-sensor folder_open smart-sensor-display
Modules and API
In addition to the common Device API, the following modules and API are implemented by this device.
mini
module
Built-in sensor module.
Domain / Address
HomeAutomation.HomeGenie/mini
Properties
Sensor.MotionDetect
Sensor.Luminance
Sensor.Color
Sensor.Humidity
Sensor.Temperature