Apply 5V to Mag Reed Switch

Thread Starter

BPet

Joined Oct 30, 2017
25
I am looking to connect a reed switch to my garage door and then use some home automation software to show opened and closed status.

The switch says it is rated:
Current: 0.5A ; Voltage: 100V ; Power Rating: 10W; Action Distance: 15mm

I have an IO Device that will sense the change in voltage to trigger.

Can I simply connect the hot wire from a 5V USB style wall charger to one of the wires from the switch. Then connect the other wire from the 5V charger to my Home Automation IO Device pin1. Then the other wire from the Switch goes to Pin2 to complete the circuit.

I know this works: Is it safe? So the wall charger is sending out 5V 24/7 through the switch, although maybe not much current because nothing is being powered?

thanks for any advice about the safety of this.
 

Reloadron

Joined Jan 15, 2015
7,580
You would connect things like this:

Pullup.png

Vout would go to your DIO pin on whatever you are using. R1 is 10K Ohm. When your switch is open Vout is Vcc so Logic High and when your switch closes Vout goes low to about 0.0 volts. You write your code accordingly. One problem using magnetic reed switches or any switch at the top and bottom (open & closed) is when the door is in any position other than full open or closed you have no idea exactly where the door is. I am assuming two switches. Vcc in this example would be your 5.0 Volts. The R1 10K will keep your switch current limited to 5.0 volts / 10,000 = 0.5 mA well below your switch limit. You write your code accordingly. Make sure whatever your uC (micro-controller) is and your 5.0 volt supply share common ground.

Ron
 

Thread Starter

BPet

Joined Oct 30, 2017
25
You would connect things like this:

View attachment 322401

Vout would go to your DIO pin on whatever you are using. R1 is 10K Ohm. When your switch is open Vout is Vcc so Logic High and when your switch closes Vout goes low to about 0.0 volts. You write your code accordingly. One problem using magnetic reed switches or any switch at the top and bottom (open & closed) is when the door is in any position other than full open or closed you have no idea exactly where the door is. I am assuming two switches. Vcc in this example would be your 5.0 Volts. The R1 10K will keep your switch current limited to 5.0 volts / 10,000 = 0.5 mA well below your switch limit. You write your code accordingly. Make sure whatever your uC (micro-controller) is and your 5.0 volt supply share common ground.

Ron
Ron,
Thank you very mich for your reply! Unfortunately, I don’t know alot about circuits and so I don’t really understand.

Maybe this helps: The IO that I am using is a UPB wall plug that has pins on it to accept the voltage change input, UMI-32
http://www.simply-automated.com/documents/452-0003-0001_RevF_UMI_UserGuide_111130.pdf

So, when the switch is triggered, it sends a signal to my automation software over the UPB protocol. I already have it coded in my system and hooked up and it works fine, I’m just wanting to know if it’s safe?
Are you saying I need to get a Resistor and wire that in and if so, can you explain where to put it in layman’s terms? :)
Is it something like this from Amazon?
100pcs 10K ohm Resistor 1/2w (0.5Watt) ±1% Tolerance Metal Film Fixed Resistor, Multiple Values of Resistance Optional


(The UMI-32 has two othe N.C. Type inputs, but I am using them for other devices. That’s why I have to use input #1 in Voltage Sensing mode)

thanks again!
 

Reloadron

Joined Jan 15, 2015
7,580
OK not what I expected but yes, to answer your question it is safe. Your 5.0 volts (up to 30 volts) acts as a trigger. Anyway, yes, it's safe.

Ron
 

MisterBill2

Joined Jan 23, 2018
19,474
OK, NOTHING needs that "ground" connection. The circuit in post #2 is OK, except that the Vccis actually the +5 volts from your supply, and that "ground connection is actually both the negative terminal of your 5 volt supply and the digital input common side of your monitoring device.
 

LowQCab

Joined Nov 6, 2012
4,314
Long Wire-runs can easily pickup Electrical-Noise and cause crazy operation.
Use Cat-5 Networking-Cable, ( 1-Twisted-Pair ), to connect to your Controller.

Hopefully the "Wall-Charger" that You are planning to use has a reasonably well Filtered-Output.
Not all of them are "quiet", and You will be injecting any Noise it produces into your Controller.
.
.
.
 

panic mode

Joined Oct 10, 2011
2,892
I am looking to connect a reed switch ...
is this really a reed switch... or something else? how many wires it has? what is the part number?
if it is a plain old reed switch, everything stated above still applies. but if this is one of the industrial "reed switches" that have built in electronics, this may be a bit tricky to operate at such low voltage. those product are normally meant for 24V and just about all will also operate at 12V too... but 5V may be pushing it, at least for 2-wire versions with LED indicators. they tend to have high voltage drop of couple of volts so at 5V you may not see change that would trip the GPIO levels.
 
Top