M5 Dial Portable Power Questions
-
I'm working on a portable project featuring the M5 Dial. I've got a few questions about powering the device. There's the battery port underneath the stamp s3. However, if I hookup a battery to that, there seems to be no way to get the device to turn on with battery power only. Instead I have to plug in USB C power, then I can unplug it and it will run off the battery. Is there a way to configure it to turn on when only the battery is plugged in? And since it automatically turns on when USB C is plugged in, this is not ideal when trying to charge the battery for a portable device.
I understand it should charge the attached battery when USB C power is plugged in, but someone else had asked about monitoring battery charge level and it seems like there is no fuel gauge feature built in, can you confirm if that's correct? And furthermore, there seems to be general confusion about the specific size of the JST connector for that battery terminal. Based on something I had read in the forums here (or maybe on reddit) it sounded as though the connector was a Micro JST GH 2Pin 1.25mm, but when I order some of those from Amazon, they did not fit. Can anyone point to the a specific, purchasable link for the correct connector?
Thinking about the above, my guess is that for portable use I may need to plan on putting together an external power charging and monitoring set of devices. Perhaps something like the Adafruit Micro-Lipo USB-C Charger (MCP73833 based), an LC709203F fuel gauge board, an SPDT switch, and MT3608 boost converter module along with 18650 LiPo battery. Thoughts?
-
Hi @scoobysnax
Yes, StampS3 does not have a built-in fuel gauge.
I suggest you make a power supply device yourself, or you can take a look at this new M5StackTimerPWR: https://docs.m5stack.com/en/unit/Unit-TimerPWR
From the official documents and the actual photos, the battery connector of Dial is indeed 1.25mm-2P. I don't understand why the connector you bought is incompatible, or you can take a look at the official power terminal specification: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/products/core/M5Dial/1.25WT-2P.pdf. -
Hello @scoobysnax
have you tried to push the
WAKE
button when M5Dial is running from battery to power on the device?M5Dial docs are here.
Thanks
Felix -
Hi @scoobysnax
I also searched far and wide for a connector for the bat.
I used these: https://www.diyelectronics.co.za/store/connectors/1831-molex-125-2-pin-male-and-female-connector-cable-pair.html
So Molex PicoBlade 1.25 2-Pin is another term you can search for.
-
@scoobysnax Wondering if you got any further with this?
I'm also struggling to figure out how to get the M5Stack Dial working with a small Lipo battery. I just want to easily turn it on and off and start the program I made in UI Flow 2 and downloaded to the device. That seems VERY HARD, so far?
As you say, if I connect the battery, then connect USB-C power, the app boots correctly into my app (after a few slightly annoying seconds). Then I can disconnect USB-C power and the app stays working. That's... encouraging?
Without the USB-C cable, I can turn the device ON with long-press of the main fascia button. That's indicated here:
I can turn it OFF with the reset button on the back.
However, "ON" with battery means "load the boot loader thing" rather than "run my app". It shows Wifi settings, "helloworld.py" (which is not my UI Flow program) - then crashes after a few seconds. I managed to set "Boot screen: OFF". So now, instead, when I hold the "Wake" button (main fascia button), it says "Success: 100%" (black on white) turns off the screen, and does nothing else. I can repeat this by pressing Reset then the main button again.
My UI Flow program has "Boot option set to: Run main.py directly" in the Setup part.
The documentation says:
"Wake up can be initiated by pressing the "Wake" button or by an IRQ signal triggered periodically by the RTC. After triggering the wake-up signal, >> set the HOLD (GPIO46) pin to a high level (1) during program initialization to maintain the power supply. Otherwise, the device will enter the sleep state again << When there is no USB external power supply, press the RST key to power off. Alternatively, when there is no USB external power supply, set HOLD (GPIO46) to 0 during program operation to achieve power off."
I'm confused by that. Do I need to figure out how to set GPIO46 to high from within UIFlow?
I can confirm the battery connector is JST GH 2 pin 1.25mm: I bought these and they fit perfectly:
https://vi.aliexpress.com/item/1005007079265201.html?spm=a2g0o.order_list.order_list_main.17.46b51802JNvMnD&gatewayAdapt=glo2vnm >> product options: 1.25 mm, 10 cm, 2 piBest wishes and hoping someone can help! 🎄
-
@PharkieB My idea, above, works!
Now, I can turn ON my Lipo-powered M5Stack Dial with the "Wake" (front button), it loads my UI Flow program, and then I can tell the software (btn A) to switch it OFF, when that's appropriate:
This is using the "System >> Execute mpy code" block with this for on:
hold_pin = Pin(46, Pin.OUT) hold_pin.value(1)
and this for off
hold_pin = Pin(46, Pin.OUT) hold_pin.value(0)
Ideally this would be a standard UI Flow block for the M5Dial (keep device on once awake and on battery). It seems odd I've had to invent it, based on detail in the documentation.