Measure VCC

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
adrianmihalko
Normal user
Posts: 51
Joined: 15 Sep 2016, 00:20

Re: Measure VCC

#51 Post by adrianmihalko » 13 Nov 2016, 15:05

Great, now it's reading correctly. ;) Thanks again!

dzikus
Normal user
Posts: 17
Joined: 12 Jul 2016, 09:55

Re: Measure VCC

#52 Post by dzikus » 17 Nov 2016, 19:56

beic wrote:
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.
It would be really nice to see all 3 values in the ESPEasy Web GUI and to send desired value to Domoticz.
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.

User avatar
beic
Normal user
Posts: 142
Joined: 18 Aug 2016, 18:19

Re: Measure VCC

#53 Post by beic » 17 Nov 2016, 20:28

dzikus wrote:
beic wrote:
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.
It would be really nice to see all 3 values in the ESPEasy Web GUI and to send desired value to Domoticz.
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.
You are right, but I wanted to see all 3 values if I use ESPEasy as standalone device!

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Measure VCC

#54 Post by papperone » 17 Nov 2016, 20:45

Martinus wrote:
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.

Image

Am I missing something here or I just miss see it somewhere that it will show me all three values? :oops:

Thank you for your answer! ;)
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.
Not sure if I understand why BME can show 3 values and INA219 cannot...
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

User avatar
beic
Normal user
Posts: 142
Joined: 18 Aug 2016, 18:19

Re: Measure VCC

#55 Post by beic » 17 Nov 2016, 21:59

papperone wrote: Not sure if I understand why BME can show 3 values and INA219 cannot...
Yes, I asked that same question! ;)

dzikus
Normal user
Posts: 17
Joined: 12 Jul 2016, 09:55

Re: Measure VCC

#56 Post by dzikus » 18 Nov 2016, 07:54

beic wrote:
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.
You are right, but I wanted to see all 3 values if I use ESPEasy as standalone device!
My solution gives you task (dummy device) with all 3 values as you describe.

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Measure VCC

#57 Post by papperone » 18 Nov 2016, 08:25

dzikus wrote:
beic wrote:
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.
You are right, but I wanted to see all 3 values if I use ESPEasy as standalone device!
My solution gives you task (dummy device) with all 3 values as you describe.
This is not a solution, as you need to "waste" 3 tasks to do something that other plugin do already by default :)
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

dzikus
Normal user
Posts: 17
Joined: 12 Jul 2016, 09:55

Re: Measure VCC

#58 Post by dzikus » 18 Nov 2016, 09:07

papperone wrote: This is not a solution, as you need to "waste" 3 tasks to do something that other plugin do already by default :)
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.

Pietertje
New user
Posts: 5
Joined: 07 Dec 2016, 20:14

Re: Measure VCC

#59 Post by Pietertje » 07 Dec 2016, 20:19

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... :roll:

running build 147 RC8

ricorico94
New user
Posts: 8
Joined: 16 Nov 2016, 10:28

Re: Measure VCC

#60 Post by ricorico94 » 02 Mar 2017, 12:05

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

paxi
Normal user
Posts: 121
Joined: 02 Feb 2017, 00:48
Location: Germany

Re: Measure VCC

#61 Post by paxi » 02 Mar 2017, 16:28

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. :lol:

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Measure VCC

#62 Post by Shardan » 02 Mar 2017, 20:15

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. :lol:
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.
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

paxi
Normal user
Posts: 121
Joined: 02 Feb 2017, 00:48
Location: Germany

Re: Measure VCC

#63 Post by paxi » 02 Mar 2017, 20:27

This says the 1 MOhm ressistor won't work with the WeMos, sorry.
1 Meg is the internal resistance of the ADC pin, wasn't meaning any external resistors with that. ;)
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.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Measure VCC

#64 Post by Shardan » 02 Mar 2017, 22:24

paxi wrote:
This says the 1 MOhm ressistor won't work with the WeMos, sorry.
1 Meg is the internal resistance of the ADC pin, wasn't meaning any external resistors with that. ;)
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.
So 1 MOhm is the internal impedance of the ESP chip.
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

paxi
Normal user
Posts: 121
Joined: 02 Feb 2017, 00:48
Location: Germany

Re: Measure VCC

#65 Post by paxi » 02 Mar 2017, 23:07

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.

ricorico94
New user
Posts: 8
Joined: 16 Nov 2016, 10:28

Re: Measure VCC

#66 Post by ricorico94 » 03 Mar 2017, 00:07

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

paxi
Normal user
Posts: 121
Joined: 02 Feb 2017, 00:48
Location: Germany

Re: Measure VCC

#67 Post by paxi » 03 Mar 2017, 04:27

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 138 guests