lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

discrepancy in ADC reading.

Sun Nov 23, 2014 6:58 am

On the input pin of the ADC, I measured it using a meter and read 1.54V but the ADC using SPI bus read 1.73V on Python code. There's a difference 0.2V. Is there anything I can do make them closer in reading?

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: discrepancy in ADC reading.

Sun Nov 23, 2014 7:58 am

Post a photo of your set up.

User avatar
mikronauts
Posts: 2783
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: discrepancy in ADC reading.

Sun Nov 23, 2014 4:40 pm

Best guess: (assuming code is OK)

Vref is too low on the ADC
lilzz wrote:On the input pin of the ADC, I measured it using a meter and read 1.54V but the ADC using SPI bus read 1.73V on Python code. There's a difference 0.2V. Is there anything I can do make them closer in reading?
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: discrepancy in ADC reading.

Sun Nov 23, 2014 5:26 pm

joan wrote:Post a photo of your set up.
Wow, you can tell by just looking at the picture.
Here it goes. A simple MCP3208 using SPI bus and Vref and Vdd tied to Pi's 3.3V. The pot it also tied to 3.3V and GND.
Attachments
setup.jpg
setup.jpg (41.43 KiB) Viewed 744 times

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: discrepancy in ADC reading.

Sun Nov 23, 2014 5:28 pm

mikronauts wrote:Best guess: (assuming code is OK)

Vref is too low on the ADC
lilzz wrote:On the input pin of the ADC, I measured it using a meter and read 1.54V but the ADC using SPI bus read 1.73V on Python code. There's a difference 0.2V. Is there anything I can do make them closer in reading?
Vref is tied to Pi's 3.3V or 3.0V or whatever coming from Pi. Should be enough.

Return to “Troubleshooting”