Long wires causing Raspberry Pi to die?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I've been working on a simple project involving a Raspberry pi and some switches.
I would never thought I would have any problem for something as simple as a switch, but here I am.
The 2 wires from my switch are connected to the raspberry.
One is connected to gnd, the other is connected to a GPIO. The internal pullup resistor of the raspberry is used.
The length of the cable is around 7m.
The program is just a mater of reading the GPIO and sending commands according to state changes.
My problem is simple : everything works fine for some time, but eventually the switch ends up not "working" anymore (reading low state whether or not the switch is pushed).
I checked the switch, and of course it still opens and closes as expected, so the problem comes from somewhere else. What I did is I disconnected the switch, and measured the voltage between the two wires : I get 0V.
This is my first clue for thinking something bad happened to the raspberry. Because the internal pullup is used, I should have measured around 3.3V. And this is indeed what I measure if I replace the raspberry with a new one.
I thought this might be caused by EMI, causing voltage spikes ? I really have no experience dealing with this. So what I did is I replaced the raspberry, and I added an external pullup resistor with a lower value (the internal resistor is 30k, I used 1k as external resistor), guessing that this would reduce the noise. But the same thing happened after one day.
This time, when I measure the voltage at the GPIO, I have around 1.2V. According to the reading, using a simple voltage divider, this is equivalent to a resistor value of 600Ohms pulling down the signal inside the raspberry. Definitely not normal.
Then I tried to replace the wires with shielded audio cable, connecting the the shielding to ground. And half a day later, yet another raspberry was good for retirement.
I have now placed a ceramic capacitor between gnd and the GPIO (100nF), and for now it seems to be ok (it's only been 12h) but I have to say I have no confidence because I'm not sure what is the reason for this problem.
On the same system, I have another switch with a much shorter wire (1m) and I never had any issue with this one. This is why I guess my wires are acting as antennas, but I don't know for sure (especially since shielded wires did not help).
Any idea about what could happen would be appreciated.
Thank you
raspberry-pi noise interference shielding over-voltage-protection
add a comment |Â
up vote
1
down vote
favorite
I've been working on a simple project involving a Raspberry pi and some switches.
I would never thought I would have any problem for something as simple as a switch, but here I am.
The 2 wires from my switch are connected to the raspberry.
One is connected to gnd, the other is connected to a GPIO. The internal pullup resistor of the raspberry is used.
The length of the cable is around 7m.
The program is just a mater of reading the GPIO and sending commands according to state changes.
My problem is simple : everything works fine for some time, but eventually the switch ends up not "working" anymore (reading low state whether or not the switch is pushed).
I checked the switch, and of course it still opens and closes as expected, so the problem comes from somewhere else. What I did is I disconnected the switch, and measured the voltage between the two wires : I get 0V.
This is my first clue for thinking something bad happened to the raspberry. Because the internal pullup is used, I should have measured around 3.3V. And this is indeed what I measure if I replace the raspberry with a new one.
I thought this might be caused by EMI, causing voltage spikes ? I really have no experience dealing with this. So what I did is I replaced the raspberry, and I added an external pullup resistor with a lower value (the internal resistor is 30k, I used 1k as external resistor), guessing that this would reduce the noise. But the same thing happened after one day.
This time, when I measure the voltage at the GPIO, I have around 1.2V. According to the reading, using a simple voltage divider, this is equivalent to a resistor value of 600Ohms pulling down the signal inside the raspberry. Definitely not normal.
Then I tried to replace the wires with shielded audio cable, connecting the the shielding to ground. And half a day later, yet another raspberry was good for retirement.
I have now placed a ceramic capacitor between gnd and the GPIO (100nF), and for now it seems to be ok (it's only been 12h) but I have to say I have no confidence because I'm not sure what is the reason for this problem.
On the same system, I have another switch with a much shorter wire (1m) and I never had any issue with this one. This is why I guess my wires are acting as antennas, but I don't know for sure (especially since shielded wires did not help).
Any idea about what could happen would be appreciated.
Thank you
raspberry-pi noise interference shielding over-voltage-protection
5
I would try putting a bidirectional transient voltage suppressor (TVS) on the input. The long wire could be picking up transients that are then coupled into the PI input. The TVS will also act to clamp static discharges.
â crj11
46 mins ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I've been working on a simple project involving a Raspberry pi and some switches.
I would never thought I would have any problem for something as simple as a switch, but here I am.
The 2 wires from my switch are connected to the raspberry.
One is connected to gnd, the other is connected to a GPIO. The internal pullup resistor of the raspberry is used.
The length of the cable is around 7m.
The program is just a mater of reading the GPIO and sending commands according to state changes.
My problem is simple : everything works fine for some time, but eventually the switch ends up not "working" anymore (reading low state whether or not the switch is pushed).
I checked the switch, and of course it still opens and closes as expected, so the problem comes from somewhere else. What I did is I disconnected the switch, and measured the voltage between the two wires : I get 0V.
This is my first clue for thinking something bad happened to the raspberry. Because the internal pullup is used, I should have measured around 3.3V. And this is indeed what I measure if I replace the raspberry with a new one.
I thought this might be caused by EMI, causing voltage spikes ? I really have no experience dealing with this. So what I did is I replaced the raspberry, and I added an external pullup resistor with a lower value (the internal resistor is 30k, I used 1k as external resistor), guessing that this would reduce the noise. But the same thing happened after one day.
This time, when I measure the voltage at the GPIO, I have around 1.2V. According to the reading, using a simple voltage divider, this is equivalent to a resistor value of 600Ohms pulling down the signal inside the raspberry. Definitely not normal.
Then I tried to replace the wires with shielded audio cable, connecting the the shielding to ground. And half a day later, yet another raspberry was good for retirement.
I have now placed a ceramic capacitor between gnd and the GPIO (100nF), and for now it seems to be ok (it's only been 12h) but I have to say I have no confidence because I'm not sure what is the reason for this problem.
On the same system, I have another switch with a much shorter wire (1m) and I never had any issue with this one. This is why I guess my wires are acting as antennas, but I don't know for sure (especially since shielded wires did not help).
Any idea about what could happen would be appreciated.
Thank you
raspberry-pi noise interference shielding over-voltage-protection
I've been working on a simple project involving a Raspberry pi and some switches.
I would never thought I would have any problem for something as simple as a switch, but here I am.
The 2 wires from my switch are connected to the raspberry.
One is connected to gnd, the other is connected to a GPIO. The internal pullup resistor of the raspberry is used.
The length of the cable is around 7m.
The program is just a mater of reading the GPIO and sending commands according to state changes.
My problem is simple : everything works fine for some time, but eventually the switch ends up not "working" anymore (reading low state whether or not the switch is pushed).
I checked the switch, and of course it still opens and closes as expected, so the problem comes from somewhere else. What I did is I disconnected the switch, and measured the voltage between the two wires : I get 0V.
This is my first clue for thinking something bad happened to the raspberry. Because the internal pullup is used, I should have measured around 3.3V. And this is indeed what I measure if I replace the raspberry with a new one.
I thought this might be caused by EMI, causing voltage spikes ? I really have no experience dealing with this. So what I did is I replaced the raspberry, and I added an external pullup resistor with a lower value (the internal resistor is 30k, I used 1k as external resistor), guessing that this would reduce the noise. But the same thing happened after one day.
This time, when I measure the voltage at the GPIO, I have around 1.2V. According to the reading, using a simple voltage divider, this is equivalent to a resistor value of 600Ohms pulling down the signal inside the raspberry. Definitely not normal.
Then I tried to replace the wires with shielded audio cable, connecting the the shielding to ground. And half a day later, yet another raspberry was good for retirement.
I have now placed a ceramic capacitor between gnd and the GPIO (100nF), and for now it seems to be ok (it's only been 12h) but I have to say I have no confidence because I'm not sure what is the reason for this problem.
On the same system, I have another switch with a much shorter wire (1m) and I never had any issue with this one. This is why I guess my wires are acting as antennas, but I don't know for sure (especially since shielded wires did not help).
Any idea about what could happen would be appreciated.
Thank you
raspberry-pi noise interference shielding over-voltage-protection
raspberry-pi noise interference shielding over-voltage-protection
asked 56 mins ago
Fardenco
164
164
5
I would try putting a bidirectional transient voltage suppressor (TVS) on the input. The long wire could be picking up transients that are then coupled into the PI input. The TVS will also act to clamp static discharges.
â crj11
46 mins ago
add a comment |Â
5
I would try putting a bidirectional transient voltage suppressor (TVS) on the input. The long wire could be picking up transients that are then coupled into the PI input. The TVS will also act to clamp static discharges.
â crj11
46 mins ago
5
5
I would try putting a bidirectional transient voltage suppressor (TVS) on the input. The long wire could be picking up transients that are then coupled into the PI input. The TVS will also act to clamp static discharges.
â crj11
46 mins ago
I would try putting a bidirectional transient voltage suppressor (TVS) on the input. The long wire could be picking up transients that are then coupled into the PI input. The TVS will also act to clamp static discharges.
â crj11
46 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
The wire has inductance and, the longer the wire is the more inductance it has. An inductance likes to maintain the current flowing through itself so, when your switch opens, the small stored energy in the cables magnetic field tries to maintain current flow and produces a sizable voltage (aka back-emf) in doing so. This can easily exceed the maximum voltage rating of your IO pin and pop goes the chip.
The capacitor provides a path to maintain current flow when the switch opens and normally will restrict any voltage spike (back emf) considerably. I have faith in it working but if it doesn't then it could be pick-up from AC power lines or some rogue RF transmitter nearby. In this case use a capacitor and a zener diode rated at a little below your power rail voltage.
Thank you for your answer. I will try to see this voltage spike using an oscilloscope and confirm that the capacitor eliminates it. I'll come back after one week if the system is still alive to validate your answer !
â Fardenco
21 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
The wire has inductance and, the longer the wire is the more inductance it has. An inductance likes to maintain the current flowing through itself so, when your switch opens, the small stored energy in the cables magnetic field tries to maintain current flow and produces a sizable voltage (aka back-emf) in doing so. This can easily exceed the maximum voltage rating of your IO pin and pop goes the chip.
The capacitor provides a path to maintain current flow when the switch opens and normally will restrict any voltage spike (back emf) considerably. I have faith in it working but if it doesn't then it could be pick-up from AC power lines or some rogue RF transmitter nearby. In this case use a capacitor and a zener diode rated at a little below your power rail voltage.
Thank you for your answer. I will try to see this voltage spike using an oscilloscope and confirm that the capacitor eliminates it. I'll come back after one week if the system is still alive to validate your answer !
â Fardenco
21 mins ago
add a comment |Â
up vote
4
down vote
The wire has inductance and, the longer the wire is the more inductance it has. An inductance likes to maintain the current flowing through itself so, when your switch opens, the small stored energy in the cables magnetic field tries to maintain current flow and produces a sizable voltage (aka back-emf) in doing so. This can easily exceed the maximum voltage rating of your IO pin and pop goes the chip.
The capacitor provides a path to maintain current flow when the switch opens and normally will restrict any voltage spike (back emf) considerably. I have faith in it working but if it doesn't then it could be pick-up from AC power lines or some rogue RF transmitter nearby. In this case use a capacitor and a zener diode rated at a little below your power rail voltage.
Thank you for your answer. I will try to see this voltage spike using an oscilloscope and confirm that the capacitor eliminates it. I'll come back after one week if the system is still alive to validate your answer !
â Fardenco
21 mins ago
add a comment |Â
up vote
4
down vote
up vote
4
down vote
The wire has inductance and, the longer the wire is the more inductance it has. An inductance likes to maintain the current flowing through itself so, when your switch opens, the small stored energy in the cables magnetic field tries to maintain current flow and produces a sizable voltage (aka back-emf) in doing so. This can easily exceed the maximum voltage rating of your IO pin and pop goes the chip.
The capacitor provides a path to maintain current flow when the switch opens and normally will restrict any voltage spike (back emf) considerably. I have faith in it working but if it doesn't then it could be pick-up from AC power lines or some rogue RF transmitter nearby. In this case use a capacitor and a zener diode rated at a little below your power rail voltage.
The wire has inductance and, the longer the wire is the more inductance it has. An inductance likes to maintain the current flowing through itself so, when your switch opens, the small stored energy in the cables magnetic field tries to maintain current flow and produces a sizable voltage (aka back-emf) in doing so. This can easily exceed the maximum voltage rating of your IO pin and pop goes the chip.
The capacitor provides a path to maintain current flow when the switch opens and normally will restrict any voltage spike (back emf) considerably. I have faith in it working but if it doesn't then it could be pick-up from AC power lines or some rogue RF transmitter nearby. In this case use a capacitor and a zener diode rated at a little below your power rail voltage.
answered 45 mins ago
Andy aka
231k10171395
231k10171395
Thank you for your answer. I will try to see this voltage spike using an oscilloscope and confirm that the capacitor eliminates it. I'll come back after one week if the system is still alive to validate your answer !
â Fardenco
21 mins ago
add a comment |Â
Thank you for your answer. I will try to see this voltage spike using an oscilloscope and confirm that the capacitor eliminates it. I'll come back after one week if the system is still alive to validate your answer !
â Fardenco
21 mins ago
Thank you for your answer. I will try to see this voltage spike using an oscilloscope and confirm that the capacitor eliminates it. I'll come back after one week if the system is still alive to validate your answer !
â Fardenco
21 mins ago
Thank you for your answer. I will try to see this voltage spike using an oscilloscope and confirm that the capacitor eliminates it. I'll come back after one week if the system is still alive to validate your answer !
â Fardenco
21 mins ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f399515%2flong-wires-causing-raspberry-pi-to-die%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
5
I would try putting a bidirectional transient voltage suppressor (TVS) on the input. The long wire could be picking up transients that are then coupled into the PI input. The TVS will also act to clamp static discharges.
â crj11
46 mins ago