Page 1 of 1

Wake Arduino from 4 buttons.

Posted: Sun Nov 19, 2017 7:48 am
by kshepitzki
I am working on a project using ATmega328 that requires waking up from sleep mode using button presses. Several articles explain how to do that by connecting the button to the interrupt line INT0 or INT1.

However I have 4 SPST buttons but only 2 interrupt lines. Each button needs to be able to wake the controller and as it wakes up the controller needs to know (e.g. by reading digital pins) which button was pressed.

The project is single battery operated so needs to be very energy efficient.
I am embedded SW eng', so I understand HW if explained slowly :-)

Any suggestions for a simple HW solution?

I look forward to your solutions

Re: Wake Arduino from 4 buttons.

Posted: Mon Nov 20, 2017 8:27 am
by DanV
Use Double pole single throw buttons and parallel one N.O contact from each switch into a single interrupt line, then use the other pole from each switch into an input on the ATMega (4 inputs total).

Re: Wake Arduino from 4 buttons.

Posted: Mon Nov 20, 2017 9:49 am
by jremington
Every digital input on the ATMega328 is an interrupt line. Use "pin change" interrupts, one per button, on separate Input pins. Pin change interrupts are not quite as flexible as the external interrupts, but will do what you want. No extra hardware needed.

https://playground.arduino.cc/Main/PinChangeInterrupt
https://thewanderingengineer.com/2014/0 ... nterrupts/