Skip to main content

Hello,

Here is my 3D printed fall detector wearable, created as an entry for the Wearable Technology Design Challenge here on Designspark. 

This project consist of multiple hardware components, software and 3D printed parts. 

20190226_003422_982c6f1bba5409ce20c90349a3f7d3ec7dd90448.jpg

This project consist of two parts: the Wearable and the Base station. Each has its own components and will be explained below: 

On the Wearable:
- Arduino
- Power input from the LiPo battery
- LiPo charging circuit
- Sensor
- Alarm button
- LED 
- Wireless transmitter

On the Base Station:
- Arduino
- Wireless receiver
- Neopixel LEDs 
- Cancel button
- Power input from usb power supply

Use Cases 

- Detect fall detection
The wearable will automatically send an alarm to the base station when the wearer falls. It will calculate that no false motions causes an alarm. 

- Fire/heating detection
The wearable will automatically send an alarm when the surrounding temperature increases.

- Send alarms 
The user can press the alarm button to generate an alarm that is send to the base station. 

- Cancel the alarms
All the alarms can be cancelled on the Base Station. 

Hardware

Arduino board

The Piksey Pico from BitsNBlobs Electronics is a small Arduino compatible development board. It is a small board that is only 20.3 mm x 20.3 mm which makes it ideal for this wearable project. The Piksey Pico board is a result of a successfully funded Kickstarter campaign, links of the campaign are linked below. I backed this project with two Pico boards and will use them in this project. The company will have a second Kickstarter campaign in the beginning of 2019 with additional boards. Their new campaign will be focused to deliver kits for people who want to learn coding and to work with electronics. This board is used in both the base station and wearable.

Sensor

The MPU6050 is a combined accelerometer, gyroscope and temperature sensor that is connected by I2C to the Arduino board. To detect a fall, the accelerometer and gyroscope are used. The temperature sensor will be used to send heat/fire alarms to the base station if there is a high variation in temperature. This sensor is programmed to use I2C address 0x68.

Battery + charging circuit

The wearable is powered by a 3.7V / 350mAh LiPo battery. To recharge and connect the battery to the TP4056 LiPo module to charge the battery. I shows the charging status on the onboard LEDs, warns the user if the battery is charged. It also has overcharge protection and a stable current and voltage during charging. The battery can now be charged by a micro-usb cable.

Alarm Button

On the wearable is an Alarm Button to let the user/wearer send an alarm to the base station. The Alarm LED will confirm that an Alarm is created locally on the wearable. This button is used to interrupt the fall-detection algorithm and directly send an alarm to the base station.

Wireless communication

I have experience with Bluetooth and Wifi in my Arduino boards, but for this project I will use something new; I have a FS1000A 433MHz transmitter and receiver here that I haven't used before. For personal learning skills I use this in this project. Bluetooth would be a good alternative, but the Bluetooth module I have is quite big by size. The 433MHz transmitter is only 20mmx20mm, which is an ideal size for the wearable. The downside of the 433MHz is that it require a 170mm antenna.

Base station

The basestation is used to receive the alarms from the wearable device. It uses the same Arduino board. It has the Receiver of the 433MHz connection connected and Neopixel LEDs to show the error and warning alerts. 

Cancel button

For both the base station and wearable a button is used to generate or cancel an alert. This is a normal press button, which is grounded and connected to a digital input on the Pico board. 

On the wearable is an Alarm Button to let the user/wearer send an alarm to the base station. The onboard LED will confirm that an Alarm is created. This button is used to interrupt the fall-detection algorithm and directly send an alarm to the base station.

On the base station the button is used to cancel the active alarms. This cancel button is used to interrupt the receiver to directly cancel the active call. 

3D printing

Now let's build the wearable! To create a device, I've drawn the all the parts, printed them and put them together. It is built so it's a modular system. If you want to add a module with a screen or an additional sensor it's just possible to add an extra module and place them between each part. In the video below you can see a time laps of drawing the parts in Fusion360.

watch_fusion2_95b4ba44bf153fdbe5264d0b03272c658904ce45.jpg

The modular parts (without the connection printed connection pins):

androidwatch_3dprinted_parts_2d1f9a8b757a937d7e0d7c949a11bb1de87dfa49.jpg

I printed connection pins, in the shape of a pill to connect each part. It fits perfect :) 
rswearable_3d_1_63be7762254f79db101cee9c3bc83ecfee553863.png

Side with the velcro tape connection. The soft side is on the inside, it wears surprisingly comfortable! 
rswearable_3d_2_9228e7be8f39134e0dc759a2006d24847b637ee9.png

Software

All the software is programmed in the Arduino IDE. Below is the code in pieces shown for each function. 

Fall detection (on the wearable)

To detect if the user has fallen, an algorithm is used that combines the data from both the accelerometer and the gyroscope. Combining both sensors improves the sensibility to avoid false-positives and false-negatives. 

In the link below you can find the tutorial where this is explained. 

Temperature warning (on the wearable)

The temperature sensor data value needs to be converted and calibrated by the following:
tempC = Tmp/340.00+36.53;

Then in the loop() function, every measurement the temperature is read, and if it is above a hardcoded value, the alarm goes off. 
if(tempC >= 35)
{
int count = 0;
for (int i = 0; i<10; i++)
{
digitalWrite(AlarmLEDpin, HIGH);
delay(200);
digitalWrite(AlarmLEDpin, LOW);
delay(200);
}
}

Send manual alarm

The user has an option to send a manual alarm when he/she presses the alarm button on the wearable. The wearable is continuously scanning the sensor, to interfere this, the manual alarm will be based as an interrupt. The Arduino board has two interrupt pins (D2 and D3), which can be activated by a LOW, (HIGH), CHANGE, FALLING or RISING signal on this interrupt input. 

// declare the pins and state
const byte AlarmLEDpin = 16;
int AlarmButtonPin = 2;
volatile int buttonState = 0;

// in the setup(), configure the pins as input and output. 

// initialize the Alarm LED pin as an output:
pinMode(AlarmLEDpin, OUTPUT);
// initialize the alarm button pin as an input:
pinMode(AlarmButtonPin, INPUT);
// Attach an interrupt to the ISR vector
attachInterrupt(1, pin_ISR, RISING);

// this is the interrupt function, where the LED will toggle by each interrupt. 
void pin_ISR()
{
buttonState = !buttonState;
digitalWrite(AlarmLEDpin, buttonState);
Serial.println("-------- INTERRUPT");

// now send alarm message to base station
}

None of the interrupt code is written in the main loop() function. That function will just run until the interrupt is activated.

This interrupt functionality is used on both the Wearable and the Basestation. On the wearable the interrupt comes from the Alarm Button that generates an Alarm and sends the data.

On the Basestation the interrupt is used to cancel the call by the button, while in the loop the station waits for incoming messages. This system does not handle alarms asynchronous, so when a user cancels the call, another incoming call will be blocked for a few milliseconds since the receiving data is interrupted to cancel the call. 

Send data (from the wearable)

#include <VirtualWire.h>
char *text;
void setup()
{
pinMode(13,OUTPUT);
vw_set_ptt_inverted(true); 
vw_set_tx_pin(12);
vw_setup(4000);
}

void loop()
{
controller="Hello World";
vw_send((uint8_t *)text, strlen(text));
vw_wait_tx(); 
digitalWrite(13,1);
delay(2000);
}

Receive data (on the base station)

#include <VirtualWire.h>
void setup()
{
vw_set_ptt_inverted(true);
vw_set_rx_pin(12);
vw_setup(4000); 
pinMode(13, OUTPUT);
vw_rx_start(); 
}

void loop()
{
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;

if (vw_get_message(buf, &buflen)) 
{
if(buf[0]=='H'){
digitalWrite(13,1);
} 
}
}

Show Alarm alerts on the LEDs (base station)

Below a code example for addressing Neopixels in an Arduino project. 

// include the Neopixel library
#include <Adafruit_NeoPixel.h>
// pin where the Neopixels are connected to
#define PIN 6
// Number of connected neopixels. 
#define NUMPIXELS 16
// create the strip
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

// in the Setup() function initializes the NeoPixel library by the .begin() command
pixels.begin(); 

// in the Loop() function, set a color for each led. Each led is addressed in a for loop. 
for(int i=0;i<NUMPIXELS;i++) {
// set for the LED 'i' the color to a RGB value from 0 - 255 for Red, Green and Blue color.pixels.setPixelColor(i, pixels.Color(0,150,0)); 
// show the updated pixel color to the hardware
pixels.show(); 
// Optionally set a delay (in ms) between each led within the for loop. 
delay(delayval); 

This code is used to turn the LEDs to RED when an Alarm message is received, and turned off when the cancel button is pressed. 

 

Demo

Video of the build process: 

Temperature warning: (gif)

RSwearable_FIRE_gif_optimize_541cffe6e50174fa0f0fa811bf5667c70a25ccda.gif

 

(Links below opens the video from my Google Photos Drive, the links say 'download now, but it will open the video in the browser in this or a new tab) 

Temperature warning video: 

Fall detection video: 

 

20190228_143838_4a407986060d2e2e52324afe80e72f8cd395d6b8.jpg

20190301_004406_5e92010116b79b269c4db730dd6485671312758d.jpg

Attachments

- 3D printing file
This file contains all the parts of the wearable. 

You can follow this project live,and download the current version (v9) here: 

https://a360.co/2TmJNIY 

Links:

Pico kickstarter campaign:
www.kickstarter.com/projects/1644070715/pico-the-worlds-smallest-arduino-328pb-core
Pico store
www.bitsnblobs.com/shop
Instructables - Fall Detector page
https://www.instructables.com/id/Emergency-Fall-Notifier-Cum-Panic-Button/


Kind regards,

Marcel Kruse
(marc3l)

ps, you can follow me on Twitter @marcelkruse

Test Engineer. Love to play with embedded hardware and software.
DesignSpark Electrical Logolinkedin