Voltage divided mosfet switch, low-voltage powerdown ESP8266

Gheez. So much to learn about in electronics.....

I would like to powerdown an ESP8266 when my 18650 battery hits a sub 3.3V voltage using a voltage divider circuit connected to the gate of an n-channel mosfet.

I've been looking at the FQP30N06L.pdf

The VGS(th) min value is 1.0 Volt at Vgs = Vds. Id = 250 uA.

Is this a safe usage of a n-channel mosfet? Working on the min VGS(th) side?

Basically all I want is to do is hold a pin HIGH with aslittle current flow as possible while the battery voltage is
above 3.3. When it drops the pin should go low and put my device in off mode as not to damage it.

Am I missing something or is there a better alternative?

Is there a better mosfet for the job than the one I linked?

I'd appreciate some input :slight_smile:

I cannot really imagine that works well. It is not like a MOSFET was a binary device that is either on or off. Rather, it will go through the saturation region (some people call this linear region, but I think this term is REALLY easy to misunderstand, so I'll go with ohmic and saturation region) and the drain source resistance will go up, eventually leading to instability in your ESP.

I could probably come up with some opamp-as-a-comparator design or something (like that nifty NE555 circuit I just came across), but I have never productively used such a circuit, so I'll leave that to others.

Thank you for the answer, I was thinking that this would surely have some stability issues and it's good to have it confirmed atleast. :slight_smile:

Have you come across some information that leads you to think that a low supply voltage will harm the ESP8266? - Scotty

That information would clearly be against the datasheet:
Operating Voltage 2.5V ~ 3.6V
file:///home/voit/Downloads/0a-esp8266ex_datasheet_en.pdf

He might rather want to save his LiPo, but 3.3V are ample there.

That's an interesting project. I thought about a similar method to power down ESPs and Arduinos, respectively, when the LiPo voltage drops to a certain amount (I chose 3V). My ESP-01 devices are pretty stable even when power with two AA eneloop (unregulated).

I came across some ideas that involved a hardware button to start the device, which than controls the MOSFET via pin to keep the power on. And eventually power off the MOSFET when the threshold is hit. I had no time yet to realize this project but it seemed quite doable.
I'm a beginner, too, so I cannot recommend a specific MOSFET, but I read that p-channel MOSFET could be the better choice. I bought some NTR2101P-D which are doing a good job as far as I can tell.

Anyway, I'm interested in your solution when it's ready. :slight_smile:

terraduino:
My ESP-01 devices are pretty stable even when power with two AA eneloop (unregulated).

That is not surprising at all. Two AA are well within the specs and you don't need to regulate batteries. There are few things that give more stable voltage, noise/ripplewise.

Just google "low voltage cut off circuit". You will find that circuits are more complicated than you might expect. This is because battery voltage will decrease under load. If the battery discharges and reaches the cutoff voltage under load, and is then cut off, the voltage will rise again a bit. This will exceed the threshold and would switch the device on again, only to switch off very soon after. To avoid that you need hysteresis in the circuit.

Thanks for the reminder, ElCaron. Although I witnessed the "voltage recovery", it will be no problem in my described scenario because the microchip cannot power on itself after it switch itself of via MOSFET :wink:

Btw. sorry for the wrong term "unregulated battery". What I meant was: I don't use a voltage regulator, step-up converter or capacitors to smoothen/stabilize the power supply. :slight_smile:

Best!

scottyjr:
Have you come across some information that leads you to think that a low supply voltage will harm the ESP8266? - Scotty

Yes perhaps, that was basically what I wanted to avoid, I did not know untill a couple of days ago that the Vin of ESP8266 vas 3.3V +/- 0.3 V.

I will be using protected 18650 li-ions as my battery source and im just worried about the gray area in between the battery beeing able to fully power my ESP through a HT7333
to the point at which the batteries own circuitry shuts the connection down

heck of a lot easier just turning the device off when i reach sub 3.3v on the li-ion than worrying :smiley: or atleast so I thought..

I am trying to escape the need to solder the ADC pin of my ESP8266-01 since its pins are so damn small... The easiest way would be to monitor the batt voltage of the ADC pin and just avoid doing any wireless transmissions when it powers up, basically just go to sleep instantly. This will prolonge the battery life untill I notice it's in need of charging. Due to no connections being made by the device.

edit:
I also found this crude method of using zener diodes to light up an LED when below a certain voltage, still evaluating pros and cons of it. But might be an interesting read for someone so here it is:

@fettkeewl
Maybe you want to have a look at this. It's designed as a smart button but you could use this method to easily powerd-down the ESP.
Btw. if you don't want to solder to the µC pins you could use a voltage divider and a spare digital pin to measure the voltage. If I read page 15 of the ESP8266EX correctly, than Input high voltage (V_IH) is 0.75*V_IO. When you want to read a zero on the digital pin you choose a voltage divider that gives you something around 2.5V when the Li-Ion reaches 3.3V

Best!

terraduino:
@fettkeewl
Maybe you want to have a look at this. It's designed as a smart button but you could use this method to easily powerd-down the ESP.
Btw. if you don't want to solder to the µC pins you could use a voltage divider and a spare digital pin to measure the voltage. If I read page 15 of the ESP8266EX correctly, than Input high voltage (V_IH) is 0.75*V_IO. When you want to read a zero on the digital pin you choose a voltage divider that gives you something around 2.5V when the Li-Ion reaches 3.3V

Best!

Thank you for your suggestion unfortunately my gpios will be taken by temp and hall effect sensors and possibly a statuscheck button on the RX pin which take presedence over that of low voltage cut off as far as my needs go.

But its def. not a bad idea when they are avalible. I have ordered an i2c ADC board that gives me 4 analog inputs but that board costs as much as an ESP8266 so I probably wont use it as an standard component for my sensors since im building many after I figure the first one out.

4x ADC over i2c

It will also end up taking to much space im afraid with all other components.

My enclosure is this box where I will only use 1 slot for a battery and the other to hold the electronics.
Ofc making the proper modding with cutting out the excess bat-plates and soldering the negative pin to a wire.

2x 18650 enclosure

Since ill only have the temp sensor inside inside the box i should have enough space for ye old resistors and such. Still waiting for the delivery to test it out tough ^^

I've been using this AD converter with my ESP-01. Unfortunately, I couldn't find a vendor anymore. :o AFAIR it was cheap ;). But, anyway, I think it is to big for your project.

Too bad if all four pins (0,1,2,3) are used. However, you could use a i2c temperature sensor and free one more pin? Maybe the LMA75A or the AM2320 fits your price range? I've used the latter one, temp & humidity, worked well for me.

Btw. would it be an option to use an ESP-12f? I've used some of them with similar success. More GPIO and the ADC right at your disposal.

Best!

terraduino:
I've been using this AD converter with my ESP-01. Unfortunately, I couldn't find a vendor anymore. :o AFAIR it was cheap ;). But, anyway, I think it is to big for your project.

Too bad if all four pins (0,1,2,3) are used. However, you could use a i2c temperature sensor and free one more pin? Maybe the LMA75A or the AM2320 fits your price range? I've used the latter one, temp & humidity, worked well for me.

Btw. would it be an option to use an ESP-12f? I've used some of them with similar success. More GPIO and the ADC right at your disposal.

Best!

Those are some interesting proposals! I shall take them under consideration thank you.
Since I want to keep my esp8266 sensors as small as possible I will try to make my builds around the case I linked previously. I'll ditch the idea if there is no way I can actually make use of it / fit the bare necessities.

I've got an ESP-12 lying around at home so I could give it a go but with the tight space and the spacing between the gpios on it I cant really make it "modular" in the sense that I can unplugg the chip for programming or even afford to solder the 4 pins needed to program it.

My esp-01 will be plugged into the circuitry with female duponts soldered to a board for running mode and i'll unplugg the device when I have a need for re-programming.
The ESP-12 would need to be soldered in an manner not fitting my intended use and would not be as flexible. Saving it for a larger AC powered project :wink:

All in all, I wont know anything untill I get that battery box and start evaluating what I need and don't need :slight_smile:

Digikey.com carries the PCF8591 chip & 2 expansion boards still
http://www.digikey.com/products/en?keywords=PCF8591

CrossRoads:
Digikey.com carries the PCF8591 chip & 2 expansion boards still
Electronic Components and Parts Search | DigiKey Electronics

Thank you that was a nice tip! I've previously found a smaller chip working only with DC but that ADC one looks more interesting and the price is pretty nice aswell

eBay PCF8591

fettkeewl:
keep my esp8266 sensors as small as possible .... ESP-12 ... cant really make it "modular" in the sense that I can unplugg the chip for programming or even afford to solder the 4 pins needed to program it.

I assumed that the ESP-12 is smaller in size and you are more flexible because of the missing vertical male header.
Btw. I thought you could solder short wires to the GPIOs of the ESP-12 you need and solder them onto female header. Than you could glue these on the bottom of the ESP-12 or cut a small whole in your case to make the pins for flashing externally available. So there would be no need to open the case and/or unplugging the sensors. Hope you don't need them waterproof :wink:
Sure, if you don't like soldering that's not the way to go.

Best!

terraduino:
I assumed that the ESP-12 is smaller in size and you are more flexible because of the missing vertical male header.
Btw. I thought you could solder short wires to the GPIOs of the ESP-12 you need and solder them onto female header. Than you could glue these on the bottom of the ESP-12 or cut a small whole in your case to make the pins for flashing externally available. So there would be no need to open the case and/or unplugging the sensors. Hope you don't need them waterproof :wink:
Sure, if you don't like soldering that's not the way to go.

Best!

This might have worked cant find any dimensions though, but the shipping is 7,5x the price of the item

Utterly ridicilous shipping
http://www.ebay.com/itm/5X-ESP8266-Super-Node-PCB-for-ESP-7-12-12-E-F-S-FREE-SHIPPING-ship-2-biz-days-/272422927299?hash=item3f6dabfbc3:g:6wcAAOSwo4pYC7Lo

Thanks for the link, didn't know that exists.
Although it looks useful, I just solder the ESP12 via wires to a PCB :wink:

Best!