Hi everyone,
I am working on a LoRaWAN project (human presence detection with smart seats) where, as you can see, I am using the SAMD21 PRO RF and an FSR 406 sensor. The device will be powered by a 2Ah LiPo battery.
In order to minimize power consumption, I want to program the device in such a way that it will remain in sleep mode while no force is applied to the FSR. Also, once force is applied to the FSR, the device should periodically (e.g. every 5 minutes) take measurements and broadcast the data to The Things Network via The Things Indoor Gateway until no force is detected (where the device will enter the sleep mode again). As FSR provides the microcontroller with analog input the only solution I found is to use Analog Comparator (AC) to generate wake-up interrupts. Here is where I need some guidance! Is this something that can be done on the SAMD21? If yes, which are the necessary libraries I have to use, and are there any code examples that can help me?