Rak3172 awake from interrupt and read voltage


i am working on RAK3172. i am receiving pulses of 10ms on a GPIO after 1300ms
rak3172 will sleep for 1300ms and then wakeup on pulse and check the level of pulse. it can be between 3.3 - 2volt. the System Power save code works fine until i start reading voltage sensorValue = analogRead(A1);. when i read voltage after that wakeup on interrupt stops working.
can any one please guide me how can i make both WAKEUP ON INTERRUPT and VOLTAGE READ works simultaneously?
i want to add one thing more. its a decaying pulse. and i want to read the max voltage.

thank you

Hi @bilalfakhar ,

Using a pin for interrupt wakeup and ADC is an interesting case, however I am not sure if this approach can work without proper switching of pin function. I haven’t tried this personally but I think it is not impossible (need to be confirmed).

However, in the decaying pulse you sent, you have to consider the speed of your analog sampling to capture the max voltage of that spike.

If you use the spike for wake-up and at the same time getting vmax, you have to consider the delay that will be caused by waking up (which might result not capturing the peak).

To precisely capture the peak voltage, you might consider separating the wake up of RAK3172 and sampling the voltage. Probably try to use different pins for wakeup and voltage read (if ever it will work)?

Also, if hardware implementation is possible.

Use ultra low power external ADC chip, it will continuously monitor that pulse then wakeup the RAK3172 on some voltage threshold then also capture the vmax as well. There are ADC chips is ultra low power (few microamps) and can produce external interrupt signal.

1 Like

Thank you @carlowan for your reply. yes you are right, i think using two pins one for reading voltage and one for interrupt is solution 1 and the other one is using low power ADC. for accuracy i will choose ADC option.

Hello @carlowan just a question. can you recommend any ADC with sampling rate greater than 200Ksps and giving interrupt at a set threshold and most importantly reading Vmax
my pulse rise time is around 6 micro seconds. as you can see in the image below.

thank you for your help

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

Hi @bilalfakhar ,

This is a design consideration. I cannot recommend an specific ADC chip but understanding the relationship of bandwidth and rise time is important based on your 6us requirements. You can check it here - https://www.edn.com/rule-of-thumb-1-bandwidth-of-a-signal-from-its-rise-time/

Btw, if there is a specific voltage level, you are looking for, a comparator might be a more cost-effective approach (if ever this alternative make sense to consider.).