Analog Input

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
hestia
Normal user
Posts: 90
Joined: 06 Mar 2021, 08:27
Location: Paris

Analog Input

#1 Post by hestia » 03 Jul 2021, 23:38

I've set up an analog input
Screenshot 2021-07-03 233428.png
Screenshot 2021-07-03 233428.png (26.13 KiB) Viewed 6706 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...

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Analog Input

#2 Post by Ath » 04 Jul 2021, 09:29

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.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Analog Input

#3 Post by TD-er » 04 Jul 2021, 10:57

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?

hestia
Normal user
Posts: 90
Joined: 06 Mar 2021, 08:27
Location: Paris

Re: Analog Input

#4 Post by hestia » 04 Jul 2021, 15:11

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 6682 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

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Analog Input

#5 Post by TD-er » 04 Jul 2021, 17:56

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.

hestia
Normal user
Posts: 90
Joined: 06 Mar 2021, 08:27
Location: Paris

Re: Analog Input

#6 Post by hestia » 04 Jul 2021, 18:56

it's like this
Screenshot 2021-07-04 185446.png
Screenshot 2021-07-04 185446.png (12.07 KiB) Viewed 6669 times

seersucker
Normal user
Posts: 24
Joined: 11 May 2020, 17:01

Re: Analog Input

#7 Post by seersucker » 04 Sep 2021, 16:17

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.

hestia
Normal user
Posts: 90
Joined: 06 Mar 2021, 08:27
Location: Paris

Re: Analog Input

#8 Post by hestia » 05 Sep 2021, 19:42

Thanks for your reply.
I think, in the end, I did it like you said

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests