Notifications
Clear all

Scarfing Power from 5V Pin

59 Posts
6 Users
26 Likes
4,322 Views
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

@robotbuilder, @inst-tech, et-al

Although this is about an ESP8266 as found on a WeMos D1 Mini board, I think the question is more about being able to read a schematic.  You two presented the WeMos schematic on another thread: https://www.wemos.cc/en/latest/_static/files/sch_d1_mini_v4.0.0.pdf

powering

To save my life, I could not answer the following question from looking at it.

Preface

  • I understand we can't drive heavy power users (servo, stepper) motor off logic pins.  Even powering an LED is close to pin limits.
  • I know the built-in 5V to 3.3V DC to DC converter on the WeMos D1 Mini can't handle a lot of load either.

Question

  • If I power the WeMos via the Micro USB connector, does the 5V coming into the connector go directly to the 5V pin?
  • IOW - Can I draw a heavy load (say... multiple amps) from the WeMos 5V pin?

Thanks!

VBR

Inq

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech reacted
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6965
 
Posted by: @inq

@robotbuilder, @inst-tech, et-al

Although this is about an ESP8266 as found on a WeMos D1 Mini board, I think the question is more about being able to read a schematic.  You two presented the WeMos schematic on another thread: https://www.wemos.cc/en/latest/_static/files/sch_d1_mini_v4.0.0.pdf

powering

To save my life, I could not answer the following question from looking at it.

Preface

  • I understand we can't drive heavy power users (servo, stepper) motor off logic pins.  Even powering an LED is close to pin limits.
  • I know the built-in 5V to 3.3V DC to DC converter on the WeMos D1 Mini can't handle a lot of load either.

Question

  • If I power the WeMos via the Micro USB connector, does the 5V coming into the connector go directly to the 5V pin?
  • IOW - Can I draw a heavy load (say... multiple amps) from the WeMos 5V pin?

Thanks!

VBR

Inq

 

My 'guess' is NO. Use the logic pin to drive a MOSFET for DC, or an SSR for AC.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Inst-Tech reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

@zander 

I've got a project that appears to be very simple hardware-wise.  It would be powered by a typical cell-phone AC USB adapter.  I would like to take advantage of the connector on the WeMos so I don't have to cut up USB cables if that is possible.

The reason "I think" this might work... the 18650 battery shield shown above says it'll handle 4 amps at 5V.  I can see the PCB traces coming out of the converter and going to the 5V pins... the trace doesn't look very substantial to be carrying 4 amps.  If the WeMos is using similar traces and goes directly from the USB cable 5V wire to the 5V pin, then I would think I'd be OK.  If, however, it goes through some other circuitry, I'd feel certain, it'd fry that circuitry.

That's my simplistic logic speaking - thus why I'm asking people who can read the schematic and say, "Nah! you'll fry part at c8."

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6965
 

@inq Turn over both devices to see the traces. Isn't a logic pin limited to 800ma?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

@inq

The note I made on my wemos ESP8266 pinout diagram states output from ether the 3v3 or 5v pins is 500mA.  The USB 5v is, I believe, directly connected to  the 5v pin.  The 5v pin can also be used as an input pin of 4-6 volts that will go to the voltage regulator.  So, assuming my note is correct then 500mA is the max you should draw from the 5v pin (or any pin for that matter).  


   
Inst-Tech reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

@zander, @byron - I wasn't trying to use a logic pin.  Maybe my comments in the Preface distracted from what I am trying to do.  My only point was I'm aware that all pins except the 5V pin are very low amperage.  I'm just unclear about the 5V pin.  I was just hoping the 5V from the USB cable was a strait pass through to the 5V pin on the WeMos and hoped that the Schematic would enlighten someone.  The schematic didn't help me squat.

I'll just cut the USB cable.

 

FYI - 800/500 mA may be right for an Arduino, but it is way too high for an ESP8266.  

Reference:  https://tttapa.github.io/ESP8266/Chap04%20-%20Microcontroller.html

  • The maximum current that can be drawn from a single GPIO pin is 12mA
  • The 5V to 3.3V converter is only capable of 500 mA of which part of that is being used by the ESP8266.  

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech reacted
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1680
 

Hi Inq,

Question

  • If I power the WeMos via the Micro USB connector, does the 5V coming into the connector go directly to the 5V pin?
  • IOW - Can I draw a heavy load (say... multiple amps) from the WeMos 5V pin?

Short answers:

  • No ... for V3.0 with Micro USB  (yes for V4.0 board with USB-C socket)

 

  • No ... unless you have the V4.0 board with USB socket, and 'multiple Amps' is appreciably less than 3A, probably down to nearer 1A

------------------------------------------------------------

Longer answers: (YAS ... Yet Another Sermon)

----------------------------

I'll start with some general pointers, as you may well hit the same questions with different boards.

In general, none of the Arduino, R-Pi and so on small, general purpose processor boards that I have looked at have pins designed for 'multiple amps' ... it isn't what they are designed to do ... large currents need lots of copper, as well as devices capable of handling that current. This copper costs money, space, weight and so on - it would not be sensible to 'weigh down' low current processors with all of the overheads. I would very carefully check any pin being asked to carry more than 1A, and 'carefully' check any exceeding 100mA. GPIO pins are in 10s of milliAmps at the most.

Of course, you can get 'expansion boards and units, known by assorted names such as 'shields', that do carry higher currents .. and the reputable products are built to a 'heavier' standard to accommodate the high current demands.

USB plugs and sockets also have current limitations, albeit often 'applied' with 'flexible boundaries'. Personally, I think micro USB is best kept to a max of about 1A, although you can probably push to 1.5-1.8A on a 'good day'. Beware, not all cables will transmit that much without loosing more voltage than you might expect.

The later R-Pi s use USB-C which is rated at higher current (3A) than the preceding mini- and micro- variants. USB-C also has more complex tricks in which the voltage can increased above 5V, but I haven't seen any of the processor boards being 'upgraded to cope.

So the USB-C version would be expected to supply a higher current than the micro-USB version, but neither are well suited to delivering  'multiple Amps'.

-----------------------

In addition to the current rating aspects, there are very good reasons to keep high and low current paths separate ... high current demands from things like motors can easily generate voltage spikes which can disrupt and even damage the 'more delicate' low current circuits.

---------------------------------------------------------

More specifically to your question, and the reasons I gave a double NO .... a schematic for the WEMOS W1 mini is published at:

https://www.wemos.cc/en/latest/_static/files/sch_d1_mini_v3.0.0.pdf

(The URL you provided is for the 4.0 version of the board, with a USB-C socket, which contradicted your question.)

This shows the wiring from the USB socket:

image

The 5V input from the USB socket passes through a 0.5A 'fuse' and a diode, before being distributed as a 5V supply, for both the power input to the 5V-to-3.3V regulator and the 5V 'board output' pin 9.

So the fuse will limit the incoming current to to 0.5A, and some of that current must be 'reserved ' for the processor. Personally, I would think carefully about exceeding 100mA draw from the board output pin.

The version 4 board, with USB socket connects 'straight through', but passing a high current can be expected to give problems ranging from unreliable operation through to a burnt board, depending on how 'high' the current flow is.

---------------

Sorry, this is probably not the answer you were hoping for.

I am very concerned about the suggestion using a power supply that can deliver more than 2A, through a single micro USB socket (or more than 3A through USB-C).

Best wishes, Dave


   
Inq and Inst-Tech reacted
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 
Posted by: @inq

maximum current that can be drawn from a single GPIO pin is 12mA

For ye old wemos di mini ESP8266 the max current draw on the 5v pin appears to be 500mA, but, no doubt due to the circuitry that @davee pointed out I note that when using the 5v pin as an output the volts out drops a bit to 4.8.  I should have been more careful when I put in brackets 'any other pin' as looking again at my notes I see its a max of 12mA with 6mA as recommended, so I'm glad you did not rely on my advice for those pins.  I'm going to leave all this sort of advice for daveE in future and I like the info on the new boards with usb C connectors that was given.  Sometime I will have to do another roundup of all these new boards that are available with their salient points such as the boards max mA and the per pin mA and their sleeping mA consumption as this is often not readily to hand when perusing the boards info on the sales sites. 

Instead of snipping your usb lead you could make a neat job of it by getting a usb breakout board and putting both the wemos and the breakout board and some 5v + Ground output terminals on a very simple pcb you create. 😎 

 


   
Inst-Tech reacted
ReplyQuote
Inst-Tech
(@inst-tech)
Member
Joined: 2 years ago
Posts: 554
 

@Inq, I think @DaveE is correct in his assumptions.. The current carrying capabilities of mini USB are low with respect to what they are designed to do..that being to provide low power to MPU's and digital circuits in general. Remember, 5v dc with 1A is 5 watts of power, and I can assure you that's enough to burn out circuit traces and components that are not rated for the heat that will be dissipated.

I would recommend using external devices as @Ron alluded to, SSR, Mosfets, power transistors, etc.  using the logic of the GPIO pins on board to run any amount of current over 100 mA.

regards,

LouisR

LouisR


   
Inq reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

@davee, @byron, @inst-tech - Thank you all for the very detailed explanation.  I like to know why... not just "no".  I wasn't even aware they were starting to power these microcontrollers with USB-C.  Goes to show you buying a bunch of these things means they become old-news before one can use them all. 

I would totally believe you versus what I see as traces from a Chinese commodity battery shield.  That is what mislead me to power carrying capabilities.  When I get back to the house... I'll take a picture of the trace and post it.  They're claiming it will handle 5V at 4 amps.  My ignorant self thought it looked just like a good fuse... at about half an amp!  😉 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6965
 

@inq All cortrect. I would approach this by searching for manufacturer soecs then back that uoo aih a approprite tester, zNow you know for sure

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Here's the project I would like to do.  Can you hardware types keep me between the guard rails?  😉 

Theory - Most of you may know that Lithium based chemistry batteries should be treated completely different from other rechargeable chemistries.  The real short version is they don't like being at the extremes.  0% SOC is fatal.  100% SOC shortens their lives.  Tesla lets you cut off charging at lower SOC for this reason and how they claim a conscientious user could go 1M miles on a set.  I've read many white papers, stating the same thing.  

Application - I want to apply that concept to a phone charger unit.  For those that don't know... one of the worst things you can do is to charge your phone up overnight... especially on a quick charger.  After fully charging, the charger keeps it at 100% for the rest of the night till you take it off in the morning.  Samsung, Apple, Google, etc. could easily fix this in software, but don't because they want to sell you another phone in two or three years.  There are even apps on Android, but you have to root (jailbreak) them.  Doing an external hardware solution keeps me from having to root it.  No great invention of mine.  Here is one such - https://chargie.org/   I realized, I can do the same thing for about $5 in parts and it would be a fun/useful project.  

Parts

All it needs is the WeMos and a Relay Shield and a USB-C cable.

image
image

My thoughts now (that you all convinced me not to use the micro USB connector).

Does this Pass the Hardware Logic???

  1. The Relay Shield just plugs into the WeMos
  2. Open up the sheathing on the USB cable.
  3. Splice into the ground wire to ground the WeMos/Relay
  4. Cut the power wire
  5. The power input end goes to power the WeMos and to the Relay terminal.
  6. The power output end goes to the other Relay terminal.

Software Wise

  1. Create the web server on the WeMos.
  2. The Android phone browses to the website and can configure the desired behavior.
  3. It is supposedly possible for a web page to get the battery data on Android phones.  
  4. When it reaches the desired charge (say... 80% or 90%) open up the relay.  The WeMos is still powered, the phone isn't. 

Sound do-able?

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1680
 

Hi @inq,

   self thought it looked just like a good fuse... at about half an amp!

You are correct that an excessive current through a PCB track can cause it to act like a fuse ... typically the track will expand and detach from the board to form an arch shape, which starts to glow red and then breaks!

Some people have tried, and failed, to make 'cheap backup fuses' based on PCB tracks.

Unfortunately, the current at which the break happens is very unpredictable, even if you try to design it to behave like that, so it is a very poor fuse, which may break at a much lower current than you expect or not break when heavily overloaded.

In addition, boards often have more than two copper layers, with only thin insulation between the layers, so that shorting to another layer may happen when overheated.

And with higher voltages, the breaking track may set up an arc which chars the board or worse....

In summary ... treat PCB tracks kindly and with respect ... and use 'real' fuses or other protection devices where appropriate.

----------------------------

I am a little confused/concerned about your power supply, assuming "multple amps" means more than 2A, and the microUSB Wemos board ... as I commented previously I would expect a power supply with microUSB plug to be rated at less than 2A, and it should limit/protect against a load demanding that much current, as USB leads can easily develop develop internal short circuits. Just a thought.

---------------------------

Best wishes - stay safe, Dave


   
Ron, Inst-Tech and Inq reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  
Posted by: @davee

I am a little confused/concerned about your power supply, assuming "multple amps" means more than 2A, and the microUSB Wemos board ...

Well, you definitely convinced me not to run the power through the micro port of the WeMos.  The power coming in will be going to relay and the 5V pin (not going through the WeMos PCB).  So the WeMos will only be getting what it needs to power the ESP8266 and I guess since the Relay logic is through the Shield, it'll draw some also. 

Many of the Samsung power supplies in the previous generation of phones that charge through a Micro USB seem to output up to about 1.5 amps at 5V.  I have another AC adapter for a Nexus 9 that also powers through a Micro USB and maxes out at 1.5 amps at 5V.

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech and DaveE reacted
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1680
 

Hi @inq,

  Our replies are crossing in the ether.

  I would be very disappointed if a self-respecting phone allowed the lithium-ion cell to be discharged to 0% .. it might report 0%, but that should be 0% of 'available' power ... not actual cell energy level. It is possible battery life could be extended by keeping the charge level in a 'mid-range', but my impression is that they are already closely 'watched' for safety reasons, so improvements may be less than you hope.

Of course, phone manufacturers are under pressure to provide a long 'talk time', so they will want to allow it to maximise the range of charge levels, but battery lifetime is also affected by many other factors, including battery chemistry, manufacturing methods and so on.

-----

Some phones with USB-C sockets use the extended power modes .. which includes boosting the voltage up to 20V, and (in theory at least) to 48V. ( https://arstechnica.com/gadgets/2021/05/new-usb-c-type-2-1-standard-offers-up-to-240-w-power-delivery/)

To manage the range of voltages, USB-C power supplies and devices (like phones), communicate to determine a mutually compatible setting.

Of course, you may be looking for a solution for a particular phone/supply combination which only uses 5V, but it could be a problem if you change the phone. 

-------

I think I would start this project by ensuring I can get the phone to report and communicate its charge level ... I presume it is possible, but as I haven't worked on Android or Apple software, I am suspicious of how easy it will be.

Furthermore, the app or equivalent should be 'energy efficient', so that it does not significantly discharge the battery. If it is a web application, that includes the web browser. It might even be possible to get the phone to do the battery charging control itself.

And does it mean rooting the device?

--------

Best wishes, Dave

 


   
Inst-Tech reacted
ReplyQuote
Page 1 / 4