Emergency Fall Notifier With Panic Button

Introduction: Emergency Fall Notifier With Panic Button

Every year, one-third to one-half of the population aged 65 and over experience falls. Falls are the leading cause of injury in older adults and the leading cause of accidental death in those 75 years of age and older. For a human, experiencing a fall unobserved can be doubly dangerous. The obvious possibility of initial injury may be further aggravated by the possible consequences if treatment is not obtained within a short time. Statistics show that the majority of serious consequences are not the direct result of falling, but rather are due to a delay in assistance and treatment. Post-fall consequences can be greatly reduced if relief personnel can be alerted in time.

Many elderly live alone either in an apartment or a smaller house after their children have grown up and left home. It is not uncommon after a fall that an elderly person is unable to get up by themselves or summon help. There is therefore a need for an automatic fall detection system in which a patient can summon help even if they are unconscious or unable to get up after the fall.

Many algorithms have been developed but till now it is difficult to distinguish real falls from certain fall-like activities such as sitting down quickly and jumping, resulting in many false positives. Most of the algorithms use accelerometer to detect fall with body orientation, but it is not very useful when the ending position is not horizontal, e.g. falls happen on stairs.

I made a novel fall detection system using both accelerometers and gyroscopes and for that my algorithm reduces both false positives and false negatives, while improving fall detection accuracy. My system instantly notifies to a concern person with SMS and Email when fall occurred. It has also a panic button and an emergency notification can be sent by pressing it.

Step 2: Fall Detection Algorithm

With the prospect of commercialization that often surrounds health related issues, there is substantial research in the academic arena surrounding fall detection for the elderly. The majority of this research is focused on designing new more successful algorithms for distinguishing falls from non-falls. Researchers in this area typically use one or two sensors with which to extract data, develop, and test their algorithms. The first approach uses accelerometers to detect acceleration along a certain axis. When monitoring for a large acceleration from a tri-axis accelerometer, most often they look at the magnitude vector rather than at each of the axes separately. Another approach use both accelerometer & gyroscope to measure acceleration and orientation change and is more accurate compared with first one.

My algorithm is based off the concept that during a fall, a person experiences a momentary freefall or reduction in acceleration, followed by a large spike in acceleration, then a change in orientation. The flowchart for Algorithm is given below. We see the algorithm checks to see if the acceleration magnitude (AM) breaks a set lower threshold. If this lower threshold is broken, the algorithm then checks to see if AM breaks a set upper threshold within 0.5s. If this upper threshold is broken, the algorithm then checks to see if the person’s orientation has changed in a set range within 0.5s, which would indicate a person has fallen or toppled over. If the person’s orientation has changed, the algorithm then examines to see if that orientation remains after 10s, which would indicate the person is immobilized in their fallen position on the ground. If this holds true, the algorithm recognizes this as a fall. A failure of any of the intermediate decision conditions would reset the triggers and send you back to the start. The strength of this algorithm is that it requires an activity to break two AM thresholds and have an orientation change. Ideally this additional lower threshold would reduce the number of false positives. The weakness of this algorithm is that it requires the fall to involve an orientation change.

According to the algorithm following program was developed. For collecting data 6DOF MPU6050 accelerometer & gyroscope sensor is used. This sensor provide data through I2C serial bus. Arduino wire library was used to communicate with with the sensor using ATmega328 microcontroller. I used standalone ATmega chip instead of arduino board to keep the form factor small because form factor is a vital issue for wearable devices. You will get several tutorial on the Internet how to program standalone ATmega chip using Arduino board or if you buy bootloaded ATmega328 microcontroller then you can program it just replacing the chip from the Arduino Uno board. After replacement put your new chip into the Arduino board and program it. After programming detach it from the board and use it in your circuit.

Step 4: Programming ATmega328P Microcontroller With Arduino Uno

The complete Arduino program is attached herewith. You may need to calibrate the MPU sensor for getting accurate result. you may also required to adjust the threshold values used in the program. Make sure that Arduino wire library is installed.

byte trigger1count=0; //stores the counts past since trigger 1 was set truebyte trigger2count=0; //stores the counts past since trigger 2 was set truebyte trigger3count=0; //stores the counts past since trigger 3 was set trueint angleChange=0;

Step 5: Making IFTTT Channel

If you’re not using IFTTT (If This Then That), you’re seriously missing out. If This Then That allows you to combine different services with your own custom logic. Channels are the fundamental building blocks of IFTTT. They represent web services that provide data sources or even physical devices like fitness wearables.

The Maker Channel allows you to connect IFTTT to your personal DIY projects. With Maker, you can connect a Recipe to any device or service that can make or receive a web request.

I will use Maker Channel to receive a GET request from ESP8266 Module when triggered by ATmega chip. Maker Channel then send a SMS to a predefined number using SMS Channel. So, let's explain how to work with IFTTT.

Step 6: Programming ESP8266 Module

ESP8266 MCU is a wifi chip plus a programable micro-controller. There are several ESP8266 boards available, usually numbered ESP-01 through ESP-12. The prices vary from around $2 for a simple ESP-01 to $15 for a complete board with USB to serial and 3.3 volt regulator. Because the ESP8266 provides a cost-effective solution to the rapidly growing market of internet-connected projects and devices (Internet Of Things), it has become one of the most popular development platforms over the past year and a half. In consequence, a dedicated community has formed around the platform (http://esp8266.com), which has been focused on improving its functionality. For starters, different firmware options have been ported to run on the ESP8266, effectively taking it from a simple Serial to Wi-Fi adapter into a fully functional microcontroller with access to its GPIO and hardware-based functions like PWM, I2C, 1-Wire communication, and ADC; all this, of course, in addition to maintaining its Wi-Fi capabilities.

Before start programming you need to flash your ESP-01 with the latest NodeMCU firmware. Once you have uploaded the latest NodeMCU firmware. All yo need is to upload init.lua, button.lua and ifttt.lua. Don't forget to modify your SSID, password, IFTTT trigger and key. To upload all the Lua files you may use LuaLoader.

Special thanks to Noel Portugal who first developed the code snippets for his IFTTT Easy Button.

Step 7: Circuit Diagram

Circuit diagram was designed using Eagle schematic design software. As I mentioned earlier I used standalone Arduino chip for my project and for that I used ATmega328P in the schematic. A 16MHz crystal is used as clock source. Two 15pf ceramic capacitor is added for better stability. The rang can be 15pf to 22pf. You may used any value within the range. Microcontroller communicates MPU sensor through I2C bus and for that SCL and SDA pin is used to connect with MPU sensor. For receiving data correctly an interrupt signal is required and external hardware interrupt INT0 is used for the purpose. You see, I connect reset pin of microcontroller directly to the VCC. If you want reset facility you should use a 10K resistor between Vcc & Reset pin and add a button switch between Ground & reset pin. After detecting any fault microcontroller will trigger an I/O pin of ESP8266 wifi module and for that I connected Arduino pin 11 to ESP8266 GPIO2 pin. Arduino pin 11 is the pin 17 of ATmega328 IC. I used a momentary button to the PB5 of the microcontroller and the button will act as a panic button.

Step 8: PCB Design

PCB was designed using Eagle Layout editor and the board file is attached below. I tried to keep form factor small but as I used toner transfer method to developing the PCB and for that I had to use wider trace size (24mil). One jumper was required and marked as red in the top layer. PDF file is attached. You may directly print it without any scaling. Any scaling will make the thing useless. If you want to know details about PCB design using Eagle you may follow the videos.

Step 9: Etching & Drilling

Etching is a "subtractive" method used for the production of printed circuit boards: acid is used to remove unwanted copper from a prefabricated laminate. This is done by applying a temporary mask that protects parts of the laminate from the acid and leaves the desired copper layer untouched. You can etch a PCB by yourself, in a lab or even at home, through a simple and inexpensive production process. Two Acid types that can be used for etching are ferric chloride (Eisen-3-Chlorid) and Sodium Persulfate (Natriumpersulfat - Feinätzkristall). Etching can be done in simple plastic boxes as I used here. For details about etching you can follow this nice instructables: Sponge + Ferric Chloride Method -- Etch PCBs in One Minute!.& this tutorial.

After successfully etching the PCB you need to drill it using any PCB drill. You can you mini drill or DIY drill using a simple DC motor. I used a 12V DC motor to make my drill and it's performance is very good.

Step 10: Solder ESP8266 Module to PCB

I think you made the PCB successfully. Now it is the time to soldering all the components. If you have no soldering experience I recommend you the tutorial How to Solder - Through-hole Soldering from sparkfun and a nice instructables How to Solder. I assumed you have now enough experience of soldering. So, we can start soldering now. First you should solder a 28 pin IC base for the microcontroller. It is good practice to use IC base without directly soldering the IC to the PCB board. It can protect your IC from damaging it during soldering. Then you need to solder ESP8266 module very carefully to the PCB board. Also solder crystal and disk capacitors.

Step 12: Connect & Attached Power Switch & Charging Circuit

Now, connect a lipo battery charging module to the back side of the PCB. As you are attaching it in the back side you have to use hot glue to attached it with PCB. Be careful about short circuit. Make enough gap between soldered pad and the charging module when attaching hot glue. You should also attached a on-off switch with the module.

Step 13: Connect Battery

At this stage connect a li-ion battery to the charging circuit. You also have to attach it using hot glue. You may use some insulating tape at the bottom side of battery for better protection from short circuit. You may follow the photos.

Step 14: Testing

Connection is completed. Noe, it is the high time to test our invention. I think we should first check the charging of the battery. Connect a smart phone charging cable to the mini USB port. Red led should turn on means battery is charging. When battery get full charged then blue led will be on instead of red.

OK, our charging circuit is working good.

Now, turn on the on/off switch. Two leds, one from MPU sensor and another from ESP module will be turn on and it proves that our device is working correctly so far. At the beginning blue led from ESP module will be blink and indicate it is connecting to the wifi network.

Before farther testing we need to add a shock proof casing or box. You you have access to 3D printer definitely it will be a very good option to make a 3D printed casing for the device. Unfortunately I have no access to any 3D printer and for that I have to think how I can make a case for my device.

Let me some moment to think about the matter. See you again to the next step.

Step 17: Putting the Device Into the Case

Now, put the device into the instructables case and attached a safety pin in the top side of the case. power on the device. Use a tweezers to power on the device. After successful powering leds will be glow. Now test it by throwing from the top into your bed. If you receive ad SMS into your mobile phone than Congratulation!!!

You successfully made a fall detector with emergency notification.

Now you can throw it, you can put it into your pocket or you can hang it on your shoulder using a ribbon or you can push the panic button if you are in trouble. Use it as you like.

Congrats for the build. Electronics at the service of people's health not just for fun... Try making it internet independent (with an A6 module for instance) for maximum convenience and portability. Thumbs up for this great project. I will be making it.

Unfortunately the Instructable site currently leaves off anything after #include, i.e., both the greater and less than symbols (obviously a bad software implementation - which hopefully will be corrected shortly) and any text between these symbols (just check the posted sketch).

Thus, what is the include library you intended for us to use in your sketch. Please be kind enough to just respond without the greater than or less than symbols, as we can add these by hand. A text only response (without symbols) will insure your message gets through in its entirety. It may come thorough if you include those symbols here in a message, but there appears no need to take a chance it may not.

You have to register IFTTT maker channel. You will get a unique key for your channel. When you program esp8266 module you have to use the key. You also have to install IFTTT app into your mobile phone. When esp8266 get triggered then it communicates through the channel and sent a notification to your mobile app & your mobile app sent an SMS to assigned phone number using your operator.

I think he is referring to the Latin word (https://en.wiktionary.org/wiki/cum#Latin) which is generally used like the word 'with' or the meaning of being next to or additional. Ever heard of 'magna cum laude'? A general translation of that is 'with great distinction'.

It's probably fine to just use 'with' though if one is concerned with the ever burgeoning quantity of words that are added to the list of innuendo in english.

Nice project! However, it seems a bit counterintuitive to use a separate ATmega considering the fact that the ESP8266 is a full microcontroller on its own. An argument pro two microcontrollers is that you could use an ATmega (or even an ATtiny) to detect a fall, and keep the ESP8266 (that draws a lot of current) in deep sleep until it's triggered by the Atmel chip. That way, the battery could last for days on end! (also, the ESP8266 allows you to check the supply voltage, so you could send a low battery warning as well) I recommend you search for Andreas Spiess on YouTube, he has a lot of interesting videos on programming the ESP8266, and about deep sleep and power saving.(of course, you'll need an ESP8266 with the SPI pins laid out, e.g. the esp-07 or esp-12)

What if someone falls on the device? Won't it almost certainly be crushed? Also, might it catch on fire if a short circuit were caused? Doesn't seem very fail-safe.

My suggestion would be to have the device send a "no fall detected" signal about every 5 seconds (and also send out a different signal if a fall is detected). Then if no signal is received, perhaps the battery is dead or the device isn't working, or the wifi or internet connection is bad. Then the text and email can say there's no connection, perhaps a malfunction or it broke due to a fall.

You could even make it beep when it thinks a fall was detected, and create an "I'm OK" button that can be pressed if it's a false positive (perhaps separate from the device, so the button isn't accidentally pressed in case of a fall). Or use Twilio to automate a call to the elderly person and see if it is answered.