loading

I started this build with absolutely no goal in mind. I purchased the GPRS transmitter a few months ago and have been playing with it and my Arduino ever since. One day, I was playing around with the accelerometer from my segway project, and I had an idea for a unit that would send you a text if it were moved. Once I started building it, I decided to add an LED as a way to tell if it were actually working and a touch sensor. In this Instructable, I am going to show you how to make the Ultimate Sensing Texting Unit (USTU), but the number of projects you could build with the GPRS is endless. The USTU does two simple things: detect if it is being moved or if someone is touching the button on top.

Step 1: Components

Component list:

1. Box

2. Arduino Uno

3. EFCom Pro GPRS Module

4. Analog Accelerometer (Any analog accelerometer would work, but I used this one.)

5. Touch sensor/button

6. Breadboard or PCB for little button circuit

7. An unlocked SIM card

Step 2: Installing the Components

I used a small dob of hot glue on the bottom of the components to hold them onto the cardboard.

Step 3: Wiring

Wiring for this project is very simple. I have included the schematic for the wiring. The only thing I left out was the 9v battery clip which I just soldered right on to the Arduino power terminals. I used the breadboard to build the little circuit with the resistor for the switch. (In the schematic, I have it simply displayed because attaching a wire in the middle of another is easy to draw but not to actually do.) For reference, the LED is connected to digital pin 13 because it has a built-in resistor.

Step 4: Software.

The program is designed to be compiled on Arduino 1.05 and will not compile on any older version. To insert your phone number, replace "yournumber" with your own, making sure to include the area code, and leave the '1' for a US number.

#include <SoftwareSerial.h>

const int buttonPin = 4;

SoftwareSerial mySerial(2, 3);

int buttonState = 0;

const int ledPin = 13;

void setup() {

pinMode(ledPin, OUTPUT);

pinMode(buttonPin, INPUT);

mySerial.begin(19200);

Serial.begin(9600);

delay(2000); //Wait for a second while the modem sends an "OK"

}

void loop() {

int sensorValue = analogRead(A0);

buttonState = digitalRead(buttonPin);

Serial.println(sensorValue);

if ((sensorValue > 325) && (sensorValue < 335)) {

digitalWrite(ledPin, HIGH); // turn LED on:

mySerial.print("AT+CMGF=1\r"); //Because we want to send the SMS in text mode

delay(100);

mySerial.println("AT + CMGS = \"+1yournumber\"");//send sms message, be careful need to add a country code //before the cellphone number

delay(100);

mySerial.println("Somebody touched your computer"); //the content of the message

delay(100);

mySerial.println((char)26); //the ASCII code of the ctrl+z is 26

delay(100);

}

else {

digitalWrite(ledPin, LOW); // turn LED off:

if (buttonState == HIGH) { // turn LED on:

digitalWrite(ledPin, HIGH);

mySerial.print("AT+CMGF=1\r"); //Because we want to send the SMS in text mode

delay(100);

mySerial.println("AT + CMGS = \"+1yournumber\""); //send sms message, be careful need to add a country code //before the cellphone number

delay(100);

mySerial.println("Somebody touched the box"); //the content of the message

delay(100);

mySerial.println((char)26); //the ASCII code of the ctrl+z is 26

delay(100);

}

else {

digitalWrite(ledPin, LOW); // turn LED off:

}

}

}

Step 5: Operating the USTU

Once you have uploaded the program to the Arduino, it is time to start it up.

1. Insert a SIM card into the slot on the GPRS.

2. Power up the Arduino.

3. Push the power button on the GPRS module and wait for the middle light to stop flashing as quickly. (It will slow down to approximately one flash every 3 seconds or so.)

After that, your USTU should be ready to use.

<p>This is so simple and smart!</p><p>Elegant!</p>
Thanks
<p>Do you need to pay a monthly charge for this?</p>
I just used my phones SIM card, so yes you do have to pay monthly?
Maybe I can find a way to copy my sim card just for use on this or to use some online notification because i need to use it in my phone.

About This Instructable

1,349views

11favorites

License:

More by florman:Ultimate Sensing Texting Unit How to Wire a Trailer Self Balancing Segway Instructabot 
Add instructable to: