Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Arduino for Secret Agents

You're reading from   Arduino for Secret Agents Transform your tiny Arduino device into a secret agent gadget to build a range of espionage projects with this practical guide for hackers

Arrow left icon
Product type Paperback
Published in Nov 2015
Publisher
ISBN-13 9781783986088
Length 170 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Marco Schwartz Marco Schwartz
Author Profile Icon Marco Schwartz
Marco Schwartz
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. A Simple Alarm System with Arduino 2. Creating a Spy Microphone FREE CHAPTER 3. Building an EMF Bug Detector 4. Access Control with a Fingerprint Sensor 5. Opening a Lock with an SMS 6. Building a Cloud Spy Camera 7. Monitoring Secret Data from Anywhere 8. Creating a GPS Tracker with Arduino 9. Building an Arduino Spy Robot Index

Sending a GPS location by SMS


Now that we have the location part working correctly, we can start building our GPS tracking projects for secret agents. The first project will simply use the location and send it via SMS to the phone number of your choice.

As the sketch is quite similar to previous one, I'll only show which parts changed compared to the location test sketch. We first need to define the phone number where you want to send the tracking data to:

char * sendToNumber = "123456789";

After getting the location just as in the previous section, we can now build the message that we will send via SMS:

char messageToSend[140];
String message = "Current GPS location: " + latitude + "," + longitude;
message.toCharArray(messageToSend, message.length());

Using the FONA instance, it's very easy to actually send the SMS to the number we defined earlier:

if (!fona.sendSMS(sendToNumber, messageToSend)) {
  Serial.println(F("Failed to send SMS"));
} else {
  Serial.println(F("Sent location data!"));...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image