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
Hi
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
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
OK - I think I understand how it works now: voltage doesn't change but more resolution. And max voltage decreases with gain. I just wasn't sure if it was actually doing anything until I noticed that the readvoltage value was topping out at lower and lower values as the gain was increased.
09/05/2023
Posted by:
andrew
Hi
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
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
On the ADC Pi you can only measure positive values. To measure negative values we sell the ADC Differential Pi which has a voltage range of -2.048 to +2.048V.
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.