Problems with Analog Input

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
blacksn0w
New user
Posts: 4
Joined: 29 Aug 2018, 07:47

Problems with Analog Input

#1 Post by blacksn0w » 03 Sep 2018, 13:41

Hey everbody,
after 1000 tries and endless soldering i'm about to give up on this topic.

Following setup:
ADC Setup
ADC Setup
Unbenannt.png (15.64 KiB) Viewed 7591 times
The ESP12F is powered by another external power source, so there is no connection between the circuit to measure and the one who is powering the unit.

I've installed the newest Mega Build with VCC extension.

Then i've setup a new Analog Input Devicec in ESPEasy and looked hopefully at the result: -1
I've tried 2 other modules, same result.

What am i doing wrong? It is possible to measure a current from a circuit which is not the one powering the unit?

TommoT1
Normal user
Posts: 15
Joined: 17 Aug 2018, 11:46

Re: Problems with Analog Input

#2 Post by TommoT1 » 03 Sep 2018, 19:51

You cannot measure a current directly with the ADC, you only can measure a voltage.
For low voltages you can use one GND for both, the ESP and your Battery and then measure the voltage which drops at the resistor. Following Ohm's Laws you can calculate the current.
Regards

blacksn0w
New user
Posts: 4
Joined: 29 Aug 2018, 07:47

Re: Problems with Analog Input

#3 Post by blacksn0w » 03 Sep 2018, 20:23

Hey Tommo,
thanks for your answer.
In my frustration i mixed up the terms.

I only want to measure the voltage, no current.

So instead of using the ground from the battery, i would use the ground from the ESP-powering circuit? The right site of my scheme would be omitted?

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

Re: Problems with Analog Input

#4 Post by TD-er » 03 Sep 2018, 20:44

You still have to connect the ground of the ESP with the ground of the battery.
Just make sure the rest of the schematics allow that connection of both grounds.
And this will draw a current of 0.1 mA.
So a small button cell may get drained when connected.
An AG13/LR44 cell has about 155 mAh capacity, which means it is drained in 2 months.

blacksn0w
New user
Posts: 4
Joined: 29 Aug 2018, 07:47

Re: Problems with Analog Input

#5 Post by blacksn0w » 04 Sep 2018, 08:56

So my new construction looks like this, but is still not working (-1).
scheme.jpg
scheme.jpg (49.1 KiB) Viewed 7506 times
With the 8,2k resistor and with 0.1ma there should be 0.85V.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Problems with Analog Input

#6 Post by grovkillen » 04 Sep 2018, 09:00

And you are running the VCC enabled version?

[Edit]: I now see that you already started that you're doing that.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

blacksn0w
New user
Posts: 4
Joined: 29 Aug 2018, 07:47

Re: Problems with Analog Input

#7 Post by blacksn0w » 04 Sep 2018, 09:10

grovkillen wrote: 04 Sep 2018, 09:00 And you are running the VCC enabled version?

[Edit]: I now see that you already started that you're doing that.
Can i conclude from this, that it should work with this setup?
Maybe all my ESP12F are faulty, they are all from the same batch.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Problems with Analog Input

#8 Post by grovkillen » 04 Sep 2018, 10:05

Do you get any testing if you put a GPIO with PWM to the analog input? I mean just to test the unit itself.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

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

Re: Problems with Analog Input

#9 Post by TD-er » 04 Sep 2018, 10:21

You must not use the version with VCC in the filename, since you're then measuring the voltage on the Vcc line of the ESP (if connected)
For using an external voltage, you must use the normal firmware version.

Also you must use a 2nd resistor, which is not included in the image, from ADC to GND pin.
You want to make a resistor network to lower the voltage over the ADC pin and since the ADC to GND has a near infinite resistance, your 8k2 resistor has no effect and the voltage applied to the ADC pin is > 1 Volt.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 20 guests