So I did the test. I thought it might take me 30 minutes to debug the hardware wrong connections. But again, everything went smoothly.
Accuracy seems not too different from the 3V3 version. But then I forgot to check the precise value of the reference voltage. So I need to Excel again.
Using the rough value 5.00, accuracy is 6 digits out of 12. If using the more accurate value of 4.96, accuracy becomes 3 digits. So accuracy is 3 last digits.
I am not too sure if I can then say accuracy is 3 digits / 12 digits == 8 / 4096
= 0.19 = 0.2%.
If indeed it is 0.2%, then it is very good.
5V0
MCP3201 = 0001111111110010
Excel = 111111111111
0V0
MCP3201 = 0000000000000010
Excel = 000000000000
3V26
MCP3201 = 0001010011111101
Excel = 101001101111
2V43
MCP3201 = 0000111110100111 test 1
0000111110101010 test 2
Excel = 011111000111 (using 5.00)
011111010111 (using 4.96)
*** Results ***
*** Start testing MCP3201 ADC ***
5V0
ADC output byte 1 = 00011111
ADC output byte 2 = 11110010
*** Stop testing MCP3201 ***
*** Stop Program ***
pi@raspberrypi ~/python_programs/test_guzuntypi $ sudo python fl2067.py
*** Start Program - MCP3201 ADC 01 ***
*** Start testing MCP3201 ADC ***
0V
ADC output byte 1 = 00000000
ADC output byte 2 = 00000010
*** Stop testing MCP3201 ***
*** Stop Program ***
pi@raspberrypi ~/python_programs/test_guzuntypi $ sudo python fl2067.py
*** Start Program - MCP3201 ADC 01 ***
*** Start testing MCP3201 ADC ***
3.26V
ADC output byte 1 = 00010100
ADC output byte 2 = 11111101
*** Stop testing MCP3201 ***
*** Stop Program ***
*** Start testing MCP3201 ADC ***
2.43V
ADC output byte 1 = 00001111
ADC output byte 2 = 10100111
*** Stop testing MCP3201 ***
*** Stop Program ***
*** Start testing MCP3201 ADC ***
ADC output byte 1 = 00001111
ADC output byte 2 = 10101010
*** Stop testing MCP3201 ***
*** Stop Program ***
.END
No comments:
Post a Comment