How to set gain on ADCPi?
The ADC Pi is an Analogue to Digital converter for the Raspberry Pi
09/05/2023
Posted by:
icenov
I'm using python3 and can read voltage on each channel OK, but I can't work out how to set the gain.
For example, using the demo_readvoltage.py script, how do I set the gain? I've tried using adc.set_gain(8) but it doesn't seem to make any difference...
Does anyone have a python example I can tryy?
Thanks
09/05/2023
Posted by:
icenov
09/05/2023
Posted by:
icenov
09/05/2023
Posted by:
andrew
You are correct; when you set the gain to a higher value, it will read the same voltage level, but the maximum voltage decreases, and the resolution increases.
On the ADC Pi, the gain values will give the following maximum voltages.
1 = 5V
2 = 2.5V
4 = 1.25V
8 = 0.625V
13/05/2023
Posted by:
icenov
13/05/2023
Posted by:
andrew
Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.