# Monitoring the Health and Residence Conditions of Elderly People, Using LoRa and The Things Network
## 4 Materials and Methods  
### Proof-of-Concept  
A survey of the material and equipment was carried out to test the model. Then, from the operational point of view, a single-channel LoRa Gateway was installed. Finally, a prototype was built, which functions as a LoRa node, composed of several sensors and equipment.  
The LoRa Gateway comprises the following:  
* TIGO ESP32 OLED SX1276 LoRa 868/915 MHz Bluetooth WI-FI Lora Development Board With Gateway software [38] or Dragino Gateway LG01 [32];
* Internet connection (Wi-Fi/3G/4G);
* LoRa Node (prototype) assembled with some components (Figure 5):
* TIGO ESP32 OLED SX1276 LoRa 868/915 MHz Bluetooth Wi-Fi LoRa Development Board;
* DHT22 sensor (temperature and humidity);
* Accelerometer ADXL335;
* SIM808 with Bluetooth, 3G, and GPS;
* Protoboard;
* 2 Resistances of 10 K\(\Omega\) and 510 \(\Omega\), respectively;
* Diode 1N4001;
* Capacitor 22 uF;
* Connection cables;
* USB 5 V (Power Bank 10,000 mAh);
* Cayenne LPP with TTN interface (software library).  
The TIGO ESP32 card comes prepared with an OLED screen and incorporates Wi-Fi, Bluetooth, and the LoRa transceiver, having the working frequency set to 868 MHz, which is the free spectrum frequency in Europe. Furthermore, using the DHT22 sensor is efficient because it allows the reading of temperature and humidity, requiring a small circuit to adjust its connections.  
The SIM808 is a powerful device that incorporates Wi-Fi, GSM, and GPS, albeit of reduced dimensions. The main features of the SIM808 are as follows [39]:  
* Quad-band 850/900/1800/1900 MHz;
* GPRS multi-slot class12 connectivity: max. 85.6 kbps(down-load/up-load);
* Controlled by AT Command (3 GPP TS 27.007, 27.005 and SIMCOM enhanced AT Commands);
* Supports real-time clock;
* Supply voltage range 3.4 V-4.4 V;  
Figure 5: Prototype connection scheme.  
* Integrated GPS/CNSS and supports A-GPS;
* Supports 3.0 V to 5.0 V logic level;
* Low power consumption, 1 mA in sleep mode;
* Supports GPS NMEA protocol;
* Standard SIM for 2G/3G/4G card;  
The SIM808 prototyping plate has to be powered externally, requiring a complementary power source. As the highest power from the ESP32 is 5 V, it is necessary to correct the voltage so that it is between 3.4 V and 4.4 V, so the implemented circuit adjusts the voltage to 3.7 V (Figure 5). In this way, we only need a battery as a power supply for the whole circuit. With this equipment, it is possible to obtain the GPS coordinates in real time, programmed to interconnect with the ESP32. Low energy consumption is critical, as the system should be as economical as possible. The GPRS connection functionality is still quite relevant in this device. However, all the work is thought of for regions where the mobile network signal does not exist or is very low. Thus, it is possible to program it so that, if a GPRS network exists, in an emergency, a risk situation warning mechanism may be triggered, using the mobile network. This way, an SMS message, which requires few communication resources, with the description of the risk event and the GPS location can be sent. This functionality was not implemented, being reserved for the future since it requires a telecommunications plan from an operator. The Bluetooth functionality was not used in this equipment because it is not part of the requirements.  
The ADXL335 is a high sensitivity 3-axis (x, y, z) accelerometer, which allows real-time analysis of the object's position carrying it and is calibrated in the first use. After calibration, the mapping and adjustment to the Cayenne LPP format used is performed.