Independent supplies for ESP32Wroom32D & sensors

jjuduma
Posts: 11
Joined: Fri Jun 05, 2020 5:33 pm

Independent supplies for ESP32Wroom32D & sensors

Postby jjuduma » Fri Jun 05, 2020 6:27 pm

Hello people. I am relatively new to the Espressif community and hardware design in general.
I am working on a project and the Wroom32D was an ideal fit for the use case I am attempting to provide a solution to.

Trying to implement a mesh network which will usually be situated in a remote location, where little to no human interaction with the device occurs. As such, a core requirement for the device is sustainable power supply without the need to consistently change the batteries.
Short of hooking individual relay and friend nodes with a bigger battery (which will not work for this particular use case) or using solar (customers will not pay for solar for each node), I decided to have separate power domains for the ESP32 and the sensors

The ESP32 is a relatively power hungry RF-MCU and as such I decided by factory default to power the system (MCU + Sensors) using Alkaline cells in series (2 of them). I will be boosting the voltage obviously to 3.3v ( I am still very unsure of this qw there seems to be a warning label with SMPSs regarding RF circuits). This will not lock customers to always purchasing an extra battery for the sensors. Customers that do not want to extend power capacity of the device can still power the system and will depend on the power management scheme adopted.

I have attached 4 schematic designs.
  • Design 1 (Design_ask.png) - I am using the Power good signal of a DC boost converter to alert the MCU to switch off the Mosfet that directs power to the sensors from the ALkaline cells. My concern here is this will not happen before the sensor power domain sees the voltage at the Vout pin of the boost converter.
    DesignAsk.PNG
    DesignAsk.PNG (66.55 KiB) Viewed 6553 times
  • Design 2 (Design_ask_update.png) - Changed to a simple boost converter with an enable input. This will be activated (but delayed with the capacitor present ) while the same voltage shuts off the mosfet. I wasnt sure if the delay assumption was accurate. I am not even sure if the design is correct.
    DesignAsk_Update.PNG
    DesignAsk_Update.PNG (66.45 KiB) Viewed 6553 times
  • Design 3 (Design_ask_update2.png) - ALtered the design a bit to place the switching task on the ESP32. With this setup, the voltage at the coin cell line is measured by the ADC in esp32 and the appropriate pin in toggled (or not) depending on the voltage level measured. The enable input of the converter is still controlled by the MCU. My main cause for concern is the power consumption in operating the mosfet as well as keeping the enable on.
    DesignAsk_Update_2.PNG
    DesignAsk_Update_2.PNG (92.05 KiB) Viewed 6553 times
  • Design 4(Design_ask_update3.png) - Did some extra research and found a concept called ganging which includes chaining GPIO pins together by shorting them. This is done to apparently increase the total drive strength of the MCU when it sources/sinks. I decided to replace the transistor from the previous design with a ganged set of GPIOs. I have read from several sources that as you increase the number of GPIO pin drivers, power dissipation by the device starts increasing. I would like to confirm if it is possible to do this with the ESP32 gpio pins.
Please note: As I cannot attach more than 3 photos to the post, I will attach design 4 in a reply.

Please be aware that the sensors will be carefully chosen which are relatively low power ranging from 100s of microamps to a few milliamps (some might reach 10s of milliamps). But as I would like to design for extensibility, I have to make enough headroom for potential extension to the system.

I would like to know if the final design is feasible with the esp32. If not, what about the other designs? Any modifications to make them more efficient?

Thanks a lot in anticipation.

ESP_Sprite
Posts: 9016
Joined: Thu Nov 26, 2015 4:08 am

Re: Independent supplies for ESP32Wroom32D & sensors

Postby ESP_Sprite » Sat Jun 06, 2020 8:59 am

What's the use of the coin cell in this scheme? Are the sensors intelligent, in that you also want to power them when the alkalines run out?

Additionally, beware of the body diode that mosfets have: in some of your designs, the coin cell can power the ESP32 if the alkaline batteries run out.

jjuduma
Posts: 11
Joined: Fri Jun 05, 2020 5:33 pm

Re: Independent supplies for ESP32Wroom32D & sensors

Postby jjuduma » Sat Jun 06, 2020 9:41 pm

Hi..

I apologize. I was meant to upload the 4th design. While awaiting the approval of this post I kind of got carried away with other things. Here it is:
DesignAsk_Update_3.PNG
DesignAsk_Update_3.PNG (84.68 KiB) Viewed 6496 times
I also made a mistake in the third design I uploaded. Here is the corrected one:
DesignAsk_Update_2Cor.PNG
DesignAsk_Update_2Cor.PNG (87.58 KiB) Viewed 6496 times
ESP_Sprite wrote:
Sat Jun 06, 2020 8:59 am
What's the use of the coin cell in this scheme? Are the sensors intelligent, in that you also want to power them when the alkalines run out?
The aim is to have two power sources on the same board. The Alkaline cell will power the whole system (ESP and sensors) by default. But if the user puts a coin cell in, the ESP32 can read the battery of coin cell through an ADC, then turn off the mosfet (See the picture above "DesignAsk_Update_3.PNG).
ESP_Sprite wrote:
Sat Jun 06, 2020 8:59 am
Additionally, beware of the body diode that mosfets have: in some of your designs, the coin cell can power the ESP32 if the alkaline batteries run out.
I have updated that design. Will the body diode still be an issue irrespective? Do i need to add a Schottky to prevent that?

I am inclined to thinking this "DesignAsk_Update_3.PNG" will be the best solution but I am not sure if its possible with the ESP32 (i.e Ganged GPIO driver pins). Please assist.

ESP_Sprite
Posts: 9016
Joined: Thu Nov 26, 2015 4:08 am

Re: Independent supplies for ESP32Wroom32D & sensors

Postby ESP_Sprite » Sun Jun 07, 2020 5:01 pm

Sure, but what is the use of the coin cell? It seems that you want to keep the sensors powered even when the ESP32 batteries run dry, so I assume there is some intelligence in the sensors that can store the readings?

jjuduma
Posts: 11
Joined: Fri Jun 05, 2020 5:33 pm

Re: Independent supplies for ESP32Wroom32D & sensors

Postby jjuduma » Sun Jun 07, 2020 5:18 pm

ESP_Sprite wrote:
Sun Jun 07, 2020 5:01 pm
Sure, but what is the use of the coin cell? It seems that you want to keep the sensors powered even when the ESP32 batteries run dry, so I assume there is some intelligence in the sensors that can store the readings?
Hello again and thanks for the reply.

The idea behind the coin cell battery is to provide an alternate source of power to sensors, for nodes that wont play the role of a low power node in the mesh network. After a little research, it seemed that the usual advice when implementing a mesh network is to avoid operating "friend and relay nodes" on batteries. But unfortunately my use case makes it highly improbable to arrive at a cost effective solution. As such, I decided that I use two sources of power for the board, significantly reducing (hopefully) the system reliance on one source of power. I am yet to do any tests so I cannot be certain.

Using the coin cell to implement some kind of smart sensing makes sense tbh.

My main question is....is ganged GPIOs permitted in the ESP32? What sort of implementation requirements do I have to consider such as max number of pins that can be ganged? Better yet, any help on how to implement my requirement that is better than this?

ESP_Sprite
Posts: 9016
Joined: Thu Nov 26, 2015 4:08 am

Re: Independent supplies for ESP32Wroom32D & sensors

Postby ESP_Sprite » Mon Jun 08, 2020 7:27 am

I am still confused by how you would think your mesh would work, that is, which nodes would have which batteries installed. As far as I can see, a node with only a coin cell would be useless as the ESP32 can't run from that and as such the node cannot join in the mesh. A node with only alkaline batteries could join in the mesh no problem. Which leads to my question: what is the coin cell good for? What do you want a node with only the coin cell installed to do?

jjuduma
Posts: 11
Joined: Fri Jun 05, 2020 5:33 pm

Re: Independent supplies for ESP32Wroom32D & sensors

Postby jjuduma » Mon Jun 08, 2020 9:38 am

ESP_Sprite wrote:
Mon Jun 08, 2020 7:27 am
I am still confused by how you would think your mesh would work, that is, which nodes would have which batteries installed. As far as I can see, a node with only a coin cell would be useless as the ESP32 can't run from that and as such the node cannot join in the mesh. A node with only alkaline batteries could join in the mesh no problem. Which leads to my question: what is the coin cell good for? What do you want a node with only the coin cell installed to do?
Hi again,

Thanks again for your reply. I am sorry I didnt communicate properly.

A node with only the coin cell will not join the mesh, you are correct. A node with only the Alkaline battery will serve as a low power node. A user provisioning a node as a relay node or a friend node for example, can add a coin cell, which will now be responsible for powering the sensors. The Alkaline batteries will now be solely responsible for powering the ESP32. Once the ESP32 cannot be powered by the Alkaline, the supervisor circuitry kicks in and holds the ESP in reset. I will also be implementing a voltage divider across the alkaline cells to detect low battery and alert user.

The aim is to balance out the power requirements of the mesh network due to consumption of nodes that do not spend majority of the time in sleep mode.

I hope I have made it clearer. The ganged gpio method seems like the easiest if the ESP32 permits. But I can also use a gate driver to increase the drive strength of the gpio pin that is powering the sensors, right? But thats an extra little tinny bit of power consumption as well.

Thanks again for your replies.

ESP_Sprite
Posts: 9016
Joined: Thu Nov 26, 2015 4:08 am

Re: Independent supplies for ESP32Wroom32D & sensors

Postby ESP_Sprite » Mon Jun 08, 2020 1:22 pm

Okay, so you're saying the ESP32 is effectively going to be useless in a node that has a coin cell but not an alkaline? That's an unconventional choice, but it can be a viable one I guess.

In the third design, what is the use of res1/res2? As the gate of a mosfet doesn't allow current to flow, res1 is superfluous, which makes me wonder what res2 is good for.

Wrt the ganged GPIO example: in this particular case it may or may not work. If you want to do it according to the books, the specified output voltage on a high GPIO is at minimum 0.8*Vcc, which in the case of a 3.3V power supply is 2.64V. A GPIO allows a current drain of up to 40mA in that situation. You have an additional Schottky there, lowering that by about 0.3V, which means that absolute worst case the GPIOs will provide 2.3V to your sensors; your sensors need to be able to work on that.
(However, do keep in mind that in this worst case scenario, the sensors will *always* drain the coin first. The coin cell is 3.0V, minus a 0.3V drop over the Schottky is 2.7V. As this is more than the worst-case 2.3V from the GPIO, the GPIO Schottky will block and the sensors will run off the coin cell.)

Note I used 'worst case' a lot here. In general, under low current drain, you probably can expect to output GPIOs to expect a voltage very close to the power supply voltage. However, the exact behaviour of this is is uncharacterized, so there is no way to *guarantee* the GPIO voltage will be like that in all chips and under all circumstances.

(Also, for some more inspiration, you may want to read up e.g. here on using PMOSfets as ideal diodes.)

jjuduma
Posts: 11
Joined: Fri Jun 05, 2020 5:33 pm

Re: Independent supplies for ESP32Wroom32D & sensors

Postby jjuduma » Mon Jun 08, 2020 3:05 pm

ESP_Sprite wrote:
Mon Jun 08, 2020 1:22 pm
Okay, so you're saying the ESP32 is effectively going to be useless in a node that has a coin cell but not an alkaline? That's an unconventional choice, but it can be a viable one I guess.
Precisely. Device comes factory fitted with alkaline cells. Coin cell can be added for high power nodes.
ESP_Sprite wrote:
Mon Jun 08, 2020 1:22 pm
In the third design, what is the use of res1/res2? As the gate of a mosfet doesn't allow current to flow, res1 is superfluous, which makes me wonder what res2 is good for.
I might be wrong in my understanding of mosfets as a switch. But i assumed that the mosfet has to be in the default state. My logic behind the design is that res2 pulls the gate of the PMosfet low, which turns the switch on allowing current to flow. I believe the drain being at a lower potential when no coin cell is present means the current will flow towards the sensor power domain, right?.
Res1 was for potential stray inductance due to leakage currents in the transistor when raising the voltage of the gate to a higher level. Are these wrong assumptions?
ESP_Sprite wrote:
Mon Jun 08, 2020 1:22 pm
Wrt the ganged GPIO example: in this particular case it may or may not work. If you want to do it according to the books, the specified output voltage on a high GPIO is at minimum 0.8*Vcc, which in the case of a 3.3V power supply is 2.64V. A GPIO allows a current drain of up to 40mA in that situation. You have an additional Schottky there, lowering that by about 0.3V, which means that absolute worst case the GPIOs will provide 2.3V to your sensors; your sensors need to be able to work on that.
Based off your analysis (thanks btw), my major concern will be to ensure my sensors can run off 2.3V minus the battery dropout voltage or something. Please may i ask if I need diode D2?
ESP_Sprite wrote:
Mon Jun 08, 2020 1:22 pm
(However, do keep in mind that in this worst case scenario, the sensors will *always* drain the coin first. The coin cell is 3.0V, minus a 0.3V drop over the Schottky is 2.7V. As this is more than the worst-case 2.3V from the GPIO, the GPIO Schottky will block and the sensors will run off the coin cell.)
I believe this is ideally the effect I want. When there is a coin cell present, the ganged GPIO should not be supplying power or anything. As I have shifted the switching tasks to the micro controller, the power supply to the coin cell as well as the state of the ganged pins can be implemented in software. I would like to know if there is a way to configure the GPIOs so the diode D2 is not necessary.
ESP_Sprite wrote:
Mon Jun 08, 2020 1:22 pm
Note I used 'worst case' a lot here. In general, under low current drain, you probably can expect to output GPIOs to expect a voltage very close to the power supply voltage. However, the exact behaviour of this is is uncharacterized, so there is no way to *guarantee* the GPIO voltage will be like that in all chips and under all circumstances.
I setup a small experiment with my old NODEMCU with ESP8226 on their. Indeed with one pin configured as output and driving high, I was able to measure about 32mA of current. That increased when I wired in a second pin. The current was almost at 60mA. I connected a third pin and it reached about 75mA (KCL in action i believe). I will set up another one using my ESP32s node mcu to check voltage characteristics as I increase the load.
ESP_Sprite wrote:
Mon Jun 08, 2020 1:22 pm
(Also, for some more inspiration, you may want to read up e.g. here on using PMOSfets as ideal diodes.)
Thanks for the link. Interesting read. Helped me understand the body diode better.

jjuduma
Posts: 11
Joined: Fri Jun 05, 2020 5:33 pm

Re: Independent supplies for ESP32Wroom32D & sensors

Postby jjuduma » Thu Jun 11, 2020 9:23 pm

Hello...

I am still hoping to get some assistance with the questions asked in the previous post.

Thanks a bunch

Who is online

Users browsing this forum: No registered users and 60 guests