<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Paper S3 wake on IMU?]]></title><description><![CDATA[<p dir="auto">The Paper S3 has a BMI 270 that should let it wake from sleep when moved.  Has anyone figured out how to do this from deep sleep or light sleep?  Me, ChatGPT, and the M5Stack chat tool have not been able to figure it out!  We get it to sleep but cannot wake it from the IMU</p>
]]></description><link>https://community.m5stack.com/topic/7748/paper-s3-wake-on-imu</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 00:08:54 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7748.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 13 Aug 2025 01:00:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Paper S3 wake on IMU? on Sat, 21 Mar 2026 13:42:42 GMT]]></title><description><![CDATA[<p dir="auto">Hi. Thanks for posting the code.  Can you confirm if this is a once-and-done write to the BMI? I code in micropython and wonder if I can run your code and then flash back to micropython and it'd still work.</p>
]]></description><link>https://community.m5stack.com/post/30799</link><guid isPermaLink="true">https://community.m5stack.com/post/30799</guid><dc:creator><![CDATA[jhfoo2]]></dc:creator><pubDate>Sat, 21 Mar 2026 13:42:42 GMT</pubDate></item><item><title><![CDATA[Reply to Paper S3 wake on IMU? on Fri, 12 Sep 2025 21:56:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alexxai" aria-label="Profile: alexxai">@<bdi>alexxai</bdi></a><br />
This is precisely what I'm looking for! Unfortunately, I haven't been able to get the code to run.</p>
<p dir="auto">Could you upload a working setup to GitHub?</p>
]]></description><link>https://community.m5stack.com/post/29926</link><guid isPermaLink="true">https://community.m5stack.com/post/29926</guid><dc:creator><![CDATA[simondid]]></dc:creator><pubDate>Fri, 12 Sep 2025 21:56:18 GMT</pubDate></item><item><title><![CDATA[Reply to Paper S3 wake on IMU? on Tue, 26 Aug 2025 05:05:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Thanks again for your quick and informative reply!  Your advice got me on the right track, you're a life saver!</p>
<p dir="auto">I was able to power down the Paper S3 and have it reboot from IMU movement, which was what I wanted.  My remaining challenge is that when powered down I'm still reading ~2.4mA on my USB power meter (with battery disconnected). I'm not sure what could still be drawing, from what I'm reading the BMI270 and PMS150 should be &lt;1mA together? If you have any insight on getting this power draw down please let me know.</p>
<p dir="auto">For anyone else that's trying to do this, I'm attaching a working example for the Paper S3.  It uses the <a href="https://github.com/boschsensortec/BMI270_SensorAPI" target="_blank" rel="noopener noreferrer nofollow ugc">Bosch BMI270 API</a>. To run the below example, copy/paste the example code below into the Arduino IDE and save it. Then copy bmi2.h, bmi2.c, bmi2_defs.h, bmi270.c, and bmi270.h from the Bosch API into the directory with your saved example script.  It will look something like this:<br />
<img src="/assets/uploads/files/1756184313831-ffad1dfe-2359-423f-892c-9a0d7f347750-image.png" alt="ffad1dfe-2359-423f-892c-9a0d7f347750-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Then flash the example code to your Paper S3.  You should see the S3 device boot up and then power down, showing this on the screen.  If you move the device you'll hear it wake up (if you have USB audio alerts you'll hear it reconnect to your computer to you know it worked!)</p>
<p dir="auto"><img src="/assets/uploads/files/1756184403566-b4074a01-042d-47b0-91ab-f93d32bb812b-image.png" alt="b4074a01-042d-47b0-91ab-f93d32bb812b-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Example code:</p>
<pre><code>/**
 * PaperS3 + BMI270 "Move-to-Reboot" Demo
 * 
 * Motion-activated power-on using M5Stack PaperS3 with Bosch BMI270 IMU.
 * Device powers off and wakes up via motion detection through BMI270 any-motion interrupt.
 * 
 * Hardware: M5Stack PaperS3 
 * Authors: Lex Kravitz and Cursor AI, 2025
 */

// Include required libraries
#include &lt;M5Unified.h&gt;    // M5Stack unified framework for PaperS3
#include &lt;Wire.h&gt;         // Arduino I2C communication
#include "bmi2.h"         // Bosch BMI2 base driver
#include "bmi270.h"       // Bosch BMI270 specific driver

// PaperS3 I2C pin configuration
static const int I2C_SDA   = 41;        // I2C Data pin
static const int I2C_SCL   = 42;        // I2C Clock pin
static const uint32_t I2C_FREQ = 400000; // I2C frequency (400kHz)
// BMI270 I2C address configuration
static const uint8_t BMI270_I2C_ADDR = 0x68;

// Any-motion detection sensitivity configuration - control the sensitivity of motion detection
static const uint8_t ANYMOTION_THRESHOLD = 50; // Threshold in Bosch units (~0.1 g)
static const uint8_t ANYMOTION_DURATION  = 2;  // Duration in samples at current ODR

// Global Bosch driver device object
static bmi2_dev dev;

// Display functions
void initDisplay() {
  M5.Display.clear();
  M5.Display.setTextColor(BLACK, WHITE);
  M5.Display.setFont(&amp;fonts::Font4);
  M5.Display.setRotation(1);
  M5.Display.setTextDatum(middle_center);
}

void showScreen(const String&amp; title, const String&amp; status) {
  M5.Display.drawString("PAPER S3", M5.Display.width()/2, 100);  
  M5.Display.drawString(title, M5.Display.width()/2, 160);
  M5.Display.drawString(status, M5.Display.width()/2, 220);  
  M5.Display.display();
}

// Bosch BMI270 API glue functions
static int8_t i2c_read(uint8_t reg_addr, uint8_t* data, uint32_t len, void* intf_ptr) {
  uint8_t addr = (uint8_t)(uintptr_t)intf_ptr;
  Wire.beginTransmission(addr);
  Wire.write(reg_addr);
  if (Wire.endTransmission(false) != 0) return -1;
  Wire.requestFrom(addr, (uint8_t)len);
  for (uint32_t i = 0; i &lt; len; ++i) {
    if (!Wire.available()) return -1;
    data[i] = Wire.read();
  }
  return 0;
}

static int8_t i2c_write(uint8_t reg_addr, const uint8_t* data, uint32_t len, void* intf_ptr) {
  uint8_t addr = (uint8_t)(uintptr_t)intf_ptr;
  Wire.beginTransmission(addr);
  Wire.write(reg_addr);
  for (uint32_t i = 0; i &lt; len; ++i) Wire.write(data[i]);
  return (Wire.endTransmission() == 0) ? 0 : -1;
}

static void delay_us(uint32_t period, void* /*intf_ptr*/) {
  delayMicroseconds(period);
}

// BMI270 setup
static bool bmi270_setup_anymotion_latched() {
  int8_t rslt;
  dev.intf            = BMI2_I2C_INTF;
  dev.read            = i2c_read;
  dev.write           = i2c_write;
  dev.delay_us        = delay_us;
  dev.read_write_len  = 32;
  dev.config_file_ptr = NULL;
  dev.intf_ptr        = (void*)(uintptr_t)BMI270_I2C_ADDR;
  rslt = bmi270_init(&amp;dev);
  if (rslt != BMI2_OK) return false;
  uint8_t sensors[2] = { BMI2_ACCEL, BMI2_ANY_MOTION };
  rslt = bmi270_sensor_enable(sensors, 2, &amp;dev);
  if (rslt != BMI2_OK) return false;
  bmi2_sens_config cfg{};
  cfg.type = BMI2_ANY_MOTION;
  if (bmi270_get_sensor_config(&amp;cfg, 1, &amp;dev) != BMI2_OK) return false;
  cfg.cfg.any_motion.threshold = ANYMOTION_THRESHOLD;
  cfg.cfg.any_motion.duration  = ANYMOTION_DURATION;
  if (bmi270_set_sensor_config(&amp;cfg, 1, &amp;dev) != BMI2_OK) return false;
  bmi2_int_pin_config int_cfg{};
  int_cfg.pin_type             = BMI2_INT1;
  int_cfg.int_latch            = BMI2_INT_LATCH;
  int_cfg.pin_cfg[0].lvl       = BMI2_INT_ACTIVE_HIGH;
  int_cfg.pin_cfg[0].od        = BMI2_INT_PUSH_PULL;
  int_cfg.pin_cfg[0].output_en = BMI2_INT_OUTPUT_ENABLE;
  int_cfg.pin_cfg[0].input_en  = BMI2_INT_INPUT_DISABLE;
  if (bmi2_set_int_pin_config(&amp;int_cfg, &amp;dev) != BMI2_OK) return false;
  bmi2_sens_int_config sens_int{};
  sens_int.type       = BMI2_ANY_MOTION;
  sens_int.hw_int_pin = BMI2_INT1;
  if (bmi270_map_feat_int(&amp;sens_int, 1, &amp;dev) != BMI2_OK) return false;
  
  // Enable advanced power save mode for lower power consumption
  rslt = bmi2_set_adv_power_save(BMI2_ENABLE, &amp;dev);
  if (rslt != BMI2_OK) {
    Serial.println("Warning: Failed to enable BMI270 advanced power save mode");
  } else {
    Serial.println("BMI270 advanced power save mode enabled");
  }
  
  return true;
}

// Clear latched interrupt
static void bmi270_clear_latched_if_any() {
  uint16_t st = 0;
  if (bmi2_get_int_status(&amp;st, &amp;dev) == BMI2_OK &amp;&amp; st != 0) {
    delay(1);
    bmi2_get_int_status(&amp;st, &amp;dev); // re-read to clear
  }
}

void setup() {
  auto cfg = M5.config();
  M5.begin(cfg);
  initDisplay();
  showScreen("REBOOTING...", "Initializing BMI270...");
  delay(2000);
  
  Wire.begin(I2C_SDA, I2C_SCL, I2C_FREQ);
  bmi270_setup_anymotion_latched();
  bmi270_clear_latched_if_any();
  
  // Configure BMI270 for minimal power consumption
  Serial.println("Configuring BMI270 for minimal power...");
  
  // Set accelerometer to lowest power mode (if supported)
  bmi2_sens_config accel_cfg{};
  accel_cfg.type = BMI2_ACCEL;
  if (bmi270_get_sensor_config(&amp;accel_cfg, 1, &amp;dev) == BMI2_OK) {
    // Set to lowest ODR (Output Data Rate) for power savings
    accel_cfg.cfg.acc.odr = BMI2_ACC_ODR_0_78HZ;  // Lowest ODR
    accel_cfg.cfg.acc.range = BMI2_ACC_RANGE_2G;  // Lower range = less power
    accel_cfg.cfg.acc.bwp = BMI2_ACC_NORMAL_AVG4; // Normal bandwidth
    if (bmi270_set_sensor_config(&amp;accel_cfg, 1, &amp;dev) == BMI2_OK) {
      Serial.println("BMI270 accelerometer configured for low power");
    }
  }
  
  // Power down the device
  showScreen("POWERED DOWN", "Move device to wake");
  delay(2000);  
  M5.Power.powerOff();
}

void loop() {
  // The code never gets here
}
</code></pre>
]]></description><link>https://community.m5stack.com/post/29846</link><guid isPermaLink="true">https://community.m5stack.com/post/29846</guid><dc:creator><![CDATA[alexxai]]></dc:creator><pubDate>Tue, 26 Aug 2025 05:05:02 GMT</pubDate></item><item><title><![CDATA[Reply to Paper S3 wake on IMU? on Mon, 25 Aug 2025 07:57:17 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/alexxai" aria-label="Profile: alexxai">@<bdi>alexxai</bdi></a></p>
<p dir="auto">yes, that is what I meant. Setup IMU for wake on movement, then power M5PaperS3 off (which turns off everything except IMU and PMS150) and when IMU is triggered it turns M5PaperS3 on again.</p>
<p dir="auto">Well, marketing speech isn't always crystal clear. That is why I try to distinguish between power on/off (or turn on/off) the device vs ESP32 deep and light sleep.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/29840</link><guid isPermaLink="true">https://community.m5stack.com/post/29840</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Mon, 25 Aug 2025 07:57:17 GMT</pubDate></item><item><title><![CDATA[Reply to Paper S3 wake on IMU? on Sun, 24 Aug 2025 22:05:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Thanks so much for your reply and clear info - and sorry for my delay in replying, I didn't get an email alert that there was a response.</p>
<p dir="auto">Can you elaborate on the PMS150 idea - basically I should power off the device fully and then use the IMU int to power it up again when movement is sensed?</p>
<p dir="auto">On the store page for the device it mentions "wake-up by lifting", which is why I thought I could kick it out of light or deep sleep with IMU movement.  But I guess this is what they mean by that?<br />
<img src="/assets/uploads/files/1756073060458-c3ad6f94-9643-4bfc-b147-5c785ecc24da-image.png" alt="c3ad6f94-9643-4bfc-b147-5c785ecc24da-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/29835</link><guid isPermaLink="true">https://community.m5stack.com/post/29835</guid><dc:creator><![CDATA[alexxai]]></dc:creator><pubDate>Sun, 24 Aug 2025 22:05:32 GMT</pubDate></item><item><title><![CDATA[Reply to Paper S3 wake on IMU? on Wed, 13 Aug 2025 06:28:27 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/alexxai" aria-label="Profile: alexxai">@<bdi>alexxai</bdi></a></p>
<p dir="auto">short answer: not possible</p>
<p dir="auto">long answer: the IMU interrupt line (INT1) is <strong>not</strong> connected to any ESP32S3 GPIO and therefore it <strong>cannot</strong> wake up ESP32S3 from deep or light sleep. See schematics <a href="https://docs.m5stack.com/en/core/PaperS3?id=schematics" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
<p dir="auto">That said IMU interrupt line is connected to the power on / off logic (IC PMS150 via E_TRIG) so it should be able to turn on M5PaperS3.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/29742</link><guid isPermaLink="true">https://community.m5stack.com/post/29742</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Wed, 13 Aug 2025 06:28:27 GMT</pubDate></item></channel></rss>