V_BAT Monitoring on Huzzah Feather

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

V_BAT Monitoring on Huzzah Feather

Post by kfricke » Mon May 16, 2016 11:47 am

Trying to use a Huzzah Feather as a battery supplied sensor node there are some possible issues while staying in deep sleep: The red LED is glowing very dim and it seems there is some leakage somewhere!?

Besides my HDC1008 sensor on I2C (with pullup-resistors) there is only the following additional circuitry. I have not yet built in logic-level mosfets to cut the power supply for the voltage divider and the I2C bus due to the missing through-hole parts and understanding how to identify them in the electronic shops. I think those should solve these issues, right? Can you give me an advice where to find the p-channel mosfet Pythoncoder used in the fantastic documentation of his project?
Another interesting suggestion is an analogue switch, which i also have not found as through-hole part yet. Do you have some advice to this?

This is my simple high-resistance voltage divider to take the battery voltage down into the 0-1 volt range for the ADC pin:

Code: Select all

              o V_Bat
              |
             .-.
         10M | |
             | |
             '-'
              |
              o--------o-----o ADC-Pin
              |        |
             .-.       |
          2M | |      --- 0.1µF
             | |      ---
             '-'       |
              |        |
              o--------'
              |
             ===
             GND

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: V_BAT Monitoring on Huzzah Feather

Post by deshipu » Mon May 16, 2016 1:21 pm

I'm not sure the huzzah boards are suitable for low-power use cases like this -- mostly due to the extra LEDs and other components on them. You will probably get much better results using a naked module, maybe with Adafruit's power backpack.

I'm looking at the schematic of your voltage divider, and I'm amazed it works. Those are some huge resistors, the current flowing to the ADC would be somewhere around 0.33µA -- I'm not sure that is enough to make a proper reading with the ADC.

As for the parts, I almost always find what I need at http://tme.eu -- although I usually wait until there is a long list of things to buy, and often also ask friends if they need something, to buy everything as a single order.

User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: V_BAT Monitoring on Huzzah Feather

Post by kfricke » Mon May 16, 2016 10:39 pm

deshipu wrote:I'm not sure the huzzah boards are suitable for low-power use cases like this -- mostly due to the extra LEDs and other components on them. You will probably get much better results using a naked module, maybe with Adafruit's power backpack.
This are my initial test with the Huzzah. I am usually using the Olimex boards with the LEDs taken off.
I'm looking at the schematic of your voltage divider, and I'm amazed it works. Those are some huge resistors, the current flowing to the ADC would be somewhere around 0.33µA -- I'm not sure that is enough to make a proper reading with the ADC.
The 0.1 µF capacitor does the trick. You actually do get quite good readings.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: V_BAT Monitoring on Huzzah Feather

Post by dhylands » Mon May 16, 2016 11:30 pm

I think that what happens is that the resistor divider charges the cap, and the cap can then deliver a burst of current to satisfy the ADC. The trick will be not to read it again before the cap has time to recharge.

User avatar
marfis
Posts: 215
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: V_BAT Monitoring on Huzzah Feather

Post by marfis » Tue May 17, 2016 5:18 am

as for the dim red LED, it seems to be a port issue (pin is left floating in deep sleep mode). They suggest using a weak pullup resistor and/or cutting traces or desoldering the LED..
https://forums.adafruit.com/viewtopic.p ... ep#p434123

User avatar
marfis
Posts: 215
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: V_BAT Monitoring on Huzzah Feather

Post by marfis » Tue May 17, 2016 5:25 am

regarding the voltage divider.. i'd be concerned about leakage current, especially with relative high C's.

Instead you could try switching the lower point of your divider using a free gpio and use a much lower impendance (something like 3k3/1k). Helps also with noise and external EMC issues...

The overall current consumption will not be higher since an ADC measurement may take around 10-100usec, with 1mA for the divider and 1Hz measurement interval you will get around 0.1uAsec

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: V_BAT Monitoring on Huzzah Feather

Post by pythoncoder » Tue May 17, 2016 5:37 am

kfricke wrote:...Can you give me an advice where to find the p-channel mosfet Pythoncoder used in the fantastic documentation of his project?
Another interesting suggestion is an analogue switch, which i also have not found as through-hole part yet....
Thanks for your kind words :D

I had trouble locating a through-hole P-channel MOSFET in a sensible package with the right characteristics (low RDSon, low threshold voltage). I sourced the LP0701N3-G from TME Electronic Components (tme.eu) http://www.tme.eu/en/details/lp0701n3-g ... -supertex/.
As for a through-hole analog switch the 74HC4066N is the one I used; it's widely available.
Peter Hinch
Index to my micropython libraries.

Post Reply