[SOLVED] Unexpected turn on the light by PIR in my project

Hello all!
This is the continuation of the topic [SOLVED] Problems with sketch`s work in rainy weather

I’ve been watching my smarthome system on local Blynk server for two months now.
In all of my rooms installed D1 mini with PIR sensors HC-SR501, relays and photoresistors (separate power 5volt, minus wire connected across resistor, data wire connect to A0 ), that turn light when I need it. It’s very strange , but sometimes pir detectors turn lights with no reason. At first I thought it was interference from 220v power wires. Then I reversed pins connection of sensors on D1 mini- and unexpectedly turn ONs of light stopped for a while. A week after the pins shift, the situation repeats, but in other rooms.
That is, false triggering of sensors migrates from one room to another. The sensitivity of Pirs here, too, nothing to do with, cause in different rooms Pirs set up to different sensitivity.

Still there is such a moment - the humidity readings of DHT11 module sometimes sink by several dozen units. Also without a reason- I see it on my history graph widget.

I broke my brain trying to solve this, guys.

Any ideas?

There seems to be many issues with PIR and ESP… https://www.google.ca/#q=pir+issues+with+esp8266

I can’t find it yet (will post it when I find it), but I watched a video on someone testing differing types of PIR sensors and he found one that worked very well.

As for the DHT11… it is almost junk. Mine also has jumps and dives in both temp and humidity for no apparent reason… but after all it’s sensitivity range is a whopping ±2 deg.

It`ll be great to see a model of work one)
I suspect that false positives are directly related to voltage jumps in 220volts, so the dht11 freaking work depends on it too.
And of course RF frequensy forced it to work.

I can’t find the video I was thinking of… however there are many references to the RF interference issues of these cheap PIR sensors. Keep them further away from the ESP seems to be one solution.

@Pacer, just my 2 cents:
both HC-SR501 and dht11 are junk sensors (this reflects also on they price). they are ok for playing around, but for production version not recommended.

also, if you read the docs of these pir sensors, they are sensible to several factors, like: wind, strong light, heat sources, etc. than the esp and mains noise also adds problems.

the pir motion sensors are 2 category: for lights activation (all cheap ones, they usually work directly from mains) - expect lots of false triggers from these. the second category is the motion sensors used in alarm systems: they provide much lower false triggers, digital signal processing, much better immunity for harsh / noisy environment, and usually work with 12v dc. they can not turn on / off mains directly, just sending a low current signal. if reduced false trigger is important, for a good price / quality ratio you can check the paradox dg75 series or dg85 for outdoor use. they are quite relaible.

regarding the dht11, they are junk by default, do not use them. i recommend at least dht22, or even better bme280 (temp, hum, pressure) or ds18b20 (temp only, but high precision and waterproof).

here is a good article about temp & hum sensors:


@Pacer I’ve tried numerous PIR sensors with a few different ESP8266 and Arduino varieties with very little success. Most common PIR sensors, especially ones from China, tend to be very unreliable. I’ve tried at least a dozen different techniques to reduce false positives, but in the end, I’ve given up.

HOWEVER, I’ve had really good success with some of these new “microwave radar” boards for motion sensing. I don’t know if they are truly “microwave radar” but that’s how they are advertised. My favorite is the XYC-WB-DC module. I got it off eBay for about $1.45 each. Here are a few links to explore:
eBay purchase: http://www.ebay.com/itm/5-8GHZ-3-8m-DC-Microwave-Radar-Sensor-Smart-Control-Switch-Module-For-Home/232347286749?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649

Datasheet: http://blogmasterwalkershop.com.br/arquivos/datasheet/Datasheet%20BISS0001.pdf
Application Example: http://www.adrirobot.it/datasheet/speciali/pdf/BISS0001.pdf
Notes from Pete Scargill: http://tech.scargill.net/microwave-radar/

These things are pretty cool. They actually do work through walls, which can be good or bad, depending on your application).

Hope this helps.


Thanks for your opinion. Yeah, I should look on the security sensors.
About DHT22. I have one connected. And , yeah, this one works with no problem.

Thanks for help. When I last looked towards the microwave radar they were huge and cost much more than 1.5 bucks. Will try to understand its datasheet.

Check this video about them.


Very useful video, Gunner!
I think this small devices is panacea of smart home automation))

Hello ALL!
I bought a couple of radars (RCWL-0516 and HFS-DC06) from this video.

And what you think ,guys? They have more false triggering than HC SR501!

Radars catchs WiFi waves and false triggers become unlimited more often.

Try to make Pi Filter from two capacitors and resistor like int this source :

But nothing happens… False triggers not end. Any ideas?

You would have to send me a couple to test :stuck_out_tongue: otherwise your guess is better than ours… since you can physically test them.

What kind of sketch are you using to do the testing with, what does the documentation say about placement and usage of these type of sensors, etc?

I was thinking of some form of physical shielding, along the lines of directional RF antennas and such, using grounded shields, etc, then I saw in that link that someone else had already tested somthing like that to some positive extent.

But honestly, it sounds simpler to simply extend the range between the sensor and the ESP… perhaps also use shielded wire as used in RF equipment and microphones, etc.

shielded wire… hmm… Let you know, after I test it.

1 Like