Mini PIR Sensor

Mini PIR Sensor

Mini PIR Sensor

I bought some of these mini PIR sensors on aliexpress, for the occupancy detector part of my ongoing NoTLamp project. They can be found for just under 1 UKP each. I want the NotLamp to work efficiently as it will be powered all the time. I also want it to all work from a single simple power supply and have chosen 3v3 as the lowest common denominator. I am taking the decision to work at 3v3 more often than 5V these days as so much is produced with 3v3 in mind. A big annoyance is the amount of 3v3 boards etc that are made 5V compliant and then used with other micro-controllers (ESP8266) or Pi’s that are 3v3. Very wasteful of both parts, and electrons. This picture shows the mini PIR sensor on top of a business card and next to a 20p piece so you can get a feel for how mini it really is. These little units are very simple with nothing to adjust and no daylight sensing, they are aimed at whole raft of people sensing switches etc and are designed to work across a wide voltage range from 4.5V up to around 20V. They have the part number DYP-ME003SE-V1 but can also be found online as an HC-SR505. These look to be almost identical bar the addition of a single capacitor on the front. I could not find any schematic for them which was disappointing, all the links claiming to point to a schematic take you to a schematic for the HC-SR501 the bigger brother to this one which uses a larger BIS0001 PIR chip.

Mini PIR Detail

Mini PIR Detail

These pictures show both sides of the board close up and side by side. In the left one you can see a 3v3 linear regulator and polarity protection diode, Those and the PIR detector at the top of the board look to be the only parts that are common between the two types of PIR sensor mentioned above. The IC is half the size of the BIS0001. The output is a 3v3 logic signal. Looking at the left hand image there is an unpopulated footprint to mount an S8050 NPN transistor for switching a relay or level translating the signal. You will also need to remove R1, just next to it if you want to do this. The presence of the 7133 3v3 regulator though is promising for my application as it shows that the circuit itself actually does run at 3v3. Just for the hell of it I tried the PIR at 3v3 and 5v to see how it did. It preferred 5V and worked reliably but dropping the voltage to 3v3 (Actually the test Arduino was putting out 3.73V) gave some interesting results. The device powered up and seemed to work OK but after triggering the detector the first time it re-triggered itself cycling on and off for its pre-set delay period. I counted the delay and it was around 10 seconds give or take a bit. Probing the underside of the board I found that for 3.73V in the protection diode was dropping about 0.2V giving 3.55V and the low drop-out (LDO) 3v3 regulator appeared to be dropping nothing. This was not very promising as the board should run at 3v3, given the presence of the regulator. Time to warm up the hot air pencil and iron then perform some surgery.

Modified PIR

Modified PIR

I first removed the regulator, and consulting a data sheet for the pinout, shorted the Vin to Vout pads where the regulator used to be. You can see how I did this in the before and after shots in this picture. Powering it up from the same source I checked the voltages but found it was performing exactly the same cycling of off to on all the time. So the cycling problem was not the regulator struggling with the low voltage. The voltage on the board side of the protection diode now measured 3.55V so given that PIR detector draw crazily low currents it should be working. But wasn’t. Given it was not looking very promising but I could not figure out why I removed the protection diode and placed a short across those two pins. Completing the modifications in the pictures. Now It worked fine exactly as it had done at 5V but now at 3.7V. So these were the mods that were needed to make the units I have functional at 3v3. Given the strange results we had been getting I hooked up the board to my bench PSU and an accurate multimeter and set the voltage for a real 3v3 and also took the board down to 2.9V in both cases it worked fine. So the issue had not been the actual voltage level as such. I can only think that there is insufficient capacitance across the power rails on the board and at low voltages the turn on/off glitches were enough to re-trigger the detector. Odd, not seen this problem before, but there you go.

In summary a nice little unit, very cheap, hours of fun can be had with them in your projects, watch out for the self re-triggering and it will work comfortably down to 3v3 if you remove the regulator and diode, then short the correct pads to make a straight through path for the supply voltage.

6 thoughts on “Mini PIR Sensor

    • Solipso

      Many thanks for that it is really useful. My Chinese is pretty awful but I could follow the schematics OK which are the important bit. Wish I had that when I set off to do the hack it would have saved me a little time.

      Cheers

      Andy Kirby

  1. I need help,once it activates it takes 8 seconds or more to re-activate again..I need to be 1 or 3 seconds,It says you can customize the timing but i dont know how and dont have arduino..Helppppp..Thanks

      • Apologies for the delay in getting back to this one, just seen it.
        Co-incidentally I also just saw the posting below from PAFMelb36. It looks like the solution you are looking for may be in the suggestions there. Granted PAFMelb36 was extending the time period and there are limitations as to what you can achieve. But in your position I might attempt reducing capacitance values rather than increasing them and see how it goes.

        Thanks PAFMelb36 I didn’t have an answer to this post until I had seen yours.

        Andy Kirby

  2. Likewise: really useful reference, apart from the squiggly writing. The hack I needed was to increase the on-time of the module to around 40 seconds. Did not fancy trying to solder a 5nF cap across the existing 1nF chip capacitor but worked out that a parallel cap from pin 7 to ground is functionally equivalent (thanks again for the diagram reference). It’s still fiddly soldering to the chip’s pin but do-able with a small iron and before cocktail hour. The time scaling is pretty good. Main variable is in the capacitor tolerances, so don’t expect laboratory timing.

    These chips are made without the ability to vary the blocking time (dead time between triggers) That is one of the ways they get them down to 8 pins vs the 16 pins of the better documented BISS001. It looks like the EG4002 is made in a number of variants which differ in the ratio of output time to dead time. Which variant you get in your module from Ebay et al is up to chance. If you use it in “retriggerable” mode it should not matter as the blocking time feature is (should be??) disabled.

    For those newer to hardware hacking the formula for the time multiplier is (C+C’)/C
    where C’ is the added capacitor in nF, and the C is the value of the inbuilt capacitor which seems to be 1nF, but may vary from manufacturer to manufacturer. My modules seemed to all have the 1nF cap that the manufacturer’s application note shows. So my results using a 4.7nf cap were 5.7 x Tx, or from 7 seconds to 40 seconds.

    Other thing to be wary of is that the mini-mini modules, unlike the bigger versions (usually called HC-SR501) don’t have an output limiting resistor, so you better not connect the output directly to the base of an NPN power transistor, something you can do with the HC-SR501.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.