Pedro Henrique Fonseca Bertoleti
Published © GPL3+

Emergency Button for Elderly and People w/ Serious Illnesses

Elderly and ill people always need special care. What do you think about making a device that calls for help anywhere in world?

BeginnerFull instructions provided3 hours5,209

Things used in this project

Hardware components

Raspberry Pi Zero Wireless
Raspberry Pi Zero Wireless
- Make sure to solder pin headers. - Before start making the project, be sure your Raspberry Pi Zero Wireless is fully operational. By fully operational, I mean: micro-SD card with Rapsbian installed, wi-fi Internet connectivity working properly and local access or remote access established.
Round arcade button (hole: 34mm)
Male/Female Jumper Wires
Male/Female Jumper Wires

Software apps and online services

Pushbullet account (free)
Raspberry Pi Raspbian

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)


Read more

Custom parts and enclosures

Project repository

This is the project repository. It includes source-code and enclosure/case (stl files).


Project schematics


Project source-code

import os
from datetime import datetime
import time
import RPi.GPIO as GPIO
import requests
import json

#Global variables:
number_of_times_button_has_been_pressed = 0

#Emergency button GPIO definition:
gpio_emergency_button = 18

#Function: prepare/setup emergency button GPIO
#Params: none
#Return: none
def setup_emergency_button_gpio():
    #setup emergency button gpio as input (using internal SOC pull-up)
    GPIO.setup(gpio_emergency_button, GPIO.IN, pull_up_down=GPIO.PUD_UP)

#Function: send Pushbullet notification
#Params: number of times emergency button has been pressed
#Return: none
def send_pushbullet_notification(number):
	now =
	StringDataHora = str(now.hour)+":"+str(now.minute)+":"+str(now.second)+" em "+str("/"+str(now.month)+"/"+str(now.year)

	StringMsg = "Emergency button pressing #"+str(number)+". Last date/time emergency button has been pressed: "+StringDataHora+"."
	data_send = {"type": "note", "title": "Notification - emergency button", "body": StringMsg}
    #ATTENTION: replace "tttttttttttttttttttttttttttttttttt" by your Pushbullet access token
    access_token = 'tttttttttttttttttttttttttttttttttt'
    result_notification_send ='', data=json.dumps(data_send), headers={'Authorization': 'Bearer ' + access_token, 'Content-Type': 'application/json'})


#Function: verify if emergency button is pressed (and waits for its release)
#Params: none
#Return: none
def verify_emergency_button_is_pressed():
	global number_of_times_button_has_been_pressed

    #if emergency button is pressed, a Pushbullet notification is sent.
	if (GPIO.input(gpio_emergency_button) == 0):
        #Update emergency button pressing counter and send the Pushbullet notification
		number_of_times_button_has_been_pressed = number_of_times_button_has_been_pressed + 1

        #debouncing delay (50ms)

        #waits for emergency button release. 
        # This ensures no risk of sending multiple notifications in just one button press.
		while (GPIO.input(gpio_emergency_button) == 0):


#   Main program

#Main loop
while True:


Pedro Henrique Fonseca Bertoleti

Pedro Henrique Fonseca Bertoleti

8 projects • 50 followers
Hi there! My name is Pedro Bertoleti. I am aboslutely crazy about: - Electronics - Embedded software design - Technology