Do I need pull up resistors on explorer phat inputs

here is the problem , I am helping a hackspace member complete a robot, based on the explorer phat and a PI 3. We want to add line following using the normal type of sensors.

It did not work, so we tried to read the state of a switch.

With nothing connected to input 1 when we read the state it varied between 0 and 1. We tried adding a pull up resistor and that did not change anything, still a noisy response.

At home, with my explorer phat connected to a PI zero, input 1 not connected to anything I get a solid 0, when I connect it to 5v I get a solid 1. No pull up resistor fitted.

I realise I could just be “lucky” (or maybe unlucky) in that it works at home without a pull up resistor.

Hence the question, should we be using a pull up resistor?

Thanks in advance


I would think the answer is no. If needed I would think it would be mentioned on the product page and or GitHub page.
I would check the appropriate pin on the Pi’s GPIO header with the explorer pHat removed.
The pinout is here telling you what input goes where. That should tell you if the issue is with the Pi or the pHat.

I have a couple of explorer pHats mounted to Pi Zero’s that are setup as two wheel drive, 3 wheeled rovers. I’m currently only using the H Bridge part of the Explorer pHat though.

You may also want to ask them what other software and or devices they may have had connected to that Pi. Just in case something has messed with how the Pi’s GPIO are setup.

I am doing similar, i have a pi 3b+, explorer phat, sts-pi kit and 2 line sensors, the line sensors return an input state of one naturally until they hit a black (non reflective) line and then it goes to a zero.
no resistors are needed whilst using the inputs on the phat.