I have a circuit I am working on and I need to be able to detect if current is flowing through certain GPIO (breadboarding wires really), but I'm not totally sure how to go about it!

Would I want to use GPIO pull up/pull down somehow or what? This google code page looks like it will be useful for learning that (https://code.google.com/p/raspberry-gpio-python/wiki/Inputs), but will it solve my problem?


Basically what I want to do is be testing to see if any current is flowing, I don't need to measure it at all. I would need to run a simple LCD (http://www.foxytronics.com/products/173-16x2-dot-matrix-character-lcd) and maybe a few LEDs (not necessary) but what I need to know the most is is it possible to test to see if any current whatsoever is coming through.


  • raspberry pi has no ADC, therefore any attempt to measure voltage, current, temperature or anything else is futile. unless you get a separate ADC and wire it to the serial or i2c.
    – lenik
    Nov 20 '13 at 5:45
  • @lenik: I don't want to measure how much current is flowing, just if current is flowing (it would be very low level from the GPIO). Nov 20 '13 at 14:15
  • Instread of adding a long line of comments, you should edit your original question. You can even expressly label the fact that you have edited it. I am still not clear on wahat exactly the problem is but this might help learn.adafruit.com/… Nov 20 '13 at 14:26
  • @SteveRobillard Sorry, did so. That tutorial helps with driving the LCD, but it doesn't answer how to test for current. Nov 20 '13 at 14:31


Here's a link that should help. Basically, you're just going to connect the inputs of an opamp around your current sensing load resistor. The app note there has many more examples.

If you just have a binary input, you could choose your resistor such that the "high" level was a logic high, or send it into a comparator if you wanted.

If you want to do some more research as well, I'm sure there are modifications of current limiting circuitry that could be modified to trigger a microcontroller input rather than shut off a line. Search for BJT current mirror for some more ideas.

edit: hahah, Power Sequencing was the other word I was looking for. You could basically "power sequence" your detecting pin after the current flows. Again, those are just some ideas for search parameters. The op-amp solution may be the simplest.

  • Thank you! This looks like, with a bit of reading, it should do the job! Nov 22 '13 at 13:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.