Monitor reed switch with digital IO

Jun 12, 2021 Last reply: 5 years ago 15 Replies

Hello,



Is it possible to buy a reed switch which is 12v powered, and depending on the status of the switch has an output pin that is either 5v high or 0v low?



Does such a part exist, or is a device like this already made? I could not find anything.



Thanks



Al


søndag den 13. juni 2021 kl. 01.44.07 UTC+2 skrev snipped-for-privacy@gmail.com:

a reed switch is just a switch, it isn't powered

Then I need a component/board which takes 12v in, and depending on the state of the reed switch gives 5v out for high or 0v for low.

Like this but supply volts is 12v

formatting link

Perhaps for the distance, and drop it to 5v or 3v3 for the input. Make sure you really want 5v and not 3v3. Just use a resistor divider, not much current needed.

Because everything on a boat is 12v.

and most i/o ports are 3v3:

formatting link
just use a resistor divider (i.e. 870 and 330 ) and short the tap to ground with the reed switch.

I am not using a RaspPi - that circuit was just for example.

A reed RELAY taking 12V to drive, is that what you mean? You can get two-pole reed relays, and one can switch input to (for instance) a 12V-to-5V regulator (or voltage divider).

This one is double-pole double-throw, kinda... universally useful.

formatting link

Try digikey.com. They used to have such devices. They're just a relay, so you would have to provide the 5 volt supply.

Hul

Al Grant snipped-for-privacy@gmail.com wrote:

This is very simple. Use two resistors, say, 1K ohms and 1.5K ohms. Tie one end of the 1.5K ohm resistor to 12V and one end of the 1K resistor to 0V. Tie the other two ends together. This point will be about 5V to ground with a few mA of current flowing. Connect the reed switch to the common point and 0V. Now, when the switch is open the common point will be about 5V and when the switch is closed the common point will be 0V.

Since the electrics on a boat may have the same problems a car does, large voltage swings, the 1K resistor might be replaced by a 5V Zener diode. Then that voltage will not rise if the power voltage rises. A 0.1 uF cap might not be a bad idea either for higher frequency noise. You can put all these components by the input that is detecting this voltage and only run a pair of wires to the switch or even one wire if there is a good ground connection near the switch. Boats tend to be fiberglass though, so maybe the pair is needed. Any thin zip cord is good since the current is less than 10 mA.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required