|
Arduino Web Editor |
|
|
Sigfox |
|
|
Soldering iron |
SmartWay (Geolocation Monitoring)
Abstract
Figure 1: The SmartWay device attached to the child's bag is glowing orange (meaning they have arrived late)
According to the European Commission, every two minutes, a child is reported missing in Europe; and as of 2020 in the US, 2,300 children are reported missing per day.?While 99% of missing children return home alive, these shocking statistics will discourage any parent from letting their child go to school or anywhere else alone.
SmartWay is my solution to this problem; I believe it can be used by parents or guardians who want to feel a greater sense of security when sending their child to school.?SmartWay is a device which monitors a child’s geolocation and sends the parent an alert should the child deviate from the route they take to school or home. The device will give the child feedback in the event they stray off their path, it will also?send the parent an email when the child has arrived at their destination and whether or not they arrived late.
SmartWay differs from other products on the market as it automatically updates parents on whether or not the child is heading along the right path; this alleviates the stress of having to remember to always keep an eye on where your child is. Another feature unique to SmartWay is its feedback to the child; the child may have not realized that they were taking the wrong route before being notified by the device.
The cost of deployment for a SmartWay device is illustrated in table 1.
Table 1: Cost of deployment of one SmartWay device
The monthly cost of maintenance for a SmartWay device is illustrated in table 2.
Table 2: Monthly cost of maintenance of one SmartWay device
Project Architecture
This section will cover the functionality and processes of the project.
SmartWay will continuously monitor a child's geolocation and is equipped with an RGB LED and a vibrating motor to warn a child if they are not taking the correct way to school or are late, and congratulate them when they have arrived at school.
Detecting Deviation
Figure 2: Diagram illustrating a loop which checks if the child is off course
This methos detects if the child deviated from the assigned path, the device has a system that detects the number of times that this occurs; if your child deviates off course the first time, the device will warn them by turning the LED red and vibrating the motor. Then the child will receive two minutes to return to the correct course.
If the child remains off course for more than two minutes, the parent will receive an e-mail warning them that their child is off course together with their geolocation, the email will be repetitively sent at intervals of 2 minutes until the child arrives at home or school.
Detecting Punctuality
Figure 3: Diagram illustrating a loop which checks if the child is at school
The methods illustrated in figures 3 and 4 detect if the child is late getting to school or home. The device checks if the child arrived at school or home, if they arrived in time, the LED will turn green and the device will send the parent an email informing them that their child arrived at their destination together with the arrival time.
If the child is not at their destination by the designated time, the LED on the SmartWay device will be set to orange and a notification will be sent to the parent.
Figure 4: Diagram illustrating a loop which checks if the child is at home
LED Feedback
Whenever a child arrives at home or school on time, SmartWay will notify them by making the LED glow green (figure 5).
Figure 5: The LED glowing green in the SmartWay device
Whenever a child is late arriving at their destination, the device will make the orange LED glow (figure 6).
Figure 6: The LED is glowing orange in the SmartWay device
When the child has deviated from their path, the SmartWay device will notify them of this by glowing red (figure 7).
Figure 7: LED is glowing red in the SmartWay device
Vibrator Feedback
Once the child has deviated from the route they usually take to their destination, the motor cell in the SmartWay device will vibrate every two minutes. This is implemented in the event the child doesn’t realize they have gone off course; and/or if they don’t notice the aforementioned LED feedback.
Notification Feedback
Figure 8: The notification a parent receives when their child is off course
The parent is notified when a child has been off course for more than two minutes (figure 8), when they have arrived at their destination (figure 9), and whether or not they were late arriving there.
Figure 9: The notification a parent receives when their child has arrived home
The device can only send 12 byes of information; therefore a compact packet is needed for this. There are four packets that the device can send:
- Child is off course: ("off course")
- Child arrived home: ("at home")
- Child arrived to school: ("at school")
- Child is late: ("late")
Microcontroller – Arduino MKR FOX
Figure 11: Arduino MKR FOX
The Arduino MKR FOX is the microcontroller used in the project. The device is an Arduino board from the MKR family. These boards focus on a small form factor and great battery life while maintaining the same performance available on other boards. The device operates at 3.3v as opposed to 5 volts which reduces power consumption. The processor is also equipped with a low power mode that allows it to hibernate for set periods of time. This also improves the battery life significantly.
The Arduino MKR FOX has Sigfox connectivity built in. This allows the device to connect to the Sigfox network and send small data parcels to the backend. Sigfox defines a communication protocol that allows devices to send very small data packets over the Sigfox radio infrastructure. This reduces battery consumption drastically as the packets sent are under 12 bytes and communication is unidirectional meaning that energy can be conserved through this means as well.
Finally, the device is issued by Arduino and can be easily programmed through the Arduino Ide using the c++ language.
Backend Architecture
Figure 10: Diagram illustrating the backend archirecture of the project
SmartWay’s backend architecture can be seen in figure 10.
First, Sigfox’s telecommunication infrastructure picks up the message sent by the device.
Afterwards, the message is relayed and subsequently received by the backend. The backend identifies the action associated with the message and pushes the email message to the email callback.
Once the email callback receives the message, it prepares and sends an email to the parent of the child.
Why Sigfox
The Arduino MKR FOX has built-in Sigfox connectivity through an onboard Sigfox module. This enables the device to connect to the backend with ease. Sigfox is a communications company that aims to create infrastructure that helps low power IoT devices send small packets of data through the infrastructure and then link custom web apps to perform actions with the data in the backend.
I chose to use Sigfox connectivity because it is a low power protocol and small packet sizes are perfect for the project. The device does not need to send any data to the backend but only a notification updating a parent on a child’s status. Using other protocols such as GSM or WiFi would require more power and are better suited for devices sending more data.
Messages sent by devices through the Sigfox network are centralised in their server. This data is accessible through the online portal. Sigfox allows for callbacks to be implemented, these essentially allow other applications such as a mailing service or a cloud service provider such as AWS to be integrated in the backend.
Sigfox Backend and Email
When a message arrives in the backend, a callback can act on this message. This project uses the built-in email callback to send an email to the user whenever a message is received from the device.
Deep Sleep and Battery Life
The device was constructed with longevity and extended battery life in mind. This is important with a project like this as it would not be convenient to constantly have to change the batteries. The Arduino MKR FOX runs on 2, AA batteries. These batteries are placed in a battery holder which is connected to the device via the terminals.
The MKR FOX can last for about 2 to 3 weeks on the batteries before they would need to be replaced. A combination of features allows for the extended battery life. The chip will check if the light beam is obstructed and then go to sleep for 10 minutes. This sleep mode exponentially increases the battery life of the implementation.
The Sigfox communication protocol also increases the battery life significantly because it requires minimal data exchange meaning that the device does not need to send or receive large data packets. The battery life could be extended by powering the device with a power bank if desired.
Making the Project
This section will talk about the steps needed to construct the project from start to finish and everything needed to construct it.
Please note that before starting to build the project, it is essential to check if your country is currently covered by Sigfox on their coverage map.
Step 1: Required Apparatus?
The BOM for the project can be seen above. The components are shown in figure 12.?
Figure 12: Components needed to construct the project
Step 2: Connecting the Circuit
The next step is to connect the circuit; the circuit diagram below will illustrate how this is done. The schematics attached break down the different parts of the wiring.
Figure 13: Device schematics
Step 3: Acknowledging the Code
The code consists of multiple functions, each function carries out a specific role in the makeup of the project. Please clone the code from the GitHub repository to follow along.
- Warn System
- Get GPS
- Synch RTC
- Process Location
- Do Actions
- Send Package
These sections are explained below.
Warn System
This section of the code is found in the “functions.h” file. The code will notify the child wearing the device of the current state. Overall, these methods control the RGB LED and the vibrating motor cell.
Get GPS
This is the method in charge of receiving the location and time from the GPS module. There are three things that this method does: it is used in the setup loop to sync the GPS, it is then used to sync the onboard RTC to the GPS, and it is used in the main method to get the geolocation of the device.
Synch RTC
This section of the code syncs the onboard RTC to the time received from the GPS module. Tt firsts reads the data from the GPS module, then processes it. The method then sets the current time of the onboard RTC to the time received and starts the RTC.
Process Location
This method will process the location of the device and compare it to the current time to see where the child should be at this time. It will then perform the appropriate action based on the result.
Do Actions
This struct is called to take action on the response given by Process Location, it will warn the child by toggling the RGB LED and vibrating motor cell. It will also send a package to Sigfox if necessary.
Send Package
This function sends the data to Sigfox. First, the packet sending is commenced, and then the appropriate value is parsed.
Step 4: Setting Up the Variables
The code will contain multiple variables with TODO written as a comment after them, these variables must be customised to fit the client, the client will be asked to setup
- Time For school
- Time it takes the child to travel
- Time at which school ends
- Debugging
- School Geolocation (LAT, LNG);
- Home Geolocation (LAT, LNG);
The steps below guide you through setting up the variables.
- Open the project’s code
- Find the input where the school starts and finish variables are placed (figure 14), and edit them to the time at which your child goes to and comes from school
Figure 14: School start and school finish variables highlighted in code
- Next, identify the travel time below that and edit it to the time it takes your child to get to school, in minutes.
- Now find the variables holding the geolocation of home and school
- Open Google Maps and find your school
- After you have clicked on a place close to your school, a box will pop up at the bottom of your screen (figure 15); copy the co-ordinates from this box
Figure 15: Box with co-ordinates of a location on Google Maps
- Paste the co-ordinates into the Arduino code (figure 16). Note that the first value is latitude
Figure 16: School co-ordinates pasted into the Arduino code
- Repeat the same process and enter the coordinates for home
Step 5: Frontend Setup
Ensure that the circuit is correctly wired. For details on setting up your MKR FOX, follow the Arduino tutorial.?You can find out more about the Arduino Sigfox library here.
Step 6: Backend Setup
You must have a registered Arduino MKR1200 FOX to program the backend.
- Open the?Sigfox backend?and sign into your Sigfox account
- Click on the "Device Type" in the dropdown menu at the top of the page
- Select your Arduino MKR FOX and click edit
- Select callbacks from the menu on the left and navigate to the "new" button in the top right corner
- After you clicked new, you will be presented with a number of callback configuration options, click on Custom Callbacks
- Next, a window will open, you must fill in the given form to create your callback
- Set type to Data, Uplink
- Set channel to email
- Custom payload will read the data sent by the board and then format it, you must declare a variable str followed by two :: then the variable type char and the amount of characters that this variable occupies, in our case 10 . Finally, you should have something like this: str::char:10
- Set the recipient to the email address to which the data will be sent
- Set the subject of the email to your own preference
- In the message field there are multiple variables that you can use by default without sending them from your device. We will be using {device} (device ID), {lat} (module's latitude) and {lng} (module's longitude), these variables will be automatically sent to Sigfox on top of the 12 byte payload. Therefore, you can use them without specifically sending these strings from your device. We will also be using the variable {customData#str} . This variable holds the data that has been sent by the Arduino MKR1200 FOX, customData refers to the fact that it is the personalised data the device has sent #str states that the device will read the str string sent by the device.
- We will also add a website to compare the received co-ordinates with. Using Google Maps, we can pinpoint the received data on a map. This is the URL of the website: https://www.google.com/maps/?q={lat},{lng} , lat and lng will automatically change to the latitude and longitude variables.
After following these steps, your message should look like the one in figure 17.
Figure 17: Filled out callback message
Click “Ok” once you are done.
Step 7: Uploading the Code
The last thing you need to do is upload the code from the GitHub repository. Make sure that you have customised the variables marked with "TODO". When uploading the code wait for the blue light on the GOS module to blink. Then, disconnect the microcontroller from your computer and place the batteries in the battery box.
Step 8: Constructing the Enclosure
I designed an enclosure to keep the device safe and make it look appealing (figure 18). I used two pieces of acrylic and melted the edges, curving them at 90 degrees. I placed the circuit inside and the battery box just below it. Finally, I strapped the pieces of plastic together using two cable ties.
Figure 18: The SmartWay enclosure
Conclusion?
SmartWay aims to make life easier for parents by alerting them with information about how their child got to school or home. This project leverages the Arduino MKR FOX together with a GPS module and Sigfox to send emails to parents when a child has deviated from the route they usually take to school. The device also provides constant feedback to the child about their journey.
I was inspired to create this project when I noticed that my parents were worried about sending my younger brother to school alone, but just didn’t have the time to constantly look after him. I hope that parents who are anxious about sending their children to school by themselves can use my project to remove some of the stress from their busy lives.
SmartWay (Geolocation Monitoring)
- Comments(0)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Andrei Florian
- PhoneLocator AbstractFigure 1: PhoneLocator’s instant responseHave you ever forgotten your phone in your friend's...
- SmartWristband Abstract Figure 1: The SmartWristband device being worn Monitor patients sent to self-isolate with t...
- Senso (Identification of Ilegal Logging) AbstractFigure 1: The Senso device attached to a treePeople are always told to recycle and turn off ...
- SmartWay (Geolocation Monitoring) AbstractFigure 1: The SmartWay device attached to the child's bag is glowing orange (meaning they ha...
- FlowerPot Monitor Abstract Growing and maintaining a flower or plant can be difficult. It takes time, dedication and c...
- Monitemp (Monitor Temperature And Humidity) AbstractFigure 1: A Monitemp device Not everyone has a thermostat in their home, and even if they do...
- SmartPostBox AbstractFigure 1: Post box powered by SmartPostBox Figure 1: Post box powered by SmartPostBox SmartP...
- MyPulse (Heart Rate and SpO2 Sensor) Abstract Now-a-days so many of us wear an array of sensors on our wrist all the time, keeping track ...
- CityGuide (Digital Tour Guide) AbstractCityGuide is a digital tour guide application which allows people to sightsee throughout a c...
- IntlAir (Air Quality Monitoring and Automatic Purification) Project Overview People spend most of their day at home, they wake up, go to work, then come back an...
- UnifiedWater AbstractFigure 1: UnifiedWater device being held above canal Yearly, over 8 billion tonnes of plasti...
-
-
-
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
154 1 1 -
-