Activity › Forums › Questions & Troubleshooting › Analog to Voltage Information
-
Analog to Voltage Information
-
Hi All,
I am interested in learning more about the electricals behind converting an analog value to a voltage on the Controllino Mega.
I read in the sample analog input demo code that the conversion for analog to voltage uses the following code:
measurementResultVoltage = map(measurementResult, 0, 1023, 0, 31); // because the voltage dividers are dimensioned with some safety reserve
I was wondering if I could get some more details on why the exact voltage of 31 is used in this sample. Is there about a 5 or a 4.6 volt buffer safety reserve built into the Controllino’s? Maybe, this depends on a few factors that need to be accounted for .
For instance using my uncalibrated multimeter I found that using a conversion voltage factor of 30.4 was the most accurate. This could be due to a number of reasons, but if anyone with more knowledge on the Controllino’s could comment on this that would be amazing.
Have a great day!
-
Hello in the pinouts that you can download in our web page you can see the following:
Automatic divider
Division ratio:
12V range: 3,0624V range: 6,14
That indicates the ratio for the conversion when using the analog inputs 🙂
- This reply was modified 2 years, 4 months ago by pedro-controllino.
- This reply was modified 2 years, 4 months ago by pedro-controllino.
-
The safety operation limits are also defined in the pinouts:
0
– 13,2V (Vin=12V) / 0
– 26,4V (Vin=24V)
Log in to reply.