I’m currently using a TTN UNO with a BME680 sensor. I am trying to find a way to put my TTN UNO to sleep (that’s already working) and waking it up every couple minutes, get the datas from the sensor and send them, and go back to sleep. I have been looking for a few days now but I can’t figure out how to wake up the board without ressorting to a button press (or input change). Do I need a RTC to wake up my board every couple minute? Can I do it without one? I’m relatively new to microcontrollers, any help would be great
I don’t know much about the TTN Uno, but since it’s an ATMega32u4, you probably want to look into using the watchdog timer to put it to sleep and have it wake up as much as 8 seconds later. Most of the sleeping code I’ve written was done the hard way by writing directly to ATMega registers, but I believe there are some low power libraries available that make this much easier from the Arduino IDE.
@Marin10019 you should have a look at the LowPower library (https://github.com/rocketscream/Low-Power
It allows you to put the processor in sleep mode up to maximum 8 seconds. If you need more sleep time, just loop the sleep command. The sleep command in your code would be like this:
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
On the ATMega32u4, it gives you a power consumption of less than 10 uA (excluding the consumption of the BME).