Read internal Vcc voltage

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
rmtucker
Normal user
Posts: 57
Joined: 04 Oct 2015, 17:14

Read internal Vcc voltage

#1 Post by rmtucker » 04 Oct 2015, 17:17

Is there a plugin or method to read the internal Vcc voltage using esp easy?
I currently have a few battery powered sensors and i monitor the voltage using readvdd33 so i can change the batteries when the get too low.

rmtucker
Normal user
Posts: 57
Joined: 04 Oct 2015, 17:14

Re: Read internal Vcc voltage

#2 Post by rmtucker » 06 Oct 2015, 17:24

Well i had a go at writing a plugin to do this.
All seemed well at first.
But the readvdd33() instruction would cause a re-boot and interfered with the wifi connection (well documented problem)
But if the ESP is set to deep sleep it works great because the esp is re-booting over and over.
Also i could not get the value to be accepted by thingspeak because they were two different Tasks it was sending field1 and field2 in rapid succession as separate instructions,and thingspeak will only accept updates every 15 secs approx.
So i think it is ignoring the field2 update.
The only way i can see to get round this is too write a plugin for DS18b20 + Vdd Voltage (Not separate plugins)

ciprian
New user
Posts: 1
Joined: 24 Dec 2015, 20:35

Re: Read internal Vcc voltage

#3 Post by ciprian » 24 Dec 2015, 20:43

You can use getVcc() instead of readvdd33, it is working, no more resets :)
example

Code: Select all

//at the beginning of sketch
ADC_MODE(ADC_VCC); //vcc read
...
//in loop
float vdd = ESP.getVcc() / 1000.0;

mkotek
Normal user
Posts: 116
Joined: 15 Dec 2015, 10:58
Location: Lomianki, Poland
Contact:

Re: Read internal Vcc voltage

#4 Post by mkotek » 24 Dec 2015, 21:37

I would be interested in getting this plugin and I think, not only me, so you may publish it on github, so it can be merged with core, if it is stable.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: Read internal Vcc voltage

#5 Post by costo » 24 Dec 2015, 23:06

So far I know you can use some command to read the internal Vcc of the ESP but when you do that you cannot connect ANYTHING to the external ADC pin. So then why not use Analog Input in ESPEasy for reading the ADC. Ofcourse the ADC has a range upto about 1.1V so you have to use a divider to measure 3.3V. On the NodeMCU boards there is already a divider, 2 resistors, 220k to the ADC input and 100k from the ADC pin to ground. So it is easy to measure Vcc with ESPEasy, you only have to adjust the 'Formula Analog' in this way: %value%/333. This 333 need some calibration, then the value is given in volts in 3 digits.

About the resets when using the readvdd33() instruction, i believe this is solved in the Arduino ESPLibrary v2.0.0.

Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests