Software apps and online services
I was browsing the contests page of Hackster last month when I discovered the Electronic Lifeguard challenge. I submitted my idea and received a free AFE4404. Over the next few weeks I spent a lot of time configuring the sensor and attempting to connect it to arduino. I had no luck and gave up for a while. Finally, about a week ago, I decided that even without the TI sensor I was going to give this challenge my best shot. So even though this project will not use the TI AFE4404 bio sensor, it will still detect and alert others of in water struggle.VideoElectronics Setup
Wire the device according to the diagram above. Note: the 9 degrees of freedom sensor is shown as a different sensor on the diagram and the resistor value should be 330 ohms. Also make sure to insert the led with the longer lead into the positive end.IfTTT setup
This project uses IfTTT(If This Then That) to send sms messages to lifeguards or guardians to warn them of a potential struggle of the devices user. First, create an account by following this link . Once you are logged in, search webhooks, select the service, and click the Connect button.
Next repeat the process to connect to the sms service, follow the setup and verification using the number you would like to receive electronic lifeguard alerts.
Navigate to 'My applets' -> 'New Applet', then click on the big blue '+this' button. click the 'receive a web request button, and enter an event name which will need to be pasted into the Arduino code aswell, a good choice would be 'hazard_detected'. Finally, create the trigger.
Select the '+that' button, select 'sms', 'send me an sms', and then enter a message to send the guardian in case the electronic lifeguard detects struggle. A good example is:
Your Electronic Lifeguard has detected something is wrong! Check on the user immediately
Click 'create action' and then 'finish'.
Click on the 'webhooks' page in the top left corner of the page, and then click on settings in the top right.
In the listed URL will be a string of gibberish characters, this is your API Key, take note of this because it will need to be pasted into the Arduino code.Arduino Code
First Download the needed libraries and move them to the arduino library folder
Open the Arduino IDE and paste in the ArduinoCode listed at the bottom of this page. In the User Settings section, replace the dashes with your wifi name(ssid), and password; your api key; and the webhooks trigger name.
Optionally you can disable or configure the conserveSms Boolean to choose whether or not to limit the number of texts sent per suspected hazard to 1.
Make sure to select Adafruit Huzzah esp8266 under boards. Plug in the device and upload the code using the arrow in the top left corner.Use
To use the device, connect a usb battery pack to to the device via usb cable. Wtaerproof the device, plastic bags are an option, and secure it to your arm. If a hazard is detected, a sms message will be sent to the number you input into IfTTT.Looking Forward
In the future I would like to continue working on connecting the TI AFE4404 sensor to the electronic lifeguard arm band. I would also like to work on waterproofing and setting up multiple recipients for sms alerts to improve safety.