
Measure VCC
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 51
- Joined: 15 Sep 2016, 00:20
Re: Measure VCC
Great, now it's reading correctly.
Thanks again!

Re: Measure VCC
Use dummy device. Send to domoticz directly from Ina219 task, add rule to combine 3 tasks into one dummy and you will have device with 3 values.beic wrote:It would be really nice to see all 3 values in the ESPEasy Web GUI and to send desired value to Domoticz.Martinus wrote: It was designed for Domoticz that can handle only single value custom sensors. But you can run several tasks on the same module and select a different reading on each task.
Re: Measure VCC
You are right, but I wanted to see all 3 values if I use ESPEasy as standalone device!dzikus wrote:Use dummy device. Send to domoticz directly from Ina219 task, add rule to combine 3 tasks into one dummy and you will have device with 3 values.beic wrote:It would be really nice to see all 3 values in the ESPEasy Web GUI and to send desired value to Domoticz.Martinus wrote: It was designed for Domoticz that can handle only single value custom sensors. But you can run several tasks on the same module and select a different reading on each task.
Re: Measure VCC
Not sure if I understand why BME can show 3 values and INA219 cannot...Martinus wrote:It was designed for Domoticz that can handle only single value custom sensors. But you can run several tasks on the same module and select a different reading on each task.beic wrote:It's a bit off-topic, but it's VCC measurement related question...
I got today my INA219 and I hooked up to my ESP-01 with all other i2c sensors, but...
I tough that the INA219 will show me all three measurement values like Current and Power too in the "Devices" page.
Am I missing something here or I just miss see it somewhere that it will show me all three values?![]()
Thank you for your answer!
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: Measure VCC
Yes, I asked that same question!papperone wrote: Not sure if I understand why BME can show 3 values and INA219 cannot...

Re: Measure VCC
My solution gives you task (dummy device) with all 3 values as you describe.beic wrote:You are right, but I wanted to see all 3 values if I use ESPEasy as standalone device!dzikus wrote: Use dummy device. Send to domoticz directly from Ina219 task, add rule to combine 3 tasks into one dummy and you will have device with 3 values.
Re: Measure VCC
This is not a solution, as you need to "waste" 3 tasks to do something that other plugin do already by defaultdzikus wrote:My solution gives you task (dummy device) with all 3 values as you describe.beic wrote:You are right, but I wanted to see all 3 values if I use ESPEasy as standalone device!dzikus wrote: Use dummy device. Send to domoticz directly from Ina219 task, add rule to combine 3 tasks into one dummy and you will have device with 3 values.

My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: Measure VCC
This is solution If you do not specify initial conditions that you do not want to "waste" task. Beic didn't wrote anything about that, he only want task with 3 values, my solution gives that.papperone wrote: This is not a solution, as you need to "waste" 3 tasks to do something that other plugin do already by default
Re: Measure VCC
I've got the INA219 and configured it in ESP Easy but it will always show the minimum voltage of 0.80-0.90 even when there's zero load is this normal behavior or am i doing something wrong? So currently it will not read any voltage below that...
running build 147 RC8

running build 147 RC8
-
- New user
- Posts: 8
- Joined: 16 Nov 2016, 10:28
Re: Measure VCC
Hi,
Adding this resistor to measure the battery seems easy indeed, but if I understand properly, it means some current will permanently go through this resistor and thus discharge the battery. Am I correct ?
Is there a way to use the wemos to act as a switch to only allow current in that resistor when making a measurement ?
Or any other solution ?
My target is use an ESP Easy wemos D1 mini being powered by solar panel charging a 18650 battery, and I'd like to monitor the charge of battery. (I use a TP4056 to manage charge of sloar panels and convert power to 5v for the Wemos).
br,
Ricorico94
Adding this resistor to measure the battery seems easy indeed, but if I understand properly, it means some current will permanently go through this resistor and thus discharge the battery. Am I correct ?
Is there a way to use the wemos to act as a switch to only allow current in that resistor when making a measurement ?
Or any other solution ?
My target is use an ESP Easy wemos D1 mini being powered by solar panel charging a 18650 battery, and I'd like to monitor the charge of battery. (I use a TP4056 to manage charge of sloar panels and convert power to 5v for the Wemos).
br,
Ricorico94
Re: Measure VCC
Stepping up Lipo voltage to 5V just to burn it down to 3.3V through the linear regulator is by far the biggest waste of energy. Also the USB/UART bridge on the wemos will unneccesarily eat your battery. You should use a different, less complex module for this task and at best feed it through a low quiecent current switching regulator.
Regarding drain through the resistor devider (at least 2 resistors!): with reasonable chosen values it will be very low - Ohm's law.
It may be possible to use a small signal FET (i.e. 2N7000) controlled by a GPIO to switch the divider path but I doubt this is worth the effort (for sure not until the above points are optimized).
Edit: espressiv states around 1MOhm as input impedance, 100k for the devider (R1+R2) will give enough precision for the readings and a drain of 40 microamps, 5 years to deplete your 18650, forget the FET.
Regarding drain through the resistor devider (at least 2 resistors!): with reasonable chosen values it will be very low - Ohm's law.

It may be possible to use a small signal FET (i.e. 2N7000) controlled by a GPIO to switch the divider path but I doubt this is worth the effort (for sure not until the above points are optimized).
Edit: espressiv states around 1MOhm as input impedance, 100k for the devider (R1+R2) will give enough precision for the readings and a drain of 40 microamps, 5 years to deplete your 18650, forget the FET.

Re: Measure VCC
On top it should be mentioned that the WeMos D1 Mini already has a voltage divider at the ADC input to expand the range of the ESP-Chip.paxi wrote:Stepping up Lipo voltage to 5V just to burn it down to 3.3V through the linear regulator is by far the biggest waste of energy. Also the USB/UART bridge on the wemos will unneccesarily eat your battery. You should use a different, less complex module for this task and at best feed it through a low quiecent current switching regulator.
Regarding drain through the resistor devider (at least 2 resistors!): with reasonable chosen values it will be very low - Ohm's law.![]()
It may be possible to use a small signal FET (i.e. 2N7000) controlled by a GPIO to switch the divider path but I doubt this is worth the effort (for sure not until the above points are optimized).
Edit: espressiv states around 1MOhm as input impedance, 100k for the devider (R1+R2) will give enough precision for the readings and a drain of 40 microamps, 5 years to deplete your 18650, forget the FET.
The ESP8266 takes 0 .... 1 Volt. The WeMos can take up to around 3 Volts, so there is a divider soldered on the board.
This says the 1 MOhm ressistor won't work with the WeMos, sorry.
The trick with a FET won't work this way too. You can't place it at the "+" side as you won't get enough voltage from the GPIO to switch it on.
It might be placed at the ground side as usual - but if it is switched off the divider doesn't work anymore, giving full voltage on the
ADC input. This may fry the ESP depending on voltage.
Stepping up to 5 Volts and changing down back to 3,3 Volts indeed is a pure waste and might drain the battery.
A step up/step down Buck converter might work better.
A short search found this one: https://www.pololu.com/product/2122
I can't test it as i don't have one but the specs look good. Input 2,7 ...11,8 Volts, max current 0,5..1 Ampere.
Anyways, the voltage of the LiPo should be watched. If it runs down too far it will damage the LiPo cell.
There are cells with a built in circuit, for example the "NiteCore NL183", that gives protection against
short circuiting, over-loading and deep discharge. Be warned, these cells are expensive.
https://www.reichelt.de/Industriezellen ... ANGUAGE=EN
Regards
Shardan
Regards
Shardan
Shardan
Re: Measure VCC
1 Meg is the internal resistance of the ADC pin, wasn't meaning any external resistors with that.This says the 1 MOhm ressistor won't work with the WeMos, sorry.

You have to ensure that current through the pin << crurrent through the divider for decent, linear readings.
Running a buck/boost converter seems overkill, the ESPs are rated down to 3.0V which, for my taste, is already too deep to keep a Lipo happy. There is very little capacity below ~3.6V in a lipo anyway.
Usually simple buck converters just pass through the input voltage if it is lower than the set output.
Re: Measure VCC
So 1 MOhm is the internal impedance of the ESP chip.paxi wrote:1 Meg is the internal resistance of the ADC pin, wasn't meaning any external resistors with that.This says the 1 MOhm ressistor won't work with the WeMos, sorry.![]()
You have to ensure that current through the pin << crurrent through the divider for decent, linear readings.
Running a buck/boost converter seems overkill, the ESPs are rated down to 3.0V which, for my taste, is already too deep to keep a Lipo happy. There is very little capacity below ~3.6V in a lipo anyway.
Usually simple buck converters just pass through the input voltage if it is lower than the set output.
But what are the values of the divider built on the WeMos? As said there is a divider soldered on the WeMos D1 Mini board,
I had this checked some days ago for some reason.
The described buck converter is a stepo up / step down, so it can produce 3,3V even from a worn out battery with 2,8V.
They are mostly used for solar powered devices where voltage may differ heavily.
Such a buck converter in any way is better then converting up to 5 V and back to 3,3V

I'm not sure where the limits of a ESP are for stable operation. If it runs stable with 3.0 ...3.7 Volts, it's OK.
Regards
Shardan
Shardan
Re: Measure VCC
The ESP datasheet says 3.0 to 3.6 volts.
The wemos has a 3.3V pin, I guess one can feed it from there but it seems the USB bridge is also powered from it.
Found a nice page about the wemos' voltage divider and how to adapt it to measure a lipo.
You can still carry this over to a bare ESP-12 module, the wemos is nice for development and prototyping but I would never use it in a battery powered application.
The wemos has a 3.3V pin, I guess one can feed it from there but it seems the USB bridge is also powered from it.
Found a nice page about the wemos' voltage divider and how to adapt it to measure a lipo.

You can still carry this over to a bare ESP-12 module, the wemos is nice for development and prototyping but I would never use it in a battery powered application.
-
- New user
- Posts: 8
- Joined: 16 Nov 2016, 10:28
Re: Measure VCC
Hi,
Thanks a lot for all your comments.
Indeed, I was not realizing that m converter could be so unefficient. To be honest, I followed a tutorial which was looking very easy and based on this converter which is not only managing the charge of battery to protect it, but also managing the discharge of battery to avoid issues.
the tutorial: https://github.com/TheAustrian/Wemos-D1 ... er-Station
the converter I use: https://fr.aliexpress.com/item/Smart-El ... 42672.html
Before you raise the point : yes, I'm aware that the status leds on that board are also wasting power. I'll probably unsolder them in final setup.
I looked at the converter you mentioned on Polulu. So I guess it would be connected directly on the battery, but then I need to find an equivalent of the TP4056 which would do only the charging, and another board which would control the discharge between the polulu board and the battery to avoid damages. Correct ?
Ricorico94
Thanks a lot for all your comments.
Indeed, I was not realizing that m converter could be so unefficient. To be honest, I followed a tutorial which was looking very easy and based on this converter which is not only managing the charge of battery to protect it, but also managing the discharge of battery to avoid issues.
the tutorial: https://github.com/TheAustrian/Wemos-D1 ... er-Station
the converter I use: https://fr.aliexpress.com/item/Smart-El ... 42672.html
Before you raise the point : yes, I'm aware that the status leds on that board are also wasting power. I'll probably unsolder them in final setup.
I looked at the converter you mentioned on Polulu. So I guess it would be connected directly on the battery, but then I need to find an equivalent of the TP4056 which would do only the charging, and another board which would control the discharge between the polulu board and the battery to avoid damages. Correct ?
Ricorico94
Re: Measure VCC
You can use that module (in theory). Be aware that it takes 5V as charging input, the output is "only" battery voltage. I don't know how the 4056 will react to varying input voltages/currents from the solar cell.
The protection circuit in it just cuts the output if 3A are exeeded or Vbat is < 2.5V. You need a seperate regulator anyways. I never understood why these protection circuits allow for such low discharge (they all do), don't rely on that and avoid running into that cutoff. Below 2.5V is the are where a LiXX can become dangerous - lifetime shortening damage occurs way above that. If you measure Vbat you can issue a warning early enough to swap the battery or charge externally.
The protection circuit in it just cuts the output if 3A are exeeded or Vbat is < 2.5V. You need a seperate regulator anyways. I never understood why these protection circuits allow for such low discharge (they all do), don't rely on that and avoid running into that cutoff. Below 2.5V is the are where a LiXX can become dangerous - lifetime shortening damage occurs way above that. If you measure Vbat you can issue a warning early enough to swap the battery or charge externally.
Who is online
Users browsing this forum: Google [Bot] and 22 guests