> > *I have a new BBB. I'm trying to read voltages from a DC power supply. I'm > having trouble doing so. I connected the output from the power supply to > AIN0, and the ground from the power supply to the ADC_GND, and tried to run > the code, but the voltages that I'm reading doesn't make sense.* >
What voltage is the external DC power supply ? Unless the dc power supply voltage is 1.8v then voltage = value * 1.8 will not make sense. How this works is voltage = value * scale, where scale is the external voltage to be measured. So for example if your external powr supply is 12v, then scale would be 12.0. Just to make sure it is understood however, the input voltage to the ADC pins must never exceed 1.8v, or you risk at minimum burning out that pin. On Wed, Feb 10, 2016 at 2:54 PM, Chelsea Orefice <[email protected]> wrote: > Hi All, > > I have a new BBB. I'm trying to read voltages from a DC power supply. I'm > having trouble doing so. I connected the output from the power supply to > AIN0, and the ground from the power supply to the ADC_GND, and tried to run > the code, but the voltages that I'm reading doesn't make sense. > > So I went back to the basic, and just ran the code without plugging > anything in, and yet the voltage value I'm printing says 1.6 instead of 0. > Below shows the code, which I got from adafruit. I'm aware that I'm not > supposed to connect BBB ADC to anything above 1.8V or below 0V, which I > don't believe I have. > > import Adafruit_BBIO.ADC as ADC >> ADC.setup() >> value = ADC.read("P9_40") >> voltage = value * 1.8 >> print (voltage) > > > > https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/adc > > I've also been reading somewhere that I may have to enable the ADC before > I can read it?? > > Help? > > Thanks. > > -- > For more options, visit http://beagleboard.org/discuss > --- > You received this message because you are subscribed to the Google Groups > "BeagleBoard" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
