enter image description here

I have a laptop that uses a 5V 3A wall charger.

I have spliced some of that power to run an ESP-01/3V single channel relay... I'm estimating that takes about 300mA away from the 3A.

I tested everything against a bench top power supply and it works within the design of the charger eg. pulls 2.58 Amps at 5V.

I'm just wondering... if you alter this power supply, can it have a negative impact on the laptop's side other than charging slowly.

I will also note that I have a linear regulator LD33V inline to drop the 5V to 3.3V for the ESP-01.

This whole thing is just a manual method to start/stop charging between 20-80% battery (some code is ran on the laptop and it tells the relay to turn on/off based on battery). That feature is not built into this laptop. I just didn't want to have two plugs to plug into a wall. I considered using the laptop's USB out however that requires adding some extra code to get more than 100mA from the USB.


After separating the power supplies, it is cooler than before. This is a fanless laptop so I'll feel better just using it as it was.

Temp differences

122F/106F (wall adapter/laptop base)


It's starting to rise over time though the temp, adapter now at 111 F so maybe it's just normal. Laptop is a little cooler but still in 100F range

Laptop's at 103F now so maybe it's the same regardless... just takes longer to charge.

The temps are the same... 40-50% battery charge, so it seems like that's jut how the laptop/charger is.

last update

It was a mistake to use the GPIO2 for the high-side trigger on the relay since when the ESP-01 boots GPIO2 is held high.

I swapped it for RX pin then I had to figure out to set it to low on boot, otherwise it was a floating pin/causing problems. Now it seems stable, using shared power supply.

  • \$\begingroup\$ Is the laptop using Wifi to inform the ESP-01 about its battery level? \$\endgroup\$ May 7 at 1:17
  • \$\begingroup\$ yeah this laptop has a suspend/wake problem, so I'll just keep it on/charging all the time, it sucks but a fix, it's a firmware problem (pinebook pro) \$\endgroup\$ May 7 at 1:39
  • \$\begingroup\$ it's very basic, POST request says stop/start charging - based on current battery charge \$\endgroup\$ May 7 at 1:40
  • \$\begingroup\$ Are you completely sure that the power supply voltage is 5 V? That seems very low as far as laptop power supplies go. Also, is there any particular reason you're using a relay instead of a MOSFET? A part like G30N02T might work well, with a really low on resistance even at Vgs = 4.5 V. \$\endgroup\$ May 7 at 1:53
  • \$\begingroup\$ The 5V is from the spec on the wall adapter though I have not confirmed it... I could test with a DMM. Relay just for simplicity (to me), I have gotten help to make a low-trigger switch before but I would have to rebuild that circuit again. Also would need to check if the parts I have on hand can do 3A regarding the MOSFET/BJT. \$\endgroup\$ May 7 at 2:19

1 Answer 1


This seems like a bad idea. Give your load its own USB block. They are like $3. They will work fine at your power draw without modification. For $1 you can get a 3-socket AC power splitter at a dollar store, if your problem is that you're out of AC sockets.

USB power levels this high are actively negotiated between the laptop and the USB power supply. It may also negotiate a higher voltage. If you are getting in the middle of that, you are throwing the charging out of whack.

I'm sure I don't need to explain why tampering with lithium battery charging is a bad idea.

Whereas, getting 5 volts @ 300mA out of any USB power block will simply work, with no negotiation needed.

Therefore your idea, while dashingly clever, seems needlessly risky.

  • \$\begingroup\$ yeah the only disadvantage of the separate power supply is needing another outlet, splitter is a good idea though... I will see what happens when I separate the power, compare the temperatures \$\endgroup\$ May 7 at 3:47
  • \$\begingroup\$ at this time the USB isn't used on the laptop, was a thought \$\endgroup\$ May 7 at 3:48
  • \$\begingroup\$ @Jacob sure, a USB port on the laptop would work nice. They also make 2-port USB power blocks, but you'd have to find one that has 1 port that will support the high speed charge. \$\endgroup\$ May 7 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.