Activity Forums Questions & Troubleshooting Analog to Voltage Information

  • Analog to Voltage Information

  • strtok

    Member
    June 8, 2022 at 5:08 am

    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!

  • pedro-controllino

    Member
    July 7, 2022 at 8:56 am

    Hello in the pinouts that you can download in our web page you can see the following:

    Automatic divider

    Division ratio:
    12V range: 3,06

    24V range: 6,14

    That indicates the ratio for the conversion when using the analog inputs 🙂

  • pedro-controllino

    Member
    July 7, 2022 at 8:58 am

    The safety operation limits are also defined in the pinouts:

    0
    – 13,2V (Vin=12V) / 0
    – 26,4V (Vin=24V)

Viewing 1 - 3 of 3 replies

Log in to reply.

Original Post
0 of 0 posts June 2018
Now