DIY Pocket Size Emergency Button Notifier for Elderly With WiFi -- Personal Alarm (IoT)
by TechMartian in Circuits > Microcontrollers
8229 Views, 33 Favorites, 0 Comments
DIY Pocket Size Emergency Button Notifier for Elderly With WiFi -- Personal Alarm (IoT)
![iujs3nUqR8WPdSpJVoZrMw_thumb_b1f.jpg](/proxy/?url=https://content.instructables.com/F4Q/MBO6/J6WGOBK9/F4QMBO6J6WGOBK9.jpg&filename=iujs3nUqR8WPdSpJVoZrMw_thumb_b1f.jpg)
This is a DIY Internet-Connected (IoT) Personal Alarm that sends out the GPS coordinates via Email to your relatives or the police when he emergency button is pressed.
Say, you fell down the stairs and hurt yourself and you could not move. This is a one push button notifier that alerts other people, relatives or the police (depending on how you change the programming) that you have been injured or are in danger.
There are countless use cases for this button. For example, if you're walking back home late at night and encounter some 'resistance,' you can just push this button covertly and it can alert 911 for you. It is especially convenient compared to a phone, since you can notify people at just one push, a necessity in some emergencies.
Circuit
![2fmOKneeQQWg0ulifG9GHQ_thumb_b38.jpg](/proxy/?url=https://content.instructables.com/FLO/E6KA/J6WGOB9P/FLOE6KAJ6WGOB9P.jpg&filename=2fmOKneeQQWg0ulifG9GHQ_thumb_b38.jpg)
![4WFzA3wtQleH2cy7lyrAVw_thumb_b37.jpg](/proxy/?url=https://content.instructables.com/FJF/C66L/J6WGOBA9/FJFC66LJ6WGOBA9.jpg&filename=4WFzA3wtQleH2cy7lyrAVw_thumb_b37.jpg)
![mDn+iJF9SuynzN6Fl2hoCA_thumb_b36.jpg](/proxy/?url=https://content.instructables.com/FLZ/A2DJ/J6WGOBAX/FLZA2DJJ6WGOBAX.jpg&filename=mDn+iJF9SuynzN6Fl2hoCA_thumb_b36.jpg)
Follow the table below for a concise guide in wiring the sensors to the ESP32 Development Board.
I/O | I/O Pin # | Wire Colour | Arduino pin# |
---|---|---|---|
Push Button | 1 | Blue and Red | D5 and 3.3V |
2 | Orange | GND | |
Buzzer | 1 | Black | D4 |
2 | Ground Rail | GND |
Code
![Screen Shot 2017-08-30 at 8.10.32 AM.png](/proxy/?url=https://content.instructables.com/F5N/1H8P/J6WGOBT9/F5N1H8PJ6WGOBT9.png&filename=Screen Shot 2017-08-30 at 8.10.32 AM.png)
![Screen Shot 2017-08-30 at 8.10.36 AM.png](/proxy/?url=https://content.instructables.com/FSA/SXVQ/J6WGOBTD/FSASXVQJ6WGOBTD.png&filename=Screen Shot 2017-08-30 at 8.10.36 AM.png)
#define BLYNK_PRINT Serial
/* Set this to a bigger number, to enable sending longer messages */ //#define BLYNK_MAX_SENDBYTES 128
#include "WiFi.h"
#include "WiFiClient.h" #include "BlynkSimpleEsp32.h" // replace"" with <>
// You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "YourAuthToken";
// Your WiFi credentials. // Set password to "" for open networks. char ssid[] = "YourNetworkName"; char pass[] = "YourPassword";
void emailOnButtonPress() { // *** WARNING: You are limited to send ONLY ONE E-MAIL PER 15 SECONDS! ***
// Let's send an e-mail when you press the button // connected to digital pin 2 on your Arduino
int isButtonPressed = !digitalRead(4); // Invert state, since button is "Active LOW"
if (isButtonPressed) // You can write any condition to trigger e-mail sending { Serial.println(""); // This can be seen in the Serial Monitor
BLYNK_WRITE(V1) { GpsParam gps(param);
Blynk.email("Subject: URGENT EMERGENCY Emergency Button has been pressed! GPS Coordinates: %d latitude, %d longitude", gps.getLat(), gps.getLon); tone (5, 10000); } }
void setup() { // Debug console Serial.begin(9600);
Blynk.begin(auth, ssid, pass); // get this from your phone // You can also specify server: //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442); //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);
// Send e-mail when your hardware gets connected to Blynk Server // Just put the recepient's "e-mail address", "Subject" and the "message body" Blynk.email("your_email@mail.com", "Subject", "My Blynk project is online."); ! // Setting the button pinMode(4, INPUT_PULLUP); // Attach pin 2 interrupt to our handler attachInterrupt(digitalPinToInterrupt(2), emailOnButtonPress, CHANGE); }
void loop() { Blynk.run(); }
Enjoy and Stay Safe!
![qV+tRSXCTu+Pjo4lwZ0Zrw_thumb_b1e.jpg](/proxy/?url=https://content.instructables.com/FGK/KOD5/J6WGOBKA/FGKKOD5J6WGOBKA.jpg&filename=qV+tRSXCTu+Pjo4lwZ0Zrw_thumb_b1e.jpg)
Enjoy your build and Stay Safe!!