Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Power Consumption of an ESP32 and LM7805 regulator

Status
Not open for further replies.

destino

New Member
Hi there.
I've been playing with a gate opening device that runs on an ESP32 wireless device. Its working fine. It is being powered from a 12V car battery via an LM7805 voltage regulator which provides the 5V that the WiFi microcontroller requires. The ESP32 is controlled by a web page on my phone and when a button is pushed it closes a relay that activates the gate opener.

I've noticed that the LM7805 gets quite hot. Nearly too hot to comfortable hold

To measure the current draw on the setup I put a 25W 8 ohm resistor in series with the circuit and measured the voltage drop across the 8 Ohm resistor at rest and when it was operating. At idle I got 1.2V and when it was angry it was peaking at 2V. This is, if my high school electronics doesn't fail me means a current flow of 150mA to 250 mA

1. Is this a valid way of measuring the current draw of the circuit
2. Is this expected from an LM7805. The microcontroller is supposed to draw about 50 mA. Does the LM7805 consume the rest?

Cheers
 
An 8 ohm shunt is a pretty large value. Did you put it in the 12v line before the regulator or in the 5v line after the regulator? If in the 5v line, the ESP32 input voltage is dropping too low (5v – the 2v drop you measured).

Do you have the recommended input and output caps on the regulator? If not, it can go into oscillation and operate erratically.
 
Hi there.

Thanks for your help.

The 8 ohm resistor was the smallest I had that could support a bit of power. What size would you recommend. I could put a few in parallel. I have 8.

It was placed in series before the LM7805. so its carrying the total current load for the entire circuit.

I got the LM7805 circuit off the net and used the recommended values of capacitance. 10 and 1 uF.

Is there any way i can tell if the regulator is behaving in a naughty way.

I have a CRO and a multimeter.

Cheers

Peter
 
Doing a little 4am research, looks like your current measurements are probably reasonably accurate for when the ESP32 is active on wifi.

I have seen some good videos on methods to reduce power consumption through various techniques, like powering down features of the controller that aren't needed, using sleep modes to reduce "on" time, yet still be responsive, etc.

I suggest checking out YouTube videos by Andreas Spiess, such as this one and a couple others as I recall.

 
The 8 Ohm shunt is fine in the way that you used it. The LM7805 needs around 7 V minimum on the input and your 2 V drop will only reduce the voltage to around 10 V so you've got plenty of voltage.

Leaving the 8 Ohm resistor in place will reduce the heat in the LM7805 by reducing the voltage drop. You could go to 16 Ohms or so and it should still work. (16 Ohms x 250 mA = 4 V. 12 V - 4 V = 8V for the LM7805, which is lots more than 7 V, so that's fine). With 16 Ohms the voltage drop across the LM7805 will be 3 V at 250 mA and 4.6 V at 150 mA, so the power converted to heat in the LM7805 will be 0.75 W or 0.69 W, which is a lot less than the 1.75 W or 1.05 W with no resistor.

With a resistor in series the overall power consumption is the same and only 5/12 ths (42%) of the power from the battery will make it to the ESP32. The reduction in power loss in the regulator is equal to the heat loss in the resistor. However, if you use a switch-mode regulator, that will rise to around 80 - 90% so the heat will be minimal. There may be more electrical noise with a switch-mode converter.

There are a few options for a switch mode regulator. There are switch mode versions of the LM7805 such as this:- https://uk.farnell.com/xp-power/vr05s05/dc-dc-converter-5v-0-5a/dp/3525424. Alternatively you can use a car cigar lighter USB socket, or wired 12 V - 5 V switch mode converters can be bought online.
 
Thanks very much for your comments and help.

I wasn't planning to leave the 8 ohm resistor in circuit. My aim is to reduce the overall current requirements of the circuit. The gate opener is away from reticulated power and has to be run on battery power. I'm concerned that if the opening device consumes too much that the battery will ultimately run out of power. It has a small solar panel that tops it up but I have had instances where the battery gets flat. Especially in the winter months when the sun is a bit shy and there is a bit of traffic through the gate. The opener has quite a substantial motor in it. I'm in Australia so summer shouldn't be much of an issue.

I might have a look at the switch mode devices to see if they will reduce overall power consumption.

I have looked at some of the methods of reducing the ESP32's power requirements. I'm running on the slowest clock speed and I've switched off Bluetooth. I just might have to put it to sleep.

Again many thanks. You have given me much to think about.

Peter
 
As power consumption reduction is your main aim, a switch mode device would probably help a lot. It will approximately halve the power consumption.

If the ESP32 takes 200 mA, with a switch mode supply that should drop to 100 mA. That will probably be using the majority of your energy. If the gate takes 20 A for 15 seconds, that is 300 Amp-seconds, so the ESP32 running from the LM7805 will take that in about 1500 seconds, or just under half an hour. So the electronics will take about as much energy per day as 50 operations of the gate, while with a switch-mode supply, that would drop to about 25 operations.

The current and time for the gate that I have used are just guesses.

An 80 Ah battery will last about 2 weeks just running the ESP32 from an LM7805 with no gate operations. A switch-mode supply would take that out to a month.
 
I have a 180Ah car battery running the fence so i guess i'm being a little over cautious about the gate running out of power especially as it has a solar panel charging the battery.

What prompted me to investigate this was the heat that was being generated by the LM7805. At first I was concerned that something was wrong but it seems that this is largely expected given that I'm converting 12V to 5V. I've ordered a couple of switch mode devices from RS. So in a week or so I should be able to test the difference.

There is not a lot of airflow in the box that contains the gate opener and here in Australia where summer temperatures can at times be 45C in the shade. I hate to think what the temperature in a metal box on the side of a fence post in the sun could be. Its forecast to be 34C today. Just a balmy day.

I may need to put a larger heat sink on the regulator.

Cheers

Peter
 
Hi,

Have read some non ET posts saying that the ESP32 in Wifi mode can take shortbursts of up to 600 - 700ma, so wonder if that external 500ma regulator will suffice or could it cause drop outs etc ?

Assume the 5V line is also providing power to other bit of circuitry ?
 
Hi there Wp100.

Yes i saw those as well when i was looking at some articles concerning power minimisation for these devices. My application is VERY basic. Its not talking to other networks other than a phone when it comes in range. I'm hoping I'm on the low side of the peaks. The 5V is supplying the ESP32 and one of those small Arduino relays. I should try and find out what their quiescent power consumption is. There is also a LED that lights when the relay is triggered. I could always remove that. Its really only for testing.

I've switched off the Bluetooth and set the clock speed (80MHz) to the lowest that is still capable of WiFi.

I've tested the consumption over about half an hour or so and haven't seen anything that went much over 275mA. However i am using a digital voltmeter and they can be a bit slow to measure transients.

I am relieved by Diver300's comments concerning the ability to survive brief bursts of 700mA.

I guess we'll find out in a week or so when they arrive.

Cheers and thanks

Peter
 
Hi there folks. I just thought I'd fill you in on my progress. I went cruisin the net and Youtube.

I found the guy with the swiss accent that was recommended by one of the respondents.

As well as local David Jones. \

Once I understood that a linear voltage regulator was essentially a variable resistor I could easily understand why it was getting as hot as it was. My car battery is about 13 volts and I was after 5V so it was essentially dissipating 8V across a resistor.

Given that for more than 50% of the time a switch mode regulator may be virtually switched off its clear that its going to consume less power.

I also found that placing an order for a regulator IC the day after Christmas was not going to end well. :)

They arrived today and I took no time to replace the linear regulator with my new VR05S05 . No smoke and all is well. its been running now for about 6 hours and its not even warm. Its been 37C here today and I hate to think what it is in the shed.

I measured the voltages across my 8 ohm shunt resistor and at rest the voltage drop was .6V compared to 1.2V with the linear regulator. When the ESP32 was firing up in anger the voltage peaked at .98V lets say 1V compared to 2V

This gives me current consumptions of 75mA at rest to 120mA in anger which compare to the values of 150mA to 250mA. In addition it seems that It is running very cool even when ambient temperatures are high.

As an aside i also found that the case that contains the fence opening mechanism acts like a Faraday cage and the ESP32 signal was not very strong once you got a few metres away from the device.

I've attached an external antenna via an SMA connector that I soldered to the ESP32. Now and I get reception upwards of 120M outside.

Thanks everyone for your assistance on this little project.

Peter
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top