|
Juniper Wires (generic) |
x 1 | |
|
Arduino Yun |
x 1 | |
|
Resistor 21 ohm |
x 1 | |
|
SparkFun Pushbutton switch 12mm |
x 1 | |
|
Breadboard (generic) |
x 1 |
|
Arduino Web Editor |
|
|
Blynk |
PhoneLocator
Abstract
Figure 1: PhoneLocator’s instant response
Have you ever forgotten your phone in your friend's house? Are you afraid of an unpleasant person taking your phone? I am sure that everyone was confronted with losing or forgetting their phone. PhoneLocator aims to locate your phone (hint in the name) and send you its geolocation coordinates via email so you can recover your precious device. Thanks to Blynk, all you have to do is press a button. Note that you will need a Blynk account to operate this project, a guide to creating an account is placed under constructing the project below.
Project Overview
Whenever the user presses a button, The Arduino Yún will read the phone's geolocation and send the client an email. And to make the project more professional, you can think that the email is sent to you from the Blynk app on your phone, smart robber. Here is an image illustrating the project.
Figure 2: Functionality Overview
Figure 2 illustrates the project's code overview.
Figure 3: Code Overview
- If(button is pressed) will check if the button connected to pin 2 is pressed
- getLocation will request the phone's location from Blynk
- Process Data will process the received coordinates into the body of the email
- Send email will send the email to the user
A response from the Arduino will be received in about 8 seconds from the press of the button if the phone is located. Note that this project can work if the phone is sleeping or once the Blynk app is allowed to run in the background (even if the app is closed). The user must ensure that the Blynk project on the phone is on, for more details, see constructing the project.
Benefits
The user operating this project will benefit in:
- Locating their phone if it is lost or stolen
- Ease of use
Constructing the Project
This section walks through the process of constructing the project.
Step 1: Required Apparatus
There are a few things needed in this project.
- Jumper Wires
- 1, Arduino Yún
- 1, Button
- 1, Breadboard
- 1, Resistor (220Ω)
- 1, Smart Phone
Figure 4: All the components
Step 2: Connecting the Circuit
A simple project needs simple schematics, here is an image displaying the project's circuit.
Figure 5: The schematics
Step 3: Acknowledging the Code
There are three parts to this project's code, each one is simple.
- getLocation
- Process Location Data
- Send Email
Here is an indent look at each of the functions.
getLocation
BLYNK_WRITE(V0) // read virtual pin 0 for co-ordinates
{
latitude = param[0].asDouble();
longitude = param[1].asDouble();
altitude = param[2].asDouble();
speed = param[3].asDouble();
}
The email can only be sent as a string, so its body must be a string. This section of code will run if the received coordinates are reliable. Multiple items are added to the string, including Latitude and Longitude of the phone and a Google Maps link to view the location on a map.
The Arduino will always check if the received coordinates are existent (not 0) before sending the email, the Arduino will continue requesting the phone's location until a valid one is received, the Arduino will loop this function up to 10 times.
Process Location Data
if(latitude != 0.00 && longitude != 0.00) // if co-ordinates are valid
{
//String toSend is the string that will be sent as the emails body
String toSend = "Phone Located! \n received co-ordinates \n LAT ";
toSend += latitude; // add vaiables to string
toSend += " LNG ";
toSend += longitude;
toSend += ". View location on Maps: ";
toSend += "www.google.com/maps/?q=";
toSend += latitude;
toSend += ",";
toSend += longitude;
delay(500);
}
The email can only be sent as a string, so its body must be a string. This section of code will run if the received coordinates are reliable. Multiple items are added to the string, including Latitude and Longitude of the phone and a Google Maps link to view the location on a map.
The Arduino will always check if the received coordinates are existent (not 0) before sending the email, the Arduino will continue requesting the phone's location until a valid one is received, the Arduino will loop this function up to 10 times.
Send Email
Blynk.email(userEmail, "PhoneLocator | Notification", toSend); // send email
if(proDebug == 1)
{
Serial.println("Success");
Serial.println("Email Sent");
Serial.println("Restarting Protocol");
Serial.println("");
}
This is the function where the Arduino will send the email, the Arduino will send the string as the body of the email. ProDebug is a debugging tool that must be set to 0 in the project to enable the project to work without the Serial Monitor. The default setup is 1, which requires the Serial Monitor to be open for the project to work.
Step 4: Setting up the Variables
Ensure that all the variables marked TODO are edited. These include your email, your Blynk auth token and proDebug. You will be guided on receiving your Blynk auth token further down.
Step 5: Blynk Setup
Download Blynk. Blynk is a simple app that helps you create IOT products simply and easily, to get started with, download Blynk for IOS or Android. Create your Blynk Account
Figure 6: Blynk Setup
Step 6: Final Setup
The final step is to change the TODO variables, if not done already. The auth variable must be set to the Auth token received by email in the previous step. Make sure that all the TODO marked variables are correct. Connect your Arduino Yún to your Mac/PC and upload the code.
Figure 7: PhoneLocator
Background
I created this project as I was thinking of an easy solution to finding a lost phone. Blynk allows the user's Arduino Yun to receive geolocation even if the App is only working in the background and the phone is sleeping. By the click of a button, a lost phone can be located. Tested on iPhone (IOS11).
PhoneLocator
- 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
153 1 1 -
-