Monday, May 06, 2013
MCP3201 ADC accuracy found about 0.4%
Now I have used Excel to calculate the series resistor for Zener voltage reference, and the expected binary value for analog input voltages 2.85V and 2.44V.
Then I used the test function to find the MCP3201 ADC results, as listed below. I found the accuracy is roughly 8 bits, which is equivalent to 1/256 or 0.4%, which I think is very good.
*** MCP3201 ADC results - tlfong01 2013may06 ***
0V 000 0000 0000 0000 0
3V3 000 1111 1111 1100 0
2V85 000 1101 1110 1001 0
Excel 1101 1111 1101
2V44 000 1011 1111 0010 1
Excel 1011 1111 1010
0V
ADC output byte 1 = 00000000
ADC output byte 2 = 00000000
3V3
ADC output byte 1 = 00011111
ADC output byte 2 = 11111000
2V85
ADC output byte 1 = 11011011
ADC output byte 2 = 11100111
2V44
ADC output byte 1 = 00010111
ADC output byte 2 = 11100101
pi@raspberrypi ~/python_programs/test_guzuntypi $ sudo python fl2067.py
fl2067.py:268: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
setupOutputPin = lambda oPin: GPIO.setup(oPin, GPIO.OUT) # set GPIO pin as output
fl2067.py:270: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
setupInputPinWithPullUp = lambda iPin: GPIO.setup(iPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) # set GPIO pin as input, with pull up
*** Start Program - MCP3201 ADC 01 ***
*** Start testing MCP3201 ADC ***
ADC output byte 1 = 00000000
ADC output byte 2 = 00000000
*** Stop testing MCP3201 ***
*** Stop Program ***
pi@raspberrypi ~/python_programs/test_guzuntypi $ sudo python fl2067.py
*** Start Program - MCP3201 ADC 01 ***
*** Start testing MCP3201 ADC ***
ADC output byte 1 = 00011111
ADC output byte 2 = 11111000
*** Stop testing MCP3201 ***
*** Stop Program ***
pi@raspberrypi ~/python_programs/test_guzuntypi $ sudo python fl2067.py
*** Start Program - MCP3201 ADC 01 ***
*** Start testing MCP3201 ADC ***
ADC output byte 1 = 11011011
ADC output byte 2 = 11100111
*** Stop testing MCP3201 ***
*** Stop Program ***
pi@raspberrypi ~/python_programs/test_guzuntypi $ sudo python fl2067.py
*** Start Program - MCP3201 ADC 01 ***
*** Start testing MCP3201 ADC ***
ADC output byte 1 = 00010111
ADC output byte 2 = 11100101
*** Stop testing MCP3201 ***
*** Stop Program ***
pi@raspberrypi ~/python_programs/test_guzuntypi $ date
Mon May 6 02:58:34 UTC 2013
pi@raspberrypi ~/python_programs/test_guzuntypi $
*** Start Program - MCP3201 ADC 01 ***
*** Start testing MCP3201 ADC ***
ADC output byte 1 = 00011011
ADC output byte 2 = 11010010
*** Stop testing MCP3201 ***
*** Stop Program ***
.END
No comments:
Post a Comment