Ever been at a party or out to dinner and we're just begging for an excuse to leave? Ever wish you had friend who was just on constant standby to call you with some "Immediate news" that suddenly "forced" you to get up and leave? Well worry no more! With the LinkIT ONE, you have a 24/7 standby robot ready to call you with some "grave news" at the drop of a text. Say goodbye to awkward conversations, and hello to sweet freedom!

Step 1: Supplies

Lucky for us, we don't need much supplies for this project. All we need is a LinkIT ONE board and a SIM card! Yup, it's that easy!

  • LinkIT ONE Board
  • SIM Card

Step 2: Configure Your LinkIt ONE Board

We'll need to modify some of the switches on the LinkIt One board in order to make it work. Along with the image attached, make sure that you have done the following

1. Set the MS -- UART switch to UART

2. Set the USB -- BAT switch to USB

3. Set the SPI -- SD switch to SPI

Connect the GSM Antenna in order to receive Text Messages and make phone calls!

Step 3: Insert Your Sim Card

I know that most people probably don't have a pre-paid SIM card laying around. If you are just prototyping and want to see a proof of concept, feel free to remove it from your current cell phone (or one of your friends) just to try it out. If you get serious and want to make this a full-time gig, you will have to pony up for a pre-paid SIM.

Inserting the SIM card is a fairly straight forward process. Flip over your LinkIt One and look at the smaller big metal piece. You can see in the figure where I inserted my SIM card if you are confused.

After you have inserted the SIM card, be sure to attach your GSM antenna that came with your LinkIt One kit. This will allow you to get a cell signal.

Step 4: Code I: Receiving a Text Message

From here on out it is all code until deployment, but let's not rush things when we are just getting to know each other. The code isn't your average every day Arduino C++ because we are using something much more powerful: LinkIt ONE. The libraries are much more extensive and the technology more advanced. Making a phone call with a micro controller right out of the box can seem a bit strange. We'll be using the LGSM library pretty extensively, so it might be useful to read up on that a bit.

Catching a Text Message

First, we want to catch a text message. Following the logic within the loop() function...

if(LSMS.available()) // Check if there is new SMS

This giant if block checks to see if a new text message is available. If it is, let's continue and go and parse it.

LSMS.remoteNumber(p_num, 20); // display Number part
Serial.println("There is new message."); Serial.print("Number:"); Serial.println(p_num); Serial.print("Content:"); // display Content part

Next, we print some basic debugging info. When this thing is deployed, we probably don't care much about the serial output, but it is always good practice to print this out just in case we want to go back and take a look.

{ int v = LSMS.read(); if(v < 0) break; dtaget[len++] = (char)v; Serial.print((char)v); }

Next we're going to read the text message. It's a little difficult because with this embedded technology, it's not so simple as 'String = textMessage.read();'. Instead, we have to read the bytes from the text message character by character, forming an array of characters that is our eventual message. This is done in the above while loop.

LSMS.flush(); // delete message

Now, to save space on the device, we'll 'flush' or delete the message.

dtaget[0] == 'E' && dtaget[1] == 'X' && dtaget[2] == 'C' && dtaget[3] == 'U' && dtaget[4] == 'S' && dtaget[5] == 'E' ) )

Finally, let's do a basic logic check to make sure that the text message says 'EXCUSE'. This will make sure that we actually WANT to trigger the excuser, versus we just got some random text.

And that's it! Now let's move into how we're going to trigger that phone call to get us out of our pickle...

Step 5: Code II: Calling Us With an 'Excuse'

Now to actually get this bad boy to call us. We'll use the same library (LGSM) and turn the number that texted us (the variable p_num) and call it back after 60 seconds. This way it isn't super obvious that we just texted a number and it called us back right away.

{ Serial1.println("Call Established. Enter line to end"); // Wait for some input from the line while(Serial1.read() !='\n'); // And hang up LVoiceCall.hangCall(); } Serial1.println("Call Finished");

Step 6: Wrapping Up and Going Forward

I would recommend you keep your LinkIT ONE powered on with a nice usb cable and place it somewhere in your lab before you go out. This way, you are less likely to hit it while it is in a deadzone (like if it were in your basement) and it will always call you back.

After you deploy it though, you're all set! No more being stuck in awkward conversations ever again! Just text your LinkIT ONE the word 'EXCUSE' and get ready to make a mad dash out of there!

Hopefully this has taught you a thing or two about the LGSM library with the LinkIT ONE and a useful project to get out of sticky situations!

About This Instructable




More by jckelley:Push-Up Counter Timeout Chair LinkIT ONE Battery Tester 
Add instructable to: