1
\$\begingroup\$

Currently I'm using the newly released WEMO LOLIN32 (pictured below), and it's a great board, save for the lack of one thing, a power button. enter image description here

Initially I was thinking of a simple ON/OFF switch that disconnects the battery, but I realized I need it to be able to charge a Li-Po battery while the device is powered down. Now since I'm charging a Li-Po I need to output 4.2V to the charger (at say 50-100+ mA or something comparable to the current from the battery terminal). Sadly as this is a new board I don't have much in the way of a spec sheet to guide me on the capabilities of each port.

enter image description here

Two questions

  1. Will I fry the board if I try to run power through analog out ports?
  2. Is there charging behavior that is built into Li-Po charging that I need to emulate on the analog out that I use?
\$\endgroup\$
3
\$\begingroup\$

Q2 is a mosfet used to disable power draw from VBAT when 5V or VUSB is present. Disconnect the trace from pin 3, and place a switch between pin 3 and the trace from VBAT.

Based on what I see on the schematic. This means it can still charge from 5V. But will only power the 3.3v regulator when the switch is on.

Edit: based on https://macsbug.wordpress.com/2017/05/08/battery-and-battery-interface-of-lolin32/ there are two revisions. The original uses a diode or bridge, while the newer uses a mosfet there. The same applies to either revision. Disconnect the VBAT from q2 or the diode bridge and insert a switch.

Edit 2: here https://macsbug.wordpress.com/2017/05/31/power-switch-to-wemos-lolin32/ they mod a power switch. Similar to what I suggested, this would also keep the board mostly off even of you use a usb or 5v power source. It will allow you to charge and have the board off, but not board on no charging.

enter image description here

\$\endgroup\$
  • \$\begingroup\$ Just to make sure, pin 3 is VP in your convention (A0/36/VP)? I dont see any actually denoted as pin 3. \$\endgroup\$ – Skyler Sep 7 '17 at 22:04
  • \$\begingroup\$ Or is it RX, it might be a blotted out 3 next to RX \$\endgroup\$ – Skyler Sep 7 '17 at 22:05
  • \$\begingroup\$ And if it RX, do I need to do any current regulating on that line or it should be able to handle the draw for the battery \$\endgroup\$ – Skyler Sep 7 '17 at 22:06
  • \$\begingroup\$ @skyler, no. Not at all. Pin 3 of part q2 on the board/schematic. You have to physically cut a copper trace or connection and solder in a switch. It is not the pins on either side of the module. \$\endgroup\$ – Passerby Sep 7 '17 at 22:07
1
\$\begingroup\$

I'm not certain you actually need to cut the power. As you stated in the comments, the board already supports charging, you just need to shut your application down when the switch is off. I'm sure this chip has a "sleep" mode you can put it into. Wire your switch into a digital input pin and use an interrupt to monitor its state. When the interrupt is triggered, you can stop your application and put it into low power mode.

\$\endgroup\$
0
\$\begingroup\$
  1. Yes, you will fry something if you try to run power through an I/O port on any microcontroller (and I don't see any analog outputs on the schematic, anyway.)

  2. The schematic and spec page indicates that the board has built-in battery charging capability. (see U5 on the schematic).

\$\endgroup\$
  • 1
    \$\begingroup\$ It does have that charge schematic built in, but the problem is that I can find a way to add an off switch that stops the battery from running the device when it isn't charging and also doesn't also kill the charging circuit. \$\endgroup\$ – Skyler Sep 7 '17 at 21:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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