-->
Page 1 of 1

using accelerometer to wake-up nodemcu from deep sleep ?

PostPosted: Thu Feb 02, 2017 8:39 am
by Joaohcca
Hi, not sure if here is the best place to ask this question, if not let me know so I can direct my question properly.

I'm developing a battery operated device using nodemcu v3 and I would like to use an accelerometer to wake up the NodeMCU if detect a motion to do some processing and post information online. To achieve this I bought a mpu6050 board (gy-521) and using a i2c protocol I've set the INT pin from the gy-521 board to generate pulse high-low-high in 50us. I intended to use the INT pin of the accelerometer on the RST pin to the nodeMCU and be able to wake up from deepsleep(0).

My setup for testing this uses two nodeMCU and one GY-521 board. One of the nodeMCU(A) is in deep sleep
while the other nodeMCU(B) communicates via I2C protocol with the accelerometer on the GY-521 after the accelerometer is configured I move it around to generate the pulse. If the NodeMCU(A) wakes up it would print something to the terminal on my pc (boot messages and the code running before deep sleep) but it doesn't wakes up as I believe it should.

I've also tried to hold the interrupt pin activated until the next reading on the I2C bus comes from the NodeMCU(B), with this I can hold the pulse low for longer and when the reading on the I2C bus occurs the pin goes to high state and see the blue LED blinking and messages on the terminal indicating that the NodeMCU(A) was reseted. But as my final product will include only one nodeMCU I not sure how to proceed with this. Maybe a Multivabrator Monostable?

Any tips or suggestions?

Thanks for your time to read this, as I put as many details as I found relevant to help on elaborating an answer for this it became quite long

Joao

Re: using accelerometer to wake-up nodemcu from deep sleep ?

PostPosted: Fri Oct 13, 2017 3:13 pm
by jjorsett
For anyone else encountering this: one thing I've read about the NodeMCUs is that, due to their on-board USB chips, regulators, and LEDs, they will draw a substantial amount of power even when the ESP8266 is in deep sleep, which kind of defeats the purpose. This is something to consider when thinking about using one for an application that needs to draw minimal power. Pete Scargill (https://tech.scargill.net/) writes about such issues, and recommends that, for really low-power applications, a person should use a minimal board. His favorite is presently the ESP-12.