Reed Switch Sensor


I need to connect a reed switch that measures the volume of water. The specifications that I have on the switch are

  1. Reed Switch (EV) Sensor
    A magnet activates this sensor. It acts as a “Dry Contact” and does not consume electric power. This is the most suitable sensor for “VOLUME” related functions and in such applications, its operating life is practically unlimited (ca. 10^8 cycles).
    Electrical specifications:
    a. Max. contact current - 50 mA
    b. Max. contact voltage - 48 V

Can I connect directly the switch to a digital interrupt pin of my Arduino (Nodemcu)? Do I need to regulate the voltage? How to do it?

It's a switch.
The volts you put in is the volts you get out.
If you supply 5 volts in you will get 5 volts out.
I recommend a resistor (470 ohm) inline because accidents happen.

No need for any resistors.

Wire it as a regular switch between pin and GND, enable the internal pull-up (so don't use GPIO16, it's got a pull-down - check the manual where NodeMCU mapped the thing as I can't bother to try and remember their nonsensical mapping and numbering).


If the switch is a long way from the Arduino a pull-up/down resistor , say 1k might help noise reduction.

If its a long distance, use a 100nF capacitor to short out EMI.