Professional Documents
Culture Documents
I. I-Introduction
This last chapter is devoted to the description of the hardware and software environment used to
set up the IoT infrastructure of our solution, as well as in the development part. It also includes
screenshots of the interfaces to describe the implementation of both parts.
The LoRa Shield v1.4 is a powerful add-on for Arduino boards, empowering you to unlock
the potential of LoRa technology. This revolutionary wireless communication protocol boasts
incredible long-range, low-power capabilities, making it ideal for diverse applications in
remote areas or harsh environments.
Feature :
LoRaWAN and private LoRa support: The shield can be used with both LoRaWAN
and private LoRa networks.
SX1278 LoRa chip: The shield uses the SX1278 LoRa chip, which is a high
performance LoRa transceiver.
Arduino shield compatibility: The shield is compatible with all Arduino boards
that have an SPI interface.
b- Gateway:
The Dragino Gateway LoRa is a gateway device that allows LoRa devices to be connected
to a Lora WAN network. The Dragino Gateway LoRa supports ISM (industrial, scientific and
medical) band frequencies 433 MHz, 868 MHz and 915 MHz, and uses the Lora WAN 1.0.2
protocol for communication with LoRa devices.
Features :
• Long-range communication: The LG O1 P can communicate with LoRa devices over
a range of up to 15 kilometers (9 miles).
• Low power: The LG O1 P is very power-efficient, making it ideal for battery-powered
applications.
• Reliable performance: The LG O1 P is designed to be reliable and can withstand
harsh environmental conditions.
c- MPU6050 accelerometer sensor:
The MPU-6050 is a module with a 3-axis accelerometer and a 3-axis gyroscope. The
accelerometer measures acceleration (rate of change of the object’s velocity). It senses static
forces like gravity (9.8m/s2) or dynamic forces like vibrations or movement. The MPU-6050
measures acceleration over the X, Y, and Z-axis. Ideally, in a static object, the acceleration
over the Z-axis is equal to the gravitational force, and it should be zero on the X and Y-axis.
Features :
1- Software
environment
•Versatility: The Arduino Uno is compatible with a wide range of sensors, actuators,
and shields, making it suitable for a variety of projects.
•Community: There is a large and active Arduino community that can provide support
and resources for beginners and experienced users alike
We use a variety of software to carry out the different IoT part tasks:
This equation is of the magnitude of acceleration and the three values ax, ay, and az are the
acceleration of X-, Y-, and Z-axis respectively as per data collected.
After calculating the acceleration magnitude, we need to know if its value breaks the lower
threshold. The lower threshold is the minimum threshold in the range decided by us and the value
2- Source
Code
gradually increases up to the high threshold. Then we need to check that it breaks the high threshold in
some milliseconds — for testing let's say 170 ms.
If all of these are detected as true conditions, then we need to check whether there is a change in
orientation within 170 ms and usually, it's true if the above conditions are true. After that, we check to
see if orientation remains the same for some time.
If yes, then there was a fall. There is a loop, meaning that if a condition is false at any stage, the
process goes back to start and re-executes.
a- Fall detection
The code in the annexe N° 3 is based on the algorithm stated above and follows seven steps:
Here the values of X and Y and Z based on the movement of the sensor. Those values are being
recorded by using the serial monitor in Arduino software.
Here The above graph shows the values of X and Y and Z based on the movement of
the sensor. These values are taken from Arduino with the Mpu6050 sensors when the device is
attached to the human body.
The picks of the yellow line show the fall detection:
b- Transmit Data
The dragino lora shield model support ABP method for better simplicity , speed and security
and this is how it works :
Arduino IDE “MCCI loraWAN LMIC library “ provide a code for lora antenna
transmission (annexe N°4)
This is the configuration that we need to assure the communication between the antenna
and the thing network :
First thing to do is to create an account on the internet of thing iot cloud platform then create
an application and register the devices “lora shield” then register the lora gateway
This is the interface when you sign up :
a- Create an application :
we need to enter the application name and ID
b- Registering a device:
The device node, composed by an Arduino Uno + Dragino LoRa Shield, once it is
correctly registered in TTN collects the LDR data and send them through LoRa.
To register the device into TTN, we have to browse the console, click on Application
and, if it is necessary
to register a device we need to enter : end device ID + frequency plan of the lora shield +
Lora wan version
“Device ID” field with a unique name for our device and ask for random generation of both
“Device EUI” and “AppKey”. And enable “ABP” as “Activation Mode” asking for random generation
of the “App Session Key” and the “Network Session Key”.
Before the registration of the gateway on the internet of thing platform we need to make some
configuration for the gateway :
To accomplish both the connections we firstly need to link the Dragino gateway to our PC
through another Ethernet cable using the LAN port. This, as the port name suggests, creates a LAN
among the two items and gives us the opportunity to access the configuration page just typing in the
browser this IP: “10.130.1.1”.
*radio settings
Just some settings are missing now: we need to browse in LG01 Sensor → Lora WAN page to input
the correct Lora Radio settings used to receive data from the LoRa nodes.
On the manual registration form we fill in the Frequency Plan and the Gateway ID t he other
fields are optional.
After long research we discovered that is a common problem with the other users of
the thing network
So we end the process of the project here because we need the gateway to connect to
the thing network platform so we can process the data that was send by the lora shield , that’s
why we can’t complete the sending ‘SMS alert’ part
IV. Conclusion
In this study, a wireless sensor system is implemented to measure the acceleration and angular
velocity at center chest on the body for four different types of falls. The collected data is used to
evaluate the performance of the fall detection algorithm
Unfortunately, we were not able to complete the project due to technical problems and lake of
time.
In conclusion, a fall detection system has been validated to show high sensitivity and specificity
results, using the combination of accelerometer and gyroscope
Webography
*https://www.thethingsnetwork.org/docs/lorawan/
*https://medium.com/@marcozecchini.2594/connect-dragino-lg01-p-gateway-and-a-dragino-
lora-shield-arduino-uno-to-the-things-network-301d27184e05
*https://github.com/dragino/Lora
*https://sensorkit.arduino.cc/
* https://ieeexplore.ieee.org/
* https://maker.pro/arduino/tutorial/how-to-build-a-fall-detector-with-arduino
* https://wiki1.dragino.com/index.php/Lora_Shield
Bibliography
Fall_Detection_System_Using_Arduino_MPU.pdf
Alert_System_for_Fall_Detection.pdf
Fall_Detection_System_Using_Combination.pdf
Fall_Detection_Devices_and_Their_Use_Wit.pdf
e_Health_Monitoring_System_for_Senior_Ci%20(1).pdf
Operationalizing_a_wireless_wearable_fal.pdf
LG01N_LoRa_Gateway_User_Manual_v1.1.pdf
Livre-LoRa-LoRaWAN-et-lInternet-des-Objets.pdf
Annexe
#include <Wire.h>
#include <I2Cdev.h>
#include <MPU6050.h>
MPU6050 mpu;
const float accelerationThreshold = 170.0;
int16_t ax, ay, az;
int16_t gx, gy, gz;
struct MyData {
byte X;
byte Y;
byte Z;
};
MyData data;
void setup()
{
Serial.begin(115200);
Wire.begin();
mpu.initialize();
Serial.println("Initializing...");
//pinMode(LED_BUILTIN, OUTPUT);
}
void loop()
{
mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
data.X = map(ax, -17000, 17000, 0, 255 ); // X axis data
data.Y = map(ay, -17000, 17000, 0, 255);
data.Z = map(az, -17000, 17000, 0, 255); // Y axis data
delay(1000);
Serial.print("Axis X = ");
Serial.print(data.X);
Serial.print(" ");
Serial.print("Axis Y = ");
Serial.print(data.Y);
Serial.print(" ");
Serial.print("Axis Z = ");
Serial.println(data.Z);
}
}
#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>
#ifdef COMPILE_REGRESSION_TEST
# define FILLMEIN 0
#else
# warning "You must replace the values marked FILLMEIN with real values from
the TTN control panel!"
# define FILLMEIN (#dont edit this, edit the lines that use FILLMEIN)
#endif
// The library converts the address to network byte order as needed, so this
should be in big-endian (aka msb) too.
static const u4_t DEVADDR = 0x260BDE05 ; // <-- Change this address for every
node!
// Schedule TX every this many seconds (might become longer due to duty
// cycle limitations).
const unsigned TX_INTERVAL = 60;
// Pin mapping
// Adapted for Feather M0 per p.10 of [feather]
const lmic_pinmap lmic_pins = {
.nss = 10, // chip select on feather (rf95module) CS
.rxtx = LMIC_UNUSED_PIN,
.rst = 5, // reset pin
.dio = {2, 3, LMIC_UNUSED_PIN}, // assumes external jumpers
[feather_lora_jumper]
// DIO1 is on JP1-1: is io1 - we connect
to GPO6
// DIO1 is on JP5-3: is D2 - we connect to
GPO5
};
case EV_TXSTART:
Serial.println(F("EV_TXSTART"));
break;
case EV_TXCANCELED:
Serial.println(F("EV_TXCANCELED"));
break;
case EV_RXSTART:
/* do not print anything -- it wrecks timing */
break;
case EV_JOIN_TXCOMPLETE:
Serial.println(F("EV_JOIN_TXCOMPLETE: no JoinAccept"));
break;
default:
Serial.print(F("Unknown event: "));
Serial.println((unsigned) ev);
break;
}
}
void setup() {
// pinMode(13, OUTPUT);
while (!Serial); // wait for Serial to be initialized
Serial.begin(115200);
delay(100); // per sample code on RF_95 test
Serial.println(F("Starting"));
#ifdef VCC_ENABLE
// For Pinoccio Scout boards
pinMode(VCC_ENABLE, OUTPUT);
digitalWrite(VCC_ENABLE, HIGH);
delay(1000);
#endif
// LMIC init
os_init();
LMIC_reset();
#ifdef PROGMEM
uint8_t appskey[sizeof(APPSKEY)];
uint8_t nwkskey[sizeof(NWKSKEY)];
memcpy_P(appskey, APPSKEY, sizeof(APPSKEY));
memcpy_P(nwkskey, NWKSKEY, sizeof(NWKSKEY));
LMIC_setSession (0x13, DEVADDR, nwkskey, appskey);
#else
// If not running an AVR with PROGMEM, just use the arrays directly
LMIC_setSession (0x13, DEVADDR, NWKSKEY, APPSKEY);
#endif
#if defined(CFG_eu868)
LMIC_setupChannel(0, 868100000, DR_RANGE_MAP(DR_SF12, DR_SF7),
BAND_CENTI); // g-band
LMIC_setupChannel(1, 868300000, DR_RANGE_MAP(DR_SF12, DR_SF7B),
BAND_CENTI); // g-band
LMIC_setupChannel(2, 868500000, DR_RANGE_MAP(DR_SF12, DR_SF7),
BAND_CENTI); // g-band
LMIC_setupChannel(3, 867100000, DR_RANGE_MAP(DR_SF12, DR_SF7),
BAND_CENTI); // g-band
LMIC_setupChannel(4, 867300000, DR_RANGE_MAP(DR_SF12, DR_SF7),
BAND_CENTI); // g-band
LMIC_setupChannel(5, 867500000, DR_RANGE_MAP(DR_SF12, DR_SF7),
BAND_CENTI); // g-band
LMIC_setupChannel(6, 867700000, DR_RANGE_MAP(DR_SF12, DR_SF7),
BAND_CENTI); // g-band
LMIC_setupChannel(7, 867900000, DR_RANGE_MAP(DR_SF12, DR_SF7),
BAND_CENTI); // g-band
LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK, DR_FSK),
BAND_MILLI); // g2-band
LMIC_selectSubBand(1);
#elif defined(CFG_as923)
#elif defined(CFG_kr920)
#elif defined(CFG_in866)
// Start job
do_send(&sendjob);
}
void loop() {
os_runloop_once();