Did you ever wonder about the whereabouts of your dog ? Staying up late because your cat thought it would be a great idea to jump out the window to explore the world at 2 AM ?
With PetGPS, forget all that. You can rest at ease knowing where your pet is by just a simple touch on your smartphone.
Here's a promotional video for PetGPS along with some jokes, in French :
Context :Every 4th year student in FISE specializing in Computer Networks and Connected Objects at Unilasalle Amiens must, during the course of their academic year, undertake a project. This project will enable students to acquire technical, practical, and scientific skills identified in line with the UniLaSalle Amiens curriculum, with the aim of applying the technical knowledge gained throughout the year to develop research methodology and teamwork skills. The project guidelines entail students working in pairs at most and having a budget of 50 hours.
The PetGPS connected harness project is developed around a network of sensors and advanced communication technologies, allowing real-time monitoring and interaction with the pet. The key components of the project includes :
Hardware Configuration :Arduino MKR1310 :
This Arduino board provides LoRa connectivity for long-range communication with the network, playing a crucial role in transmitting data collected by the sensors.
Leonardo with GPS Shield :
We were given for this project a Leonardo with a GPS shield to collect our position so that we are able to update in real time the position of the animal. According to LoRa limitations, we couldn't afford to get the position every second and then, so we had to instaure a delay.
The Shield send the GPS data to the Leonardo through its serial port, then the data will be sent to the MKR1310, which will transfer the position data to TTN.
All of it was equipped with a GPS SGS Antenna. We had to ensure that the GPS antenna had direct access to the sky so that it captured the satellites in order to bring out the correct date and location.
Inside a building, it would show an incorrect date and no coordinates since it'd have no direct access to the satellites :
Due to technical problems, we lost a great amount of time as our GPS Shield wasn't functioning and replacing it also took a lot of time. So we couldn't manage to send the data to TTN in time. Nonetheless, in the short amount of time we were given, we made it receive the GPS data and understood its functioning.
DHT11 :
The DHT11 is a basic, low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on the data pin. Its fairly simple to use, but requires careful timing to grab data.
We used it to determine the temperature of the pet, though there were better options for this, but also the humidity in the air around our pet, to ensure its safety.
KeyestudioADXL345 3-Axis Acceleration Module :
The ADXL345 is a small, thin, low power, 3-axis MEMS accelerometer with high resolution (13-bit) measurement at up to +-16 g. Digital output data is formatted as 16-bit twos complement and is accessible through either a SPI (3- or 4-wire) or I2C digital interface.
We used it to sense any activity from the pet, whether its running, staying in place or else. All of it to track it down and enhance its life conditions by permitting the owner to know at all times what their pets are doing.
The Things Network (TTN) :Accessible through our school Unilasalle Amiens 's own Lora Gateway, we used The Things Network.
TTN offers an open-source LoRaWAN network tailored for the expansive realm of the Internet of Things (IoT). With a presence spanning over 90 countries globally, TTN boasts a thriving community of over 40, 000 contributors, organized into more than 400 communities.
By harnessing the capabilities of TTN, our efforts have been enhanced, facilitating seamless communication via LoRa and precise monitoring of data transmissions passing through our gateway.
We were able to adapt TTN to our specific needs by applying the knowledge gained in our courses. This was achieved through meticulous use of the Encoder and Decoder functions, as well as careful registration of our devices on The Things Network.
function Decoder(bytes, port) {
var decoded = {};
decoded.humidity = bytes[0];
decoded.temperature = bytes[1];
decoded.acceleration = {
x: ((bytes[2] << 8) | bytes[3]) * 3.9 / 1000,
y: ((bytes[4] << 8) | bytes[5]) * 3.9 / 1000,
z: ((bytes[6] << 8) | bytes[7]) * 3.9 / 1000
};
return decoded;
}
Here's our payload formatter, which helped us to transfer data in the right format for the sake of our project.
LoRa :Utilizing the LoRa protocol was one of the main features to implement in our project in order to succeed. It has various advantages like its capability in facilitating the reliable transmission of sensor data to The Things Network.
Furthermore, the low-power consumption characteristic of LoRa devices was instrumental, enabling deployment in areas with limited or no power sources, and allowing us to plan for contingencies such as adding a power switch to maintain data collection during power outages.
Moreover, the cost-effectiveness of implementing LoRa-based solutions compared to alternatives requiring extensive infrastructure or recurring subscription fees allowed us to allocate resources more efficiently, benefiting other aspects of the project.
Important to notify that the resistance of LoRa to interference and jamming ensured the uninterrupted transmission of data packets to TTN, ensuring the reliability and consistency of our data collection efforts.
Finally, the extensive coverage capability of LoRa was particularly advantageous, surpassing traditional Wi-Fi or cellular networks and aiding in monitoring the whereabouts of the pet in case it lost itself, allowing the owner to retrieve it in the shortest time.
Node-REDDeveloped initially by IBM, Node-RED is a flow-based development tool for visual programming, designed for integrating hardware devices, APIs, and online services within the Internet of Things ecosystem.
Leveraging its extensive library support, including the MQTT library utilized for payload retrieval and transmission, as well as built-in nodes for managing HTTP Requests, Node-RED offers versatility in handling various communication protocols.
Due to habit in class, we deployed Node-RED on a VMWare Virtual Machine ensuring convenient access to the platform. This setup facilitated the creation of our flow, enabling seamless integration and orchestration of connected components within our project.
Here is what our flow looks like :
The most important branch is the branch that receives the TTN Payload.
The branch starts with a MQTT-in node, then the payload goes through a function to decode it. The branch ends with a function that insert the recuperated data into our PhpMyAdmin MariaDB database. The goal of this branch is to create a new entry in the database for each payload that is received from TTN.
It was planned to create a "downlink" branch which would permits us to interact from our application with TTN but we were not able to do so due to lack of time.
PHPMyAdmin Database :PhpMyAdmin provides a platform to run SQL queries, which was useful for inserting, updating or deleting data in the table. Additionally, SQL queries can be tested and debugged directly in PhpMyAdmin, enabling rapid database performance optimization
MariaDB is a flexible and scalable database for mobile, web and server development powered by PhpMyAdmin and Wampserver in our case.
We needed to store our datas. We had already worked with PhpMyAdmin at school, so we decided to consider using this solution. What really convinced us to use PhpmyAdmin is the convenience offered by it.
After some trials and errors on Node-red to find the good path for our requests, we were able to get and post datas in our database. We then just had to update our Node-red flow to automatize the process.
We created 2 tables :
- pet_tracking, which captures all of our pet's data ( temperature, the air's humidity around it, and its activity determined by its acceleration in a 3 axis way)
- users, which contains the username and password that are necessary in order to connect to our application.
In summary, using WampServer with MariaDB and PhpMyAdmin proved to be an effective solution for data management in our Connected Harness project. It enabled structured data collection and storage, essential for the success and scalability of the project. All these additions allow the database to play a crucial role in storing the information collected by PetGPS. We connected our application to our database with a few PHP Scripts, which will be available in the attachments section.
Android Studio :The principle of our object was to be remotely. To that extent, we needed to have something with an interface so that the user could check his pet's data from the sensor and send commands to the object.
We felt that the most pertinent way to make it was to create a phone application, based on the fact that almost everyone possesses a smartphone nowadays. We chose Android over Apple simply because we both had an Android phone at the time.
Therefore, we made a simple application which displays our logo along with a connection interface. Only a Username and a password are needed :
If the user does not possess any account on our application, he has the possibility to create one by clicking on the mention "Pas de compte ? Inscris-toi ici".
Afterwards, a similar page appears in which you need to fill your next-to-be username and password. Those will be transfered to our database and you'll have the possibility to enter the application.
No need to panic if the user pressed the button by accident, he still can go back to the previous page by clicking on "Connecte-toi ici".
After connecting, we get to see this interface, which is still in development. From this simple interface, you can check the current localisation of your pet, send a downlink to TTN via the "Button" and save some waypoints in order to consult them later. You also have access to the map in order to see the whereabouts of your pet. Finally, you have the caracteristics of your pet, which updates with time.
It was planned to work on this page's style, put the characteristics in another page of the application and create a query to register multiple animals but that could not be done due to the lack of time.
You can find the source of this application in the attachments
ConclusionConcluding our PetGPS project marks the culmination of our engineering journey for now, where we seamlessly applied a diverse array of skills and technologies. This venture empowered us to craft a comprehensive system with capabilities encompassing bidirectional communication, data storage, GPS utilisation and Android application development. Navigating through challenges and innovating solutions, we not only sharpened our technical prowess but also enriched our understanding of project management and effective problem-solving strategies.
Interested in taking part to projects like ours ? Feel free to visit our school Unilasalle Amiens :Don't forget to also look at our formation :https://www.unilasalle.fr/parcours-reseaux-informatiques-et-objets-connectes
ThanksWe would like to extend our sincere gratitude to the entire team at Labo RIOC for their support and the resources provided to us. Their expertise and availability were instrumental in the conception and realization of the project.
We especially want to thank our supervisors, Mr. DAILLY and Mr. CARON, for their assistance and guidance despite our mistakes. Their advice and expertise were invaluable throughout our project.
We are grateful to each of these individuals for their contributions to our project and for their commitment to our success.
Comments