Skip to content

stiamon77/AQST-MS

Repository files navigation

AQST-MS

Occupancy\Motion sensor HLK-LD1115H-24G ESP32 or ESP8266 Arduino with integration to Home Assistant.

Buy me a coffee https://paypal.me/StanislavTimofeev )

Main file AQST-MS_v2_1.ino

See the documentation for the sensor in the folder Documentation HLK-LD1115H-24G

and in https://h.hlktech.com/Mobile/download/fdetail/183.html

Home Assistant integration

Image alt Image alt

To get started we will need:

Main board:

ESP32С3 SuperMini This is a very small board with a powerful chip and WiFi on board, it is ideal for our project and I recommend using it, the following boards are also suitable for us:

or

ESP32-S2

or

ESP8266 D1 MINI V4.0.0 I recommend this version of the board with ESP8266, it is more stable than options with an iron screen, I don’t know why)

and

1x USB-C PD Trigger allows you to connect any charger for phones or gadgets to our device

1x Capacitor 6.3V 470UF to ensure stable power supply to the device we need one capacitor (6.3V 470UF)

1x BH1750 this is a light brightness sensor

1x HLK-LD1155H-24G Microwave Radar Sensor Detection Motion Module

1x LED WS2812B if you are making several devices, it is more profitable to buy 1 meter of LED strip consisting of WS2812B diodes, it will be cheaper. The tape must be cut one LED at a time and used as indicated in the diagrams below. If there is one device, then there is a WS2812B module with this LED. Choose the smallest one.

ABS Plastic Case And of course, I specially selected the right case to accommodate all the electronic stuffing. See below how to place everything in it correctly and where to make the holes. You can choose a suitable color, black or white.

!When installing the sensor into the Plastic Case, remember that the distance from the antenna on the front side of the sensor to the Plastic Case wall must be at least 5-6mm.!

UV Bonding & Welding Glue This is not necessary, but to make beautiful holes for the light brightness sensor and LED, this glue will be useful. It is transparent after drying.

HSS Straight Groove Step Drill This is also not necessary, but beautiful holes can be made using a step drill.

Motion Sensor Holder To attach our motion and presence sensor to a wall or ceiling, we will need a rotating mount. I liked this one, but something like this will do 360 Rotatable Magnetic Holder it has its advantages and you can choose the color ) .

Connecting the sensor to the power supply:

Since our device requires constant power from a USB charger, you need at least 2a (look at the power supply, your old phone charger with USB will do). And since the device will hang on the wall, it is more convenient to make the power cable yourself; for this we need a wire (you can buy it at an electrician’s store) and contacts USB and USB-C. See the connection diagram below.


Connection to Home Assistant and setup instructions:

Connection:

Connect the device to power and briefly press the button once. For ESP32, this can be the BOOT button if you specified TRIGGER_PIN 0 in your sketch.

After this, the device will create a WiFi network AQST-MS-.........-CONFIG. From any device (smartphone, tablet, laptop, etc.) connect to this network. The device settings menu will automatically open. If this does not happen, open your Internet browser and open the page with the address 192.168.4.1

Enter your WiFi network details and the IP address of the Home Assystant server. Click save. After this, the device will reboot and connect to HA. All settings will be saved in the device memory. If you need to change them, click the button and repeat the settings.

If you changed mqtt settings, login and password (mqtt), change this data in the code. If not, then this is the default login and password; you do not need to change them.

If you changed the Led connection port, then change it in the code

For ESP8266

#if defined(ESP8266)

#define DATA_PIN 0 //esp8266

And for ESP32

#if defined(ESP32)

#define DATA_PIN 10 //esp32

Once enabled, the sensor will automatically connect to HA and appear in MQTT devices

Reset settings:

You can also completely reset the settings by pressing the button and holding it for more than three seconds.

Setting:

Our sensor is equipped with an LED to indicate detection, if it detects the presence or movement of a person, the LED lights up red, otherwise it turns green. With the “Led On-Off” setting you can turn the indication LED on or off.

"Led Bright" allows you to adjust its brightness.

“Reset to default (settings only)” allows you to reset the settings of the LD1115H sensor to factory settings, after clicking this button, click the “Save settings” button.

“Save settings” After setting the sensor sensitivity, press this button to save the data into the sensor memory.

“Motion sensor (TH1)” is a motion detection sensitivity setting. The factory setting is 120, this is the maximum sensitivity (about 4-6 meters), if you increase it the sensitivity will decrease, this is necessary if your room is small and you need to avoid detecting movement behind the wall.

Changing data below 110 is not recommended; there will be many false positives.

“Occupancy sensor (TH2)” is the sensitivity of presence detection. When a person is in a room and does not move. Works normally within a radius of 2-3 meters. The factory value of 250 increases the sensitivity and detection range, but may also increase the possibility of false alarms.

You need to configure the parameters to suit your conditions. Find a balance between sensitivity and eliminating false positives.


You can ask your questions or suggestions here


Recommendations for placing sensors in a room:

The sensors must be located at a distance of more than about 0.5 meters from each other.

The sensors should not face each other. Their rays should not intersect.

Do not place sensors near outlets or other electrical appliances.

Do not point the sensors at a fan or air conditioner; shaking surfaces may interfere with the sensor's operation.

It is optimal to place the sensor on the wall, at a distance of 80-100cm from the floor. Or on the ceiling.

If a person sits quietly with their back to the sensor, the sensitivity effect will be reduced. Because when the back is turned to the radar, the chest or abdomen subject to vibrations are not visible to the sensor.

See the documentation for the sensor in the folder Documentation HLK-LD1115H-24G

Connection diagrams:

ESP32-C3

Image alt

ESP32-S2

Image alt

ESP8266 D1 Mini V3-V4

Image alt

About

Occupancy\Motion sensor HLK-LD1115H-24G ESP32 or ESP8266, Arduino, connection to Home Assistant, Human Presence Sensor Radar

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages