1

I know there is a simple circuit you can make to be able to read an analog pin but what if I don't know if my device's pin is giving me analog or digital? If I try to read from that pin anyway am I going to damage anything?

** EDIT **

I'm not talking about reading some mystery "analog pin" on the rpi it's self, I'm talking about reading output from and entirely different source. If THAT pin is outputting analog data (which I'm not sure if it's analog or digital) is it okay for me to try to read from the pin either way just to see what happens or am I going to fry something? How can I decide if it's analog or digital anyway?

  • 2
    I was not aware that the GPIO pins of the Raspberry Pi offer some analog input. – Ghanima Mar 3 '15 at 9:04
  • @Ghanima Quality sarcasm, but I'm talking about the pin from the device that isn't on the rpi. Also, here's how you can read from an analog source: raspberrypi.org/forums/viewtopic.php?f=44&t=13883 – Jacksonkr Mar 3 '15 at 15:25
  • 1
    For the record, the downvote isn't mine. But joan's answer covers the limits before frying something. – Ghanima Mar 3 '15 at 21:04
4

As long as the analog voltage is between 0V and 3.3V you won't damage anything.

The gpis will be damaged by voltages less than zero or greater than 3.3V. The severity of the damage will depend on the current flow and you may slow the damage by limiting the current with a large resistor (say >5 kohm).

See http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/raspberry-pi/gpio-pin-electrical-specifications

  • After receiving a downvote I thought my question was misleading (which I still think the wording could have been better) but I see now that you were able to decipher what I was talking about. Thanks. – Jacksonkr Mar 3 '15 at 15:32
  • When I get time I'll feed a known voltage into a Pi pin and use a resistor/capacitor timing circuit to measure the voltage. Here's an example for a LDR, abyz.co.uk/rpi/pigpio/ex_LDR.html – joan Mar 3 '15 at 16:55
-1

Analog data is just a voltage, digital is a 1 or a 0,

There is a point to where the digital data is 0, I think around 1,5 volts,

and from 1,5 volts the Raspberry Pi thinks it is HIGH(1).

To find out that point, use a potmeter and a voltmeter.

Reading out a analog value is doable with an ADC chip(Analog to Digital Converter), or with this setup, not tested

  • 1
    There's little need to guess or think what the thresholds are. Joan's link covers the details of the electrical specifications pretty well - and they differ quite much from what you've stated here. Luckily the Pi has a Schmitt-Trigger input. Other digital inputs (e.g. of digital IC) typically do not show a behavior that you describe but exhibit an area where the voltage is between Low and High (see: en.wikipedia.org/wiki/Logic_level) – Ghanima Mar 3 '15 at 21:20
  • haha, yeah, I'm not a native english speaker, so it was difficult to find info I would find in Dutch. – Arend-Jan van Hilten Mar 4 '15 at 15:05
  • @Ghanima haha, yeah, I'm not a native english speaker, so it was difficult to find info I would find in Dutch. – Arend-Jan van Hilten Mar 4 '15 at 15:05
  • 1
    It got nothing to do with language, I am just saying that the factual data (joan's link) does not support your claims as the voltage levels are completely different. – Ghanima Mar 4 '15 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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