Activity › Forums › Questions & Troubleshooting › Hardware › [MAXI Automation] Analog IN and internal 5V supply deviation
-
[MAXI Automation] Analog IN and internal 5V supply deviation
-
May I feed 5.000V via X1 into the MAXI Automation to overwrite the internal power supply?
-
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
-
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 -
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 4 years, 2 months ago by
Friedl. Reason: typo
-
This reply was modified 4 years, 2 months ago by
-
Dear Jarda!
I’ve now tried the following:
- Switched ADC to external reference as first command of setup()
- After loading the code I switched on a lab supply (4.500 V) connected to GND/VREF on X2
- AI12 is driven by another lab supply with 4.500 V (GND=screw terminal of Controllino, measured versus GND of Controllino)
- ADC value: 602 (expected (1024/2-1)=511)
- reduce VREF till ADC value gives 1023
- 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 4 years, 1 month ago by
Friedl_AP. Reason: stray DIV tags removed
-
Log in to reply.