Introduction: 'Never' Lose Your Phone Again
Hopefully you’ve never experienced that sinking feeling the moment you realize that you’ve either lost or had your mobile device stolen. This situation alone can be enough to paralyze some, but if it happens while you’re away from home on unfamiliar territory, it’s even worse.
- But many of you have faced that worst experience. I know how it feels because I lost it too!
- So, what did you do after that? I tried so hard to find it but no success! So, at last after a month I got new cell phone.
- So, What's next? How to prevent it from losing? Do i need to Install security apps? What if someone will remove your all data ? Still would it be possible to track your phone's location? What if someone/ something will alert you when you are about to lose it at USD 10 cost!!
- Yes, you are right! That was my thought to prevent it from losing again after losing it for the first time and now here I am! This device will tell you when you are about to lose your phone. You can use it as Key-chain, put it in your pocket, Carry it in your bag, Use it as Wearable (my next plan) and many other ways. So, next question is how?
Let us first watch the video and then I will tell you how it works and how you can make your own :)
Step 1: Get Some Parts
So, overall cost of the project is around USD 10. Yeah, that's it ~USD 10.
Here is a list of parts you will need:
1.ESP8266 - esp12 - ESP8266 is a WiFi Microcontroller at a price you like from Espressif. - Which I got from local electronics market for INR 150 (~USD 2.50)
To get it from ebay : Click here
OR You canGet NodeMCU board if you want to avoid some manual connections in Step 2. To get it from ebay click here.
2.UltraFire 18650 5800mAh 3.7V Li-ion battery with holder - I got it from local electronics market for INR 270 (~ USD 5.50 )
3. USB to TTL (5V & 3.3V) - 14 pins : I got it from from local electronics market for INR 120 (~USD 2).
to get it from Amazon : Click here
NOTE: In case if you have purchased NodeMCU board then you don't need to purchase this. You can use USB cable.
4. Some LED and Buzzer : To alert you that you are about to lose your phone. - I got it from from local electronics market for INR 2 and INR 10 respectively. So, total INR 12 (~ USD 0.18)
Get some jumpers and / or connectors or headers for connection.
Step 2: Connections
Now, it's right time to take out your soldering iron.
1. Connect jumpers or headers whatever you have to following pins of ESP8266 esp12.
Vcc,GND, GPIO4, , GPIO0, Tx and Rx
2. You need to also short CH_PD / EN pin to 3.3V using wire or lead.
3. Short GPIO15 to GND.
4. Connect buzzer positive on GPIO4.
5. Connect resistor of 220 ohm to GPIO4 (or buzzer output which is connected to GPIO4) and another terminal to red LED.
5. Connect buzzer negative and LED negative to GND.
Here, note that don't short GPIO0 directly to GND, instead use jumper or header. Because when you want to upload your sketch GPIO0 need to be Grounded. After this if you want to run the same sketch everytime GPIO0 need to be disconnected from GND.
Here, we want to run the same sketch at boot up so while uploading the code we will ground it and after completion we will remove that connection.
I have made connection diagram in Fritzing. Here is the image of connections as well as Fritzing file.
Step 3: IBM Watson IoT Platform
- Although if you don't want to connect this device to IBM Watson, it will work as I described.
- But my idea is to send Signal Strength to cloud using MQTT protocol and after a threshold value I want my phone to publish it's location on cloud as an extra layer of protection. For as of now I'm just publishing my readings on Watson IoT platform.
- Next step is to sign up on IBM Bluemix using this link for free 30 days trial.
- After completing that you will be on Catalog page. Check Image 1.
- Then from "Boilerplates" section select Internet of Things Platform Starter. Check Image 2.
- Then select plans according to your need. Check Image 3.
- Now, from Menu select Dashboard. Menu (on left corner of the screen) --> Dashboard. And you will be on IBM Bluemix Apps page. Check Image 4.
- Now, click on myMQTT-iotf-service, in Services --> Internet of Things service. Check image 5.
- Now, follow this guide to add devices.
Step 4: Setup ESP8266 Boards in Arduino IDE
Before we upload code, we need to add ESP8266 boards to in Arduino IDE.
- Install latest version of Arduiono IDE from their website for your OS. Click here. Or you can try out the new Arduino Web Editor. I have used Arduino IDE for this Instructable.
- Get ESP8266 boards from GitHub using this link. Follow the instructions provided on the bottom. OR you can directly install it from Boards manager under Tools section. So, path is Tools -> Board -> Board Manager. Then search for ESP8266 and install. OR You can refer this instructable too, to setup ESP8266 board.
- Get pubsub client library for Arduino from GitHub using this link. Unzip it and add it to C:\Program Files (x86)\Arduino\libraries.
- For API documentation of pubsub client visit this link.
Step 5: Upload Code to Your Device and Check on IBM Watson IoT
Now, we are ready to upload our code.
- Download Never_lose_your_phone_again.ino file from attachment.
- Upload the code to your device.
- Open Serial monitor and check your RSSI. An image is in the attachment for reference.
- Go to your IBM Watson Bluemix account, and check under devices section.
- It should show connected. Check an image for the reference.
- Click on the connected device (i.e ESP1).
- Check Connection state under Connection information and Recent Events for data received time and date with format of data. Check Images for the reference.
- Before going further Disconnect your GPIO0 If you haven't. So, when next time you will power ESP8266, it will connect to your WiFi and start sending data to Watson IoT. Check connections image for the reference.
- I followed this guide to connect ESP8266 to IBM Watson and modified the code according to my need. Thank you Ant Elder. Check here.
Step 6: We Made It!! Congrats!
So, now we are done with it. From now carry it with you as wearable, in pocket or in bag or any other way you like. And prevent your phone from losing!
My Future Plans:
- Use LIR2450 Lithim coin cell to further reduce size of the device.
- By using NodeRed on Watson IoT platform, I will set threshold (For example -60 dBm here) there for taking action.
- My phone will be connected to MQTT Broker on Watson and subscribed to that topic on which I am sending RSSI.
- Once the threshold will be crossed I will start publishing phone's location to another topic.
- As IBM Watson demo app with paho is already available on GitHub it will be easy to implement.
- Thank you so much. If you have any questions feel free to ask in the comments.
- Happy Making :)
We have a be nice policy.
Please be positive and constructive.