jmn98
Posts: 3
Joined: Thu Dec 13, 2018 2:44 am

GPIO pull up/down resistors

Tue Jan 22, 2019 1:47 am

Hi all,

I'm using my R-Pi to control two 3x8 demultiplexers to switch 16 reed relays carrying high voltage supply, the aim of the instrument will be to survey for groundwater. I'm at the initial stages now and new to R-Pi's.

The circut:
- 3 x GPIO outputs address each demultiplexer, I have these attached directly.
- Demultiplexers are powered by external 5 V supply which is directed to the ouput channel to operate the reed relay coil. Again, this is connected directly.
- Reed relays are diode protected.

The issue:
- Everything works fine when I have my code running and all relevant GPIOs are set to output either high or low values.
- When I have GPIO.cleanup() at the end of the code I notice that all GPIOs in the circuit sit at just under 1V then go above 1V when I put my hand near the wire (no need to actually touch it), this then sets the demultiplexers into a state of confusion and the reed relays randomly flick on and off.

I have not included any pull-up or pull-down resistors in my circuit and I suspect that this may be the issue but I would love some advice on how to implement them and why they are required.

I understand that GPIO.cleanup() will reset all the GPIOs which were used in that code back to their defult values. I believe this means that they will all be inputs. I have noticed that some of my GPIOs (4, 5 and 6) are reading 3.3V following GPIO.cleanup(), does this sound right?

I have soldered the demultiplexers to the strip board, I was careful and quick with plenty of time to cool but is it possible that the heat has caused an issue?

Cheers,
Jack

tempest766
Posts: 105
Joined: Sun Jan 07, 2018 3:44 pm

Re: GPIO pull up/down resistors

Tue Jan 22, 2019 5:53 am

yup. install pull-ups and keep in mind how wire distance will cause attenuation problems. you don't say how long the GPIO leads are between the pi and the mux board

User avatar
rpdom
Posts: 15178
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: GPIO pull up/down resistors

Tue Jan 22, 2019 6:01 am

jmn98 wrote:
Tue Jan 22, 2019 1:47 am
I have not included any pull-up or pull-down resistors in my circuit and I suspect that this may be the issue but I would love some advice on how to implement them and why they are required.
Yes, you should use some pull-down resistors. When you do GPIO.cleanup() it does, as you suspected, set the GPIOs back to input state. Although some have internal pulls set, others will be floating at an undefined level as they are not driven high or low by anything. Thus any stray electromagnetic field could make them go high enough to trigger your multiplexors. Stick a 10K resistor between each GPIO and GND and you should be ok.
I have soldered the demultiplexers to the strip board, I was careful and quick with plenty of time to cool but is it possible that the heat has caused an issue?
Unlikely, unless you kept the heat on them for a long time like several seconds per pin. I try to solder chips one pin at a time and leave a short pause between each pin. Also, I try to do alternate pins at opposite sides and ends of the chip to keep the heating even. They are fairly robust for soldering purposes.

Return to “Troubleshooting”