Reed Switch and Unwanted Signals

I have a trouble with my weather station project. My weather sensors are based on reed switch (hall effect sensor). These sensors are sometimes strange. For example: Rain gauge sensor send signal to Arduino, but my sensor is still in my attic room (no rain :slight_smile: ). I observed these signals are coming sometimes when I press wall switch and light up fluorescent tubes in my garage. :confused:

I use 10Kohm resistors, tryed 20Kohm resistor but no results...

Thanks for everybody for your help.

The 10k resistor makes the circuit impedance 10k. That means it is sensitive for electric noise.

The hall sensor on the left didn’t get a pull-down resistor. Why ? he’s been bad ?
Which hall sensors are they ? Most hall switches have strong (low impedance) output.
If they are open-collector or so, you need resistors. I would try 4k7 or 2k2 or so.

Perhaps the voltage of the hall switch needs to be decoupled.

When your circuit is sensitive for turning a wall switch, I would use an RC filter for the hall signal.

Are there long wires somewhere ? To the hall switches or to the Raspberry Pi ? Long wires are like antennas, they collect electric noise.

My weather sensors are based on reed switch (hall effect sensor)

Which is it. The two things are very different. If it is a hall effect sensor do not draw it as a reed switch. No excuse, do not say "because they didn't have a symbol", make one or better still don't use Fritzing it is crap.

Grumpy_Mike: I am sorry, I thought Hall sensor and reed switch is same part :confused: I edited my first post. These sensors are really based on reed switch.

Wind direction is simplified (It is based on cca 8 reed switches and diferent resistors)
There are 2 long UTP cat5e cables. One cca 25m long cable for DHT21 and one 10m long cable for I2C and power.
I will try disconnect DHT21, but in my home I have security systems with door and window sensors which is based on reed switches too and their cables (very similiar like UTP) are too long. How it is possible?. I will try to check some information about RC Filter. Thanks

A hall sensor is an electronic sensor, a reed switch is a magnetic contact in glass. Okay, reed switches it is.

A DHT21 with 25 meter long cable, does that even work at all ?
I assume the DHT21 decouples the power inside, but an extra capacitor (100nF or more) to 5V and GND at the sensor can’t hurt. Lower the impedance of the signal wire. Use 4k7 or 2k2 or 1k5 instead of 10k.
I don’t know what the lowest value is, in the datasheet they use 1k.

Using 10 meters cable for I2C is not possible. I’m sorry, but 10 meters is too long for a normal I2C bus.

The reed switches have a resistor of 10k. Lower that value to 1k or 4k7 or so. Use a filter if the wires to the reed switches are a few meters.

Pullup and pulldown resistors of 10k can be used for sensors that are right next to the Arduino. The impedance of that circuit will be 10k, and electric noise could cause spikes in that circuit. The industrial way to deal with this is the 4-20mA current loop ( ), and RS-485 ( ) which is designed for long wires, or using opto-couplers.

If you open your security system, you probably see filters or even opto-couplers. The security systen can’t afford to be destroyed by voltage peaks from the long wires.

I'm intrigued to know how a simple reed switch, ie off or on, provides data about wind speed, wind direction or rain......