Activity Forums Questions & Troubleshooting Hardware [MAXI Automation] Analog IN and internal 5V supply deviation

  • [MAXI Automation] Analog IN and internal 5V supply deviation

     Friedl_AP updated 3 years, 8 months ago 3 Members · 6 Posts
  • Friedl_AP

    Member
    February 24, 2021 at 2:51 pm

    I’ve tried the AnalogOutAnalogIn demo and discovered the following:

    • ADC on AI12/AI13 reads 1023 already at 9.749V (should be 10.0V)
    • +5V (X1) vs. GND (X1) measures 4.874V (which should be 5.0V)
    • 9.749V * (5V / 4.874V) = 10.001V interesting!

    Between the AIxx inputs and the analog inputs of the AVR, there must be only a voltage divider with factor 2:1 because the 10V input measurement is off by the same factor the 5V supply is off.

    The 0-10V analog in/out’s are missing on the MAXI Automation pinout diagram – please fix this.

    External lab power supply connected to GND of MAXI Automation and voltage measurements taken direct from this ground to the input pin.

    Nothing’s connected to X1/X2, no load there, its just the MAXI Automation by itself. Multimeter used: Keysight 34461A (calibration date: 23.03.2020)

    How can I tune the 5V as it is used as ADC reference voltage?

    • This discussion was modified 3 years, 8 months ago by  Friedl_AP. Reason: removed some stray html tags which ended as clear text, which the editor inserted erroneously
    • This discussion was modified 3 years, 8 months ago by  Friedl_AP. Reason: removed some more clear text div tags
  • Friedl_AP

    Member
    February 24, 2021 at 2:57 pm

    May I feed 5.000V via X1 into the MAXI Automation to overwrite the internal power supply?

  • Jarda

    Member
    February 25, 2021 at 10:57 am

    Dear Friedl_AP,

    When you need more precise measurement of 5V and 10V, please use internal INTERNAL2V56: a built-in 2.56V reference.

    If you want to use precise external votlage, you can also use external votlage applied to the AREF pin (0 to 5V only).

    BR

    Jarda

    • Friedl

      Member
      February 25, 2021 at 7:34 pm

      Dear Jarda!

      1) As shown above, the 0-10V inputs are nothing more than 2:1 resistive divider, correct? They are not documented in the manual nor on the pinout diagram.

      2) If we’d switch to the 2.56V reference, we could only measure 0-5.12V (2.56V * 2), right?

      3) Am I missing the secret pin to control the switch for the voltage divider on AI12 and AI13 from ratio 2:1 to ratio 3.90625:1?

      Greetings from Graz
      Friedl

      • This reply was modified 3 years, 8 months ago by  Friedl. Reason: wording
      • This reply was modified 3 years, 8 months ago by  Friedl. Reason: typo
    • Friedl

      Member
      February 25, 2021 at 8:00 pm

      Dear Jarda!

      Regarding your suggestion of using the AREF pin.

      If you open the microcontroller manual https://ww1.microchip.com/downloads/en/DeviceDoc/ATmega640-1280-1281-2560-2561-Datasheet-DS40002211A.pdf, there on page 9, chapter “2.3 Pin Descriptions” you can read:

      AVCC is the supply voltage pin for Port F and the A/D Converter. It should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter.

      Therefore we can assume AVCC = VCC = 4.874V as measured before.

      When you scroll down to page 365, chapter ” 31.8 ADC Characteristics” you will discover that:

      Vref_MIN = 1.0V and Vref_MAX = AVCC

      Because we know from above that AVCC = VCC, so AREF must always be less than or equal to VCC.

      If VCC = 4.874V, as demonstrated before, then supplying 5V to AREF without supplying 5V to VCC as well is out of specification.

      This suggestion could be dangerous, don’t you think so?

      Greetings
      Friedl

      • This reply was modified 3 years, 8 months ago by  Friedl. Reason: typo
    • Friedl_AP

      Member
      March 17, 2021 at 4:25 pm

      Dear Jarda!

      I’ve now tried the following:

      1. Switched ADC to external reference as first command of setup()
      2. After loading the code I switched on a lab supply (4.500 V) connected to GND/VREF on X2
      3. AI12 is driven by another lab supply with 4.500 V (GND=screw terminal of Controllino, measured versus GND of Controllino)
      4. ADC value: 602 (expected (1024/2-1)=511)
      5. reduce VREF till ADC value gives 1023
      6. VREF measured: 2.653 V (expected 4.500V/2 = 2.25V)

      The internal reference is off and connecting an external reference does not really work either.

      Code:

      #include <Controllino.h>

      /*
      * CONTROLLINO MAXI AUTOMATION - using analog VREF input
      *
      * Reads out converted analog values from a screw terminal input AI12
      * of CONTROLLINO using VREF on X2 as reference.
      *
      * ------------------------
      * 24V ---------o--------------| 24V |
      * external | | |
      * supply | | |
      * -------------- | CONTROLLINO MAXI |
      * | Lab Supply |--------| AI12 | ---------------
      * | 4.500V | | X2-VREF |--------| Lab Supply |
      * -------------- | | | 4.500V |
      * | | | ---------------
      * | | | |
      * GND ---------o--------------| GND X2-GND |---------------o
      * ------------------------
      * remark: AI12 = internal divider 2:1
      * ATTENTION: Only switch on the lab supply on VREF after you've downloaded the code the first time!
      */

      void setup() {
      analogReference(EXTERNAL);
      pinMode(CONTROLLINO_AI12, INPUT);
      Serial.begin(115200);
      delay(300);
      }

      void loop() {
      int val = analogRead(CONTROLLINO_AI12);
      Serial.print(F("raw value: ")); Serial.println(val);
      delay(100);
      }

      • This reply was modified 3 years, 8 months ago by  Friedl_AP. Reason: stray DIV tags removed
Viewing 1 - 3 of 3 replies

Log in to reply.

Original Post
0 of 0 posts June 2018
Now