The Arduino MKR1000 has the ability to send and receive serial data, and this is used to communicate with and control the GSM board. In this way it can initiate phone calls, as well as send and receive text messages. The audio comes from the DAC pin and into the microphone jack of the GSM board (currently via a wire that is soldered in place underneath it). The Arduino also gets the raw analog data from the three axes of the accelerometer. It adds these together for an overall acceleration measurement.
When the device is powered on, it can be in one of four states, depending on what inputs it gets and what it is doing. State 0 is the default, for when the "help" button has not been pressed, and no falls have been detected. If a fall is detected, it moves to state 1, plays the alarm sound to alert the user, and waits 15 seconds. If the "cancel" button has not been pressed within those 15 seconds, it will automatically initiate the call to emergency services (which is state 3). Also, if the "help" button is pressed, the 15 second delay is skipped and it goes right to making the call. If the "help" button is pressed when no fall is detected, it moves to state 2, which waits for the "help" button to be pressed again to confirm that the call should be made. Otherwise, pressing the "cancel" button will reset it back to state 0.
This, we hope, is an intuitive and user-friendly way for the device to work. One could incorporate different audio files to let the user know exactly what the device is doing, and also a visual display of some sort for those with impaired hearing.
Debugging and thoroughly testing this to make sure it would work reliably involved many text messages being sent from the GSM module.
But in the end, with everything working, it was all worth it!