Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Sushma Jampani
Published

Fall Alert System with YOLOV8 Pose Estimation & Alexa

The Verbal Echo Dot can trigger an alert when a fall is detected through a live video stream, enabling remote notifications for caretakers.

BeginnerFull instructions provided6 hours327
Fall Alert System with YOLOV8 Pose Estimation & Alexa

Things used in this project

Hardware components

Echo Dot
Amazon Alexa Echo Dot
×1
Amazon Echo
Amazon Alexa Amazon Echo
×1
Camera (generic)
×2
Amazon Alexa Echo Buttons
×1
Internet connected Computer/WIFI enabled Smart device
×1
Argon
Particle Argon
×1
AITRIP 8 Pack 3V 1 Channel Relay Power Switch Module with Optocoupler Opto Isolation High Level Trigger for IOT ESP8266 Development Board
×2
USB hub to provide ports to power the particle and 2 echo buttons.
×1
Batter Eliminator
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Custom parts and enclosures

media2_QXTH3NMdIh.jpeg

media_dHQkkt8fww.jpeg

selected_photo_(1)_AAcudoZsTm.jpeg

Final Circuit

Schematics

circuit-Echo Argon Relay Diagram

Overview of how Echo is connected with Argon and Relay back the message

Final Circuit

Schematics Circuit Diagram

Overview of hardware and software implementations required for functionality

Final Circuit

Full View of our Final Circuit

Code

source code for particle firmware

C/C++
This code receives messages for fall detection and alerts when subject (Parnika) is out of camera range. It also enables Echo messaging with smart home integration using the Echo Photon Bridge. Alexa recognizes our device as a light switch, allowing notifications to be turned on or off. The firmware sends a message by using a relay to trigger the switch on the Echo button.
// This #include statement was automatically added by the Particle IDE.

#include <EchoPhotonBridge.h>
 
// Include Particle Device OS APIs

#include "Particle.h"
 
// Let Device OS manage the connection to the Particle Cloud

SYSTEM_MODE(AUTOMATIC);
 
// Show system, cloud connectivity, and application logs over USB

// View logs with CLI using 'particle serial monitor --follow'

SerialLogHandler logHandler(LOG_LEVEL_INFO);
 
int _outOfRangeOutput = D7;

int _outFallDetect = D0;

int _mode = 1;   // 0 = do not send announcement,  1 = send announcement

EchoPhotonBridge epb;
 
int fallDetectOnOff(int device, bool onOff, String rawParameters) {

    if(onOff == TRUE) {

        _mode=1;  

    } else {

        _mode=0;

    }

    return 0;

}
 
// setup() runs once, when the device is first turned on

void setup() {

    RGB.control (true);

    //Particle.function("fall_detection", fallDetectionHandler);

    Particle.function("out_of_range", outOfRangeHandler);

    Particle.function("fall_detection", fallDetectionHandler);

    epb.addEchoDeviceV2OnOff("fallDetect", &fallDetectOnOff);

    pinMode(_outOfRangeOutput,  OUTPUT);

    pinMode(_outFallDetect,  OUTPUT);

    WiFi.setCredentials("ACT101500027428", "93032849");

    WiFi.setCredentials("Rehrig-Guest", "Welcome!");

    WiFi.setCredentials("DanPhone", "LogicalIoT");

}
 
// loop() runs over and over again, as quickly as it can execute.

void loop() {

    if (_mode == 1) {

        RGB.color(0,255,0);

        delay(500);

        RGB.color(0,100,0);

        delay(500);

    }

    else {

        RGB.color(255,0,0);

        delay(500);

        RGB.color(100,0,0);

        delay(500);

    }
 
}
 
int outOfRangeHandler(String data) {

    if (_mode == 1) {

        digitalWrite(_outOfRangeOutput, HIGH);

        delay(500);

        digitalWrite(_outOfRangeOutput, LOW);

        return 1;

    }

    return 0;

}

int fallDetectionHandler(String data) {

    if (_mode == 1) {

        digitalWrite(_outFallDetect, HIGH);

        delay(500);

        digitalWrite(_outFallDetect, LOW);

        return 1;

    }

    return 0;

}

Credits

Dan Thyer

Posted by Sushma Jampani
Thanks to Dan Thyer.

Comments