I need to read an analog value with the Z-uno powered by 5V pin ( USB for testing ).
I've read [https://forum.z-wave.me/viewtopic.php?t=33688]
So I did a first try ( Z-Uno powered by 5.1V on 5V pin and 3V3 pin giving 3.17V )
with 1.58 V on A2 I get a value of 304
with 3.17V on A2 I get a value of 630
I'm surprised because it looks like the upper ref is the voltage on the 5V pin ( 304/1023*5.1 => 1.52 )
I thought it would be the voltage of 3V3 pin !
Setting 3V3 voltage on A0 and using analogReference( EXTERNAL ) analogRead give 1023 !
Code: Select all
int intPower = analogRead( A2 ) ;
Serial.print("power VCC REF: ");Serial.print(intPower);Serial.println();
...
analogReference( EXTERNAL );
intPower = analogRead( A2 ) ;
Serial.print("power EXT REF: ");Serial.print(intPower);Serial.println();
Code: Select all
FIRMWARE
VERSION: 03.10
BUILD_SEQUENCE: 00001842
BUILD_DATETIME: 2023-01-17T16:38:12(MSK)
SUPPORTED_HWREV: 0704
Can someone explain ?
Thank's a lot