Outdoor sensor

Hi guys,

I have built a few outdoors Arduino and pir sensor(HC-SR501) hacks. But i get really unreliable behavior outdoors.

Can be everything from hanging, to sensors firing when it shouldn’t or don’t fire when it should.

I should also mention it has been cold and rainy when running the stuff. The things have been built into boxes but it is still really cold. No heating or isolation.

Do the things work really poor outdoors?


If moisture gets in, the circuitry will either malfunction, or be destroyed completely by corrosion.

Hi jremington,

Thanks for the answer.

I have a feeling it is not moisture. There is no sign of it in the circuitry. The things are only running for a few days so i dont think it will be destroyed completely by corrosion.

Can it be the cold that cause it to fail?

Can it be i am using the cheap china stuff. Would it be diffrent if i used better components.

Has anybody had the same problems?

I have a feeling it is not moisture.

I have a "feeling" that it is. Condensation that you can't see is most definitely a problem.

Can it be the cold that cause it to fail?

Most likely not, but temperature changes cause condensation.

Hi jremington,

Thanks for the help. I will try to build in some heating and insulate the box. So i can keep a controlled temperature.

Can't be sure until you actually describe what it is you're building. The way you call it a PIR 'hack' tells us nothing other than the likelihood that you are operating out of normal operating expectations or some such.


Sorry for the vague info.

This is what i built

The electronics consists of
1 x Ardurino uno
5 x Relays (Relay Module DC AC 220V)
1 x USB SD/SDHC U-disk MP3 Shield
1 x SR501 HC-SR501 Adjust IR Pyroelectric Infrared PIR module Motion Sensor

Does the thing you built work as it should reliably when indoors?

Yes but when indoors i have only tested it for a little while. But when outdoors it have been running 24/7 for a few days.

First it works great for a few hours and then it acts strange. Then it works great again and so on..

Okay, here's a crazy idea- test it indoors long term before you start blaming the outdoor factors as the culprits.

Sorry true, but I had same result with other builds that have been running indoors for days

There are things like pir sensor acting really strange. triggering when it shouldn’t and the opposite. I have not seen this when inside.

pics of the electronic boxes

What makes you think false triggers are false? Are you there to witness nothing present when it is triggering, or is it possible the triggers are real like from wildlife?

Those particleboard boxes don’t exactly look weather proof to me. I prefer to use ready-made plastic boxes for outdoor use.

I found basically two ways to stop condensation from ruining your electronics.

  1. seal your box very well (as in VERY well: rubber gaskets & screws, not click-clack tupperware, and screw gaskets for the wires that go in and out). If not sealed well, air pressure differences due to temperature will suck in water. Potting in epoxy is another way of very thorough sealing.
  2. make sure your box ventilates well. Some openings in the bottom work great. You may still get condensation in 100% humidity conditions (a common occurrence in my climate; don’t know about yours). The heat from the electronics (keeping the inside a few degrees above ambient) is enough to stop that from happening usually, and conformal coating is a good idea as well.

Hi wvmarle

So your saying my boxes won’t pass the ip68 certification :slight_smile:

I think i will try you 2nd option maybe also add some extra heating system to keep the tempratue in the box up a bit.

Have you experienced simular problems?

What makes you think false triggers are false? Are you there to witness nothing present when it is triggering, or is it possible the triggers are real like from wildlife?


Yes I am quite sure. It is in both triggering when it shouldn’t and not triggering when it should. No wildlife close by

I've never played around with PIR sensors, but I have several devices installed outdoors for several months now and no signs of weather effects. Hitting the wet season now...

I don't think heating is necessary for your boxes, at least in my case the electronics themselves do just fine to keep the inside a few degrees above ambient, which in turn should be enough to keep most moisture out or at least stop it from condensing (which happens normally when an object is cooler than the surrounding air).

For your false triggering: make sure it's an actual trigger of the sensor, not noise on the line (the first usually lasts a second or more depending on your sensor; the second much shorter). You can do this in software by checking back one or two times with say 100 ms intervals. If there is noise, a small filter cap (100 nF) and/or a stronger pull-up resistor should help to stop this from triggering the Arduino.

I can confirm these observations. They don't seem to work as well outdoors.

Testing it under semi-controlled environments yield that even leaves can trigger it. Have some more testing to do regarding the "Warm-up" time of these things but so far im sure it has nothing to do with moisture.

I thought that that triggering by leaves had been solved by now.
It was a major issue 20-30 years ago when those things were quite new. Leaves/foliage usually has different temperature than the air surrounding it...