AN-1156 Fall Detection Alert using GreenPAK™

In this application note we develop an elderly care alert system using GreenPAK SLG46533V. This fall detector/ panic button is a low-powered device so that it works for long periods of time. The panic button can be triggered manually by the elderly person and also it can detect a fall event and send an alert email to the concerned individuals. The panic button alarm/help call can be reset manually.

The circuit receives its inputs from ADXL335, a 3-axis accelerometer module. A brief introduction of the module is described below.

ADXL335 3- axis accelerometer Module

The ADXL335 is a small, thin, low power, complete 3-axis accelerometer with signal-conditioned voltage outputs. It measures acceleration within the range of ±3g. It can measure the static acceleration of gravity in tilt-sensing applications, as well as dynamic acceleration resulting from motion, shock, or vibration.

The module is powered with 3.3V DC and has 3 analog outputs which measure acceleration in 3-axis (x, y, z).

In the case of no acceleration the corresponding outputs read 1.65V.

If the device measures positive acceleration, the output values increase towards 3.3V; negative acceleration causes the values to decrease towards 0V. Since the Z-axis has acceleration due to gravity present at all times, z-output reads value equivalent of 1g (ideally 2.2V dc), i.e. its output is higher than X-output and Y-output when at rest (Fig.1).

Figure 1. ADXL335 Module

Hardware Schematic

The hardware schematic has the ADXL335 module connected with the SLG46533V. The 3 axis acceleration outputs are connected to analog input pins for GreenPAK comparators and are compared with the thresholds set in the GreenPAK code.

Thresholds are also set externally by the 10k potentiometer (Fig. 2).

Figure 2. Hardware Schematic

GreenPAK Design Code

The design code consists of two types of acceleration surges: one for the X and Y axes and the other for the Z axis.

X and Y axis Acceleration

If positive or negative acceleration increases on the X axis or Y axis in a short interval of time, it may indicate a fall. (The value can be adjusted according to the activity level of the elder.) The voltage due to the acceleration surge is compared with the threshold set in GreenPAK for ACMP0 and ACMP2, which are by default set at 1100mV which corresponds to -1g. The sensitivity of the fall sensor can be adjusted in the GreenPAK code by changing the IN- voltage of the analog comparators (Fig. 3).

Figure 3. X and Y axis acceleration Thresholds

For positive acceleration detection for the X and Y axes, a 10K potentiometer is set to set the IN- input of the analog comparators at the desired values (currently it is set at 2.2V, which corresponds to +1g).

If any of the four analog comparators detects an acceleration surge, it sets the DFF3 output high. If the surge is longer than one second it will be neutralized. The reason behind neutralizing longer surges is that it may reflect a continuous activity like walking, running etc. A fall event would generate a small surge of acceleration in any of these four axis (X, X’, Y and Y’).

The hardware connections of these two axes with the GreenPAK design code is tabulated below (Table 1).

Axis ->

X-axis

X’-axis

Y-axis

Y’-axis

in

6

10

13

15

Threshold

1100mV

2.2V

1100mV

2.2V

Threshold set in

GreenPAK code

External

GreenPAK code

External

Table 1. X and Y axis acceleration surge set-points and Pins

Z-axis Acceleration

The Z-axis acceleration has a key role in determining whether a fall event has occurred. The Z-axis acceleration has a negative surge when impact occurs. This surge is large and it can alone be used to determine the fall event. The digital input Pin7 is used to determine this surge (Fig.4).

Figure 4. Z-Axis Acceleration

If any of the 5 surges described occur, a fall would be detected and Pin 17 output is set high.

The output can be reset by manual button attached at Pin 2. This can help in neutralizing the spurious fall signals. The fall signal or help signal can be manually initiated by pressing the button attached to Pin 3.

From here there are two different approaches to send this fall signal to some individual via email:

1. For more than two (and less than 8) input System

The output from 8 different GreenPAK SLG46533V’s can be connected to the internet via ESP-01 module and a GreenPAK SLG46620V.

The eight input signals are sent to the SLG46620V, which send them serially to ESP-01 which is used to email a specific address.

The ESP-01 module is configured to perform the following functions:

(i) It assigns a fixed IP to access the GreenPAK device (192.168.10.100 in this case)

(ii) It connects to a smtp2go server account

(iii) If any one of the inputs is triggered, an email is sent to the selected email address. The content of the email shows which input which has detected the fall/panic. For more than one fall event, the email contains the status of all the panic inputs which have been triggered.

Data is transmitted serially from the SLG46620V to the ESP-01 module. The RX pin of ESP-01 is connected with Pin 12 of the SLG46620V. The ground signals of all the modules (ADXL335, ESP-01, SLG46533V and SLG46620V) are connected together.

The interface between the ESP-01 and SLG46620V is tabulated below (Table 2).

Sr. No.

SLG46620V Pin

ESP-01 module Pin

Detail

1.

12

RX

Serial Wireless data to the selected email account

2.

GND

GND

Short the Ground terminal of two devices

Table 2. Data transmission between SLG46620V and ESP-01 Module

The hardware schematic of this part is shown in Fig.5.

Figure 5. 8 inputs data transmission to ESP-01

GreenPAK SLG46620V Design code for sending 8 inputs data to ESP-01

The design code of SLG46620V consists of four parts:

1.1 Enable Digital Write Operation

This part of the code enables the digital input write operation from GreenPAK SLG46620V to ESP-01 module. When PIN 20 is set high, it clocks VDD through DFF 6, which causes Enable Write to go high. The nReset pin is permanently high so that the DFF cannot be reset. The Enable Write signal is passed back to Matrix 0 through P10 (Fig.6).

Figure 6. Enable Digital Write Operation

1.2 4-Bit Mod-10 Counter

Among the four outputs (Q4, Q3, Q2 and Q1) of the flip-flops, Q4 is the MSB and Q1 is the LSB. The circuit counts up to 10102 or 1010, then it is reset by the reset block (Fig.7).

Figure 7. 4-Bit Mod-10 Counter

Workings of a single block of counter

The first block of the counter is enabled by cross-matrix connection P10 (Enable Write). The XOR gate (2-L0) then sets its output high, which sets the ‘DFF 0’ output high. CLK is set to have a time period of 104µs through OSC and CNT0/DLY0 block settings.

Every 104µs the clock input checks the DFF 0 block input (coming from XOR gate 2-L0) and sets it high or low. The high Q1 output is then passed through the AND gate (3-L0) for next block (Fig.8).

Figure 8. First Block of 4-Bit Counter

During the next cycle of CLK, the high Q1 at the input of the XOR gate (2-L0) toggles its output to zero and it is passed to the next block. So the output of first block toggles between 0 and 1 for every clock cycle of the CLK.

As shown in Fig.9, second block of the counter is similar to first except the enable input is coming from the first block (3-L0 output). The next two blocks are also similar to the second block.

Figure 9. Second Block of 4-Bit Counter

1.3 Reset Mod-10 Counter

The LUT (4-bit LUT0) resets the counter once it reaches its 11th state (10112).

1.4 Concatenating Start bit, 8 digital status bits and Stop Bit

In this phase the counter outputs trigger one of the 10 bits (start bit, 8 button status and stop bit) to be routed to PIN 12 one at a time.

As wireless networks may have different configuration from the one used in this application note, therefore some particular changes are required for modifying the ESP-01 module code to suit the wireless network it is connected to:

(i) Setting name and password of Wireless network

The name and password of the wireless network needs to be set in line 34 and 35 of ESP-01 module code respectively.

2. For two or fewer panic buttons

Using two or fewer inputs scheme is quite simple. The inputs are attached to the two IO’s of the ESP-01 module. If any of the inputs are high, the attached Digital Input of ESP-01 reads high. The ESP-01 code can be easily configured to send an email to the selected email address in this event.

Power consumption

The overall power consumption of this complete design is very low, on the order of 500µA. The major contributors of this current consumption are 320µA for the ADXL335 and 80µA for the ESP8266. Thanks to this low power consumption, the device will be able to run for a long period of time.

In addition, the ESP-01 module can be adjusted to run in deep sleep mode. For details, please visit:

Conclusion

In this application note we developed an elderly care alert system which can detect fall events and send alert messages to an email address. Additionally, the panic button can be reset manually.

Since this is a low power consumption device, it can run for long periods of time on a single charge. It has the capability to detect a fall event automatically, which is a major asset since the elderly person who suffered the fall may be unconscious and unable to trigger the help call.

About the Author

Name: Bilal Ahmed

Background: Bilal Ahmed received an MS in Electronics Engineering from NED University, Karachi. He has more than 10 years of experience in PLC, SCADA, Data acquisition, Industrial automation, Robotics and Embedded systems. Currently he works as Head of Embedded systems and Robotics in HF Electronics.