Long cable runs cause wemos to crash

Thread Starter

MikeKulls

Joined Apr 4, 2016
51
I am using a wemos to monitor some doors via reed switches in a shed. Everything has been working fine on the bench but when installing it in the shed any length of cable run to the reed switches is causing issues. The reed switches are connected to the wemos digital pins via 3.6kohm resistors with a zener diode to ensure the voltage doesn't go too high (think I used 3.6V zeners). If I have even a single wire of the reed switch connected then the wemos refuses to start or appears to crash while running. I can no longer connect to it or see it on the network. I can push reset multiple times and it won't come back up. If I remove the wires to the reed switch and push reset then it comes up straight away. I'm guessing the cable is picking up some voltage and causing the wemos to crap itself.

Should I be added some sort of isolation, caps to filter out noise or maybe I would be better off using twisted pair?

Thanks
 

danadak

Joined Mar 10, 2018
4,057
If the only thing connected to a pin is a Vz and an unterminated wire, that
sounds like a possibility the wireless carrier freq is being pulled off freq
by coupling. Or if pin is floating, subject to a lot of pickup, its possible
the wire is 'harvesting" the environment and injecting enough current
into the pin turning on parasitic diodes and dumping charge into the
substrate, causing general logic failure.

Is the pin/wire terminated to ground or Vdd or just going thru a 3.6K R
into the pin ?

Schematic of loop, relay, R, pin....

Regards, Dana.
 

ericgibbs

Joined Jan 29, 2010
10,835
hi Mike,
That sketch does not show how the lines are powered.??
I assume D0 D8 are logic MCU inputs, so what pulls the lines High.?
E
 

Thread Starter

MikeKulls

Joined Apr 4, 2016
51
I've attached a pic in the previous message, kept short as it was from my phone. Most inputs have internal pullups within the micro. For D0 I have added a 100k pullup. It's possible the issue might be that D3 cannot be pulled low when starting, it puts it into programming mode. However I am pretty sure that I had issues when D3 wasn't low. I would still be interested to know how I should best protect the inputs.
 

danadak

Joined Mar 10, 2018
4,057
If you add a cap to input to ground check datasheet for max allowed risetime.
If there is no spec be aware there are problems using caps on CMOS inputs.

http://www.ti.com/lit/an/scba004d/scba004d.pdf

Consider using twisted pair out to switch as one suppression method. Also
lower Z pull ups than internal pullup will aid in noise coupling. Like 1 - 4 K.

What is Vz and tolerance ? Protecting inputs that way OK, or use -



Note you can get arrays of these in a single package from Diodes Inc, On Semi,
Fairchild.....


Regards, Dana.
 
Last edited:

Thread Starter

MikeKulls

Joined Apr 4, 2016
51
Thanks everyone, I will give it a try. Good thing I ordered 10 prototype boards :) What would be the "proper" fix? Would you normally run digital inputs around a shed like this with just a resistor between the cable and the digital input?
 

ericgibbs

Joined Jan 29, 2010
10,835
hi Mike,
To answer your question,
Would you normally run digital inputs around a shed like this with just a resistor between the cable and the digital input?

The answer is no.
Use the circuit I posted earlier, it works for me on a number of long cable runs, house, garden shed into my Arduino and has done for a number of years.
E
 

Thread Starter

MikeKulls

Joined Apr 4, 2016
51
Thanks everyone for the replies, it will take me a while to try out all the suggestions, hopefully I can do some of them over the weekend. The shed I was installing this in has a mobile phone tower installed 200m away from it in a rural area so maybe that has something to do with it.
 

Thread Starter

MikeKulls

Joined Apr 4, 2016
51
One problem I have is that at least some of the inputs have a 10k pull up soldered to the wemos. So running a 20M resistor to the pin won't be possible. Could I just use a transistor as isolation?
 

Thread Starter

MikeKulls

Joined Apr 4, 2016
51
Actually I just realised it's only the inputs I can't use anyway that have a 10k pull up or down soldered to the board, so all good. :) Thanks again everyone
 
Top