Page 1 of 1

Analog Input

Posted: 03 Jul 2021, 23:38
by hestia
I've set up an analog input
Screenshot 2021-07-03 233428.png
Screenshot 2021-07-03 233428.png (26.13 KiB) Viewed 6791 times
and when there is no input the value measured is 7 instead of 0
Is it normal?
If I choose the calibration my result is not good...

Re: Analog Input

Posted: 04 Jul 2021, 09:29
by Ath
What .bin file do you have installed on that unit? If it has VCC in its name, then the analog input is configured to measure the voltage fed to the ESP, and you can't use it for other purposes.

Re: Analog Input

Posted: 04 Jul 2021, 10:57
by TD-er
You can set the lower value of the calibration for value 7 to be calibrated to 0.

But to be able to explain why it reports "7" as lowest value, I guess we must see how it is connected.
Can you measure the voltage applied when there is no input?
Is it a single wire, with nothing connected to it?

Re: Analog Input

Posted: 04 Jul 2021, 15:11
by hestia
bin file do you have installed
ESP_Easy_mega_20210503_normal_ESP8266_4M1M
see how it is connected
with nothing connected for a test => 8
with a battery connected
Screenshot 2021-07-04 150144.png
Screenshot 2021-07-04 150144.png (578.09 KiB) Viewed 6767 times
max: 1,3V -> 426 or 225 on A0 (issue with electrical contact?)
min: 0V -> 7 on A0
log

Code: Select all

8289: EVENT: Hauteur#Analog=439
9227: EVENT: Hauteur#Analog=438
66181: EVENT: Hauteur#Analog=198
125083: ADC : Analog value: 7 = 7 (539 samples)
125800: EVENT: Hauteur#Analog=7
185028: ADC : Analog value: 225 = 225 (558 samples)
185970: EVENT: Hauteur#Analog=225
1265241: EVENT: Hauteur#Analog=439

Re: Analog Input

Posted: 04 Jul 2021, 17:56
by TD-er
Which pin is connected to the middle pin and which to the + of the battery?
Looks a bit odd that the + of the battery and the middle pin of the potentiometer is connected.

Re: Analog Input

Posted: 04 Jul 2021, 18:56
by hestia
it's like this
Screenshot 2021-07-04 185446.png
Screenshot 2021-07-04 185446.png (12.07 KiB) Viewed 6754 times

Re: Analog Input

Posted: 04 Sep 2021, 16:17
by seersucker
That's not going to work, all the pot is doing is putting resistance in series with the ground, which probably has quite a high impedance. The pot needs to be connected between the voltage source and 0v with the traveller connected to A0.

Re: Analog Input

Posted: 05 Sep 2021, 19:42
by hestia
Thanks for your reply.
I think, in the end, I did it like you said