Light / Deep Sleep Current Comparison of XIAO_MG24 and XIAO_nRF52840

Welcome! Please be Moderated!

Wow, you did it !
We are struggling to wake up MG24 with GPIO wake from EM4 deep sleep but without any luck. I was wondering if you could share the bit of the code with the sleeping and waking from EM4 when GPIO is triggered. Thanks

Hi there,

And Welcome here…

So , If I may we like to keep things tidy and easy to find here. Allow me to demonstrate just how easy it is to find the answers using the search and a picture. Once you get a few posts , reply’s or questions to get enough forum Cred to post a NEW topic , a PIC/VIDeO or your own Question.
HTH

BTW there are some very good code examples he has in these threads listed… :+1:

GL :slight_smile: PJ :v:

@bigpil - I am away from the office right now but have you looked at the Low Power Example for the MG24?

Thak you for the link. We managed to get down to 37.4uA without timed wake up or GPIO wake. If we add these, the current goes close to 1mA. Any suggestion on how to get a lower current ?

I was trying to add a picture with the code but I am getting an error.

Which version of XIAO MG24 are you using? With Sense?

I’ll post my code later today.

Unfortunately was busy today (Saturday) so code will have to wait until Monday.

I am using MG24 from here : Seeed XIAO MG24 | The Pi Hut

I am basically trying to make an audio device where an MG24 will go to deep sleep mode, and when it wakes up, it powers up a mini df-player via a mosfet and sends instructions on what files to play first according to the GPIO . We are bassicaly trying to build an ultra low power audio unit right now, but I am planning to use it for other projects as well. The whole unit will run on 3x AAA batteries. We are testing the deep sleep mode current at the moment without any other code.

This is the code we are using right now for testing.

#include <Arduino.h>
#include "ArduinoLowPower.h" // Arduino Low Power Library

void setup() {
  //Serial.begin(115200);
}

void loop() {
  //Serial.println(F("Hello..."));
  delay(10000);
  //Serial.println(F("Entering sleep mode..."));
  LowPower.deepSleep(); // go to deep sleep
}

Thanks for the extra information. What is being used to do the actual wake up? Is is a push button or a toggle switch or something else?
There is quite a bit of extra support code required for initial setup of deep sleep mode.
Will you be using the radio at all?

Hi, yes, it will be a momentary push button.

In that case I suggest a simple pull up resistor on the button. I tested with 220k and it worked fine, current was < 1.8uA in Deep Sleep.

The code and test drawing is here.

If you want to use basic code and still have < 2uA current consumption, it can be done with the standard XIAO Deep Sleep example and using GPIO and Timed wakeup.

Another option I use on keyfob remotes is to use the push button to latch the power on. That requires additional circuitry but uses zero power.

Hi, that’s amazing !
We managed to get the Current down to around 8-9uA. It is perfect for our project now. Thank you !

I was wondering if you have an example for the other mode when the button latches the power. This would be perfect for another project we are working on .

2 Likes

Thanks for the picture :slight_smile: Glad you got it working!

For a Fob (3V battery), I just use a switch to power the device. In your case (~4.5V battery) you can use a P-Ch Mosfet for power and switched with an N-Ch Mosfet for switching the power.

A simple circuit is below.

Switch turns on the power, Hold (GPIO) keeps it turned on until no longer required.

2 Likes

Thanks, it look sinteresting, I’ll give it a try this week. Any idea what is the waking-up time and how quick the script can run ?