AD Converter PCF8591 for Raspberry Pi: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 22: Line 22:


Image2: Calibrating ADC with voltage divider using voltmeter
Image2: Calibrating ADC with voltage divider using voltmeter
==How to calibrate it==
Please use [http://www.daycounter.com/Calculators/Voltage-Divider-Calculator.phtml Voltage Divider Calculator] to get values of resistors you need. I strongly recommend you to replace one resistor with trimmer resistor to calibrate it to right value.
For measuring voltage the best is to use [https://github.com/quick2wire/quick2wire-python-api quick2wire] api library combined it with my prepared example [https://github.com/koss822/misc/tree/master/ad_pcf8591 github.com/ko.../ad_pcf8591] file pcf8591read which has these options:
<syntaxhighlight lang="python">
ref_voltage = 3.3
divider = 6
</syntaxhighlight>
where ref_voltage is standard Raspberry Pi 3.3 voltage and divider is voltage divider you selected on calculator above (in my example it is 6)

Navigation menu