Comments on: Hack a PIR Motion Sensor with an ESP8266 https://randomnerdtutorials.com/hack-pir-motion-sensor-esp8266-hlk-pm03/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Wed, 30 Oct 2024 14:09:58 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Mario https://randomnerdtutorials.com/hack-pir-motion-sensor-esp8266-hlk-pm03/#comment-977970 Wed, 30 Oct 2024 14:09:58 +0000 https://randomnerdtutorials.com/?p=80644#comment-977970 HI,
I had the problem of entering MQTT user and password and I made these changes:
I included in the declarations

const char* MQTT_username = “your user_name mqtt”;
const char* MQTT_password = “you pw mqtt”;

in the reconnect function this change:
if (client.connect(“NodeMCUClient”, MQTT_username, MQTT_password)) {
instead of:
if (client.connect(clientId.c_str())) {

and the mandatory loop function:
void loop() {
}

Once these changes have been made everything works perfectly.
Thank you

]]>
By: Sean https://randomnerdtutorials.com/hack-pir-motion-sensor-esp8266-hlk-pm03/#comment-801951 Sat, 10 Dec 2022 14:10:26 +0000 https://randomnerdtutorials.com/?p=80644#comment-801951 In reply to Sean.

Edit – just to be clear I mean have the tap the line voltage with the HLK-PM03, not deliver line voltage to the board. Then I would imagine another HLK tapped off the red. That way you could still allow the lights to function as normal but make them “smart”.

]]>
By: Sean https://randomnerdtutorials.com/hack-pir-motion-sensor-esp8266-hlk-pm03/#comment-801950 Sat, 10 Dec 2022 14:07:44 +0000 https://randomnerdtutorials.com/?p=80644#comment-801950 Question – just getting started with messing around with some builds so very new to this. Is it possible to have the board tied to the line voltage so it is always powered and then just have it sense when the red is triggered? Any advantages to it always being online? I’m thinking something along the lines of Home Assistant integration.

Thanks!

]]>
By: Sara Santos https://randomnerdtutorials.com/hack-pir-motion-sensor-esp8266-hlk-pm03/#comment-794561 Thu, 27 Oct 2022 21:07:04 +0000 https://randomnerdtutorials.com/?p=80644#comment-794561 In reply to Valery.

Hi.
I didn’t measure the time but if I remember correctly, it was almost instantly.
Regards,
Sara

]]>
By: Valery https://randomnerdtutorials.com/hack-pir-motion-sensor-esp8266-hlk-pm03/#comment-794549 Thu, 27 Oct 2022 19:43:54 +0000 https://randomnerdtutorials.com/?p=80644#comment-794549 Thank you for sharing this interesting custom solution. How long does it take from the moment the PIR sensor is turned on to the indication on the MQTT server? How long does the ESP8266 boot up?

]]>
By: Dno https://randomnerdtutorials.com/hack-pir-motion-sensor-esp8266-hlk-pm03/#comment-534287 Mon, 28 Dec 2020 22:42:15 +0000 https://randomnerdtutorials.com/?p=80644#comment-534287 This is a great step by step description, as many others on this site. I think the circuit is somewhat overcomplicated with double ac to dc convertion: first on PIR itself and second is by HLK-PM03 unit. Is it not easier to connect to PIR’s low voltage circuit (and convert it if needed to 3.3V)? Definitely safer as you wouldnt be connecting mains voltage to your prototype pcb in such case (with 5mm clearance between neutral and load!)

]]>
By: Stefan https://randomnerdtutorials.com/hack-pir-motion-sensor-esp8266-hlk-pm03/#comment-442663 Fri, 03 Apr 2020 14:20:23 +0000 https://randomnerdtutorials.com/?p=80644#comment-442663 In reply to Sara Santos.

Hi Sara,

Thanks for your comment!
This sounds very promising.
And thanks a lot for this great article!

regards,
Stefan

]]>
By: Sara Santos https://randomnerdtutorials.com/hack-pir-motion-sensor-esp8266-hlk-pm03/#comment-442002 Wed, 01 Apr 2020 15:41:10 +0000 https://randomnerdtutorials.com/?p=80644#comment-442002 In reply to Stefan.

Hi Stefan.
In our experiments it was almost instantaneous. But I think it depends on the motion sensor you use.
We didn’t notice much delay in the response.
Regards,
Sara

]]>
By: Stefan https://randomnerdtutorials.com/hack-pir-motion-sensor-esp8266-hlk-pm03/#comment-441994 Wed, 01 Apr 2020 14:45:56 +0000 https://randomnerdtutorials.com/?p=80644#comment-441994 Hi, how fast does the motion sensor react?
I mean, powering up the ESP8266 already takes some time.

Regards,
Stefan

]]>
By: Sara Santos https://randomnerdtutorials.com/hack-pir-motion-sensor-esp8266-hlk-pm03/#comment-428186 Mon, 10 Feb 2020 10:39:52 +0000 https://randomnerdtutorials.com/?p=80644#comment-428186 In reply to negrito.

Hi.
Just replace BUILTIN_LED with 2.
pinMode(2, OUTPUT);
Regards,
Sara

]]>