1

Is it possible to read the signals from "simple resistor networks", as on this web site, using only the GPIO on a Raspberry 3? There are six cases with the resistance values 54 Ω, 147 Ω, 301 Ω, 562 Ω, 1037 Ω and 5057 Ω.

I imagine getting a reading a few times per second would be enough.

Addition: it is a steering wheel control stalk. It can be moved in two directions (back and forth) and has a button, so five different actions.

More addition: preferably not the "step response" technique, or any other software-based solution. I'd like to just make quick calls a few times per second to get the current value of the resistor network. I have a programming background, not electronics.

Tomas By
  • 218
  • 5
  • 13

2 Answers2

2

There are more than a few approaches to reading resistance. Because you know the specific values, it puts you a bit ahead of the game.

Take a look at O'Reilly Raspberry Pi cookbook chapter 8

The site is using a variable resistor, aka potentiometer. The primary difference for your purpose is that the values will jump from one to another, rather than being "smoothly" advanced. You'll note in the body of the document that this particular circuit is constructed in such a way as to provide stepped readings from the pot. I suspect that will not matter in your case, as you have stepped inputs from your circuit.

stepped resistance circuit

There is what appears to be an identical method presented by Adafruit in multiple pages. The foundation behind this method is to read the values without the need for additional external devices such as an analog to digital converter.

fred_dot_u
  • 399
  • 1
  • 2
  • 6
2

The GPIO on the Pi is essentially Digital, not analog. You can use capacitive timing circuits as shown in the answer from @fred_dot_u above, but this will require some code. Here's another example of the same type of timing circuit.

If you are looking for an answer that does not require either coding (to calculate timing) or a proper ADC, then you may just be out of luck. There's no silver bullet for this unfortunately.

Going with a non-Pi solution such as Arduino, or (better) ESP8266 or ESP32, may solve your ADC issues since they natively support analog inputs. But, not knowing any of your other constraints, I cannot say if they will be a better bet for you than just grabbing a simple ADC HAT for the PI, or wiring up an MCP3008 directly.

Good luck in your quest!

MrChips
  • 993
  • 1
  • 5
  • 11