Can I connect reed switch with microcontroller using 15 meter cable ?

cmartinez

Joined Jan 17, 2007
8,775
I've had some experience dealing with small non-differential signals at long distances. My advice is (other than the esd protections at the mcu already mentioned) use shielded cable, and also use a pull up resistor close to the mcu and another pull up resistor close to the switch. Two 4.7k resistors should do the trick, although you may experiment with 10k too, if you want to keep the drawn current to a minimum. This arrangement prevents capacitance buildup in the cable itself.
 

Ivan Dodig

Joined Jun 21, 2015
1
An opto isolator used in a non-isolated circuit is a bit of overkill.
If you do use one, make it a slow, cheap one.
Speaking of opto-coupler, is there any valid reason for using an opto coupler without using the isolation, i.e. on the same ground?
I simply don't see it, placing a good RC filter does the job.
 

GopherT

Joined Nov 23, 2012
8,009
Speaking of opto-coupler, is there any valid reason for using an opto coupler without using the isolation, i.e. on the same ground?
I simply don't see it, placing a good RC filter does the job.
Using optocouplers on the same ground is done if using them for level shifting or high-side switching.
PS, good work making your first post today after 2.5 years of membership!
 

ian field

Joined Oct 27, 2012
6,536
Hi all,

I want to connect reed switch with Microcontroller .
The distance between the switch and Mcu about 15 m .

Can I connect the switch with only pullup resistor to Mcu ?

Regards :)
You might just about get away with twisted pair - I'd consider a current loop with a slave relay closer to the pin.
 
Top