Simple SMS

by Nikodimos Skaroulis in Circuits > Arduino

547 Views, 2 Favorites, 0 Comments

Simple SMS

IMG_20210717_200855.png
IMG_20210717_201326.jpg
SimpleSMS

Simple SMS is a persistent idea, that through a bunch of prototyping, managed to give birth to 2 different iterations.

It is designed to solve a big issue in the area that I live in, which is the lack of communication between older or disabled people with their family and friends, due to their inability to use a mobile phone.

It is a device that's really simple to use, as it consists of only 3 buttons which send a dfferent SMS message each. The messages communicate either an immediate need of assistance, a less immediate need of assistance, as well as an emergency. These SMS can be sent to any preset phone number (family doctor, relative that lives closeby, neighbour ect.).

Now time to dive into the different supplies and tools you are going to need.


Supplies



Optional


Tools


  • Screwdriver
  • Soldering Iron(I recommend this one for begginers)
  • Pliers or Cable Strippers
  • Computer (for the programming)

How Does It Actually Work?

IMG_20210717_200900.jpg

Basically the Simple SMS, with the help from an arduino nano and a GSM module, send SMS messages to a preset phone number.

The Arduino constantly checks if a button is pressed and if it detects a button being pressed, then it sends a command to the GSM module (these commands are called AT commands and you can get more information about them here).

The GSM module in turn sends the SMS message to the preset phone number.

How does the GSM module do that?

Well the GSM module is a standard cellular radio that can transmit messages through the GSM Network.

Wiring

unnamed.jpg
viveo 1.png

The wiring is pretty Simple (get it?) and can easily be understood by reading the diagrams I have provided.

Coding

The coding part of this project was by far the hardest one as a lot of improvising and research was needed (I dont actually know how to code). I tried using some of the libraries and the example schetches but I couldn't get it to work soI just cut some parts from the example schetch and used some programming knowledge that I aquired from all the research I was doing to put together a simple and pretty effective piece of code. I used an infinite loop and broke the code into 3 parts: each part basically represented the actions of each button. I then used a multiple if function and BOOM! Easy as pie right? The code I'm talking about is down bellow in the form of text but I have also attached the .ino file so you can download it and use it as is!


#include <SoftwareSerial.h>
SoftwareSerial mySerial(9,10);
char msg;
int buttonred=5;
int buttonblue=7;
int buttongreen=6;
void setup()
{
pinMode(buttonred,INPUT);
pinMode(buttonblue,INPUT);
pinMode(buttongreen,INPUT);
mySerial.begin(9600); // Setting the baud rate of GSM Module
Serial.begin(9600);// Setting the baud rate of Serial Monitor (Arduino)
Serial.println("press button"); // Skip this if you want to it doesn't really matter
}

void loop()
{
if(digitalRead(buttonred)==HIGH){

Serial.println("button red pressed");
delay(1000);
SendMessagered();
}
if(digitalRead(buttonblue)==HIGH){
Serial.println("button blue pressed");
delay(1000);
SendMessageblue();
}
if(digitalRead(buttongreen)==HIGH){
Serial.println("button green pressed");
delay(1000);
SendMessagegreen();


}
if (mySerial.available()>0)
Serial.write(mySerial.read());
}

void SendMessagered()//
{
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second

mySerial.println("AT+CMGS=\"+30xxxxxxxxxx\"\r"); // Replace x with mobile number and the +30 with whatever you have as the code where you live in
delay(1000);

mySerial.println("EMERGENCY!!!");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
}

void SendMessageblue()
{
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second

mySerial.println("AT+CMGS=\"+30xxxxxxxxxx\"\r"); // Replace x with mobile number and the +30 with whatever you have as the code where you live in
delay(1000);

mySerial.println("I need to see you");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
}

void SendMessagegreen()
{
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second

mySerial.println("AT+CMGS=\"+30xxxxxxxxxx\"\r"); // Replace x with mobile number and the +30 with whatever you have as the code where you live in
delay(1000);

mySerial.println("I have to see you now!");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
}

Downloads

Soldering

VID_20210622_201734_Moment.jpg
VID_20210622_201734_Moment2.jpg

This is again a pretty straight-forward step. You have to repeat the wiring proccess, only this time using regural wires (not jumper wires) and solder to put everything together, semi-permenantly, in the form of a diy pcb (using the perfboard).

Make sure the pcb that you create is small enough to fit in your container and big enough so that it does not shake too much. Shaking can produce other types of problems like scratching and producing annoying sounds (and we don't want that). Above you can see some pictures of the soldering I did (trust me you can do much better if you're more patient than I was).

Making Your Container Suitable for Your Project

IMG_20210717_203957.jpg
IMG_20210717_204011.jpg
IMG_20210717_203927.jpg
IMG_20210717_203941.jpg

This step is not really something I can teach you step-by-step, as each container needs different things to be added or removed. I, fro example, used a correction tape container I bought from a local bookstore and just poked some holes in it and put some hinges on the side. I, then, covered the important parts with masking tape and spray painted it black. After that, I put the buttons in place and the body of the Simple SMS was created.

Put Everything Together and Show Off Your Device!!

83bd37fe1bb51a53b2b60b9e8a2533d5 (1).jpg

Now all you need to do ia assemble the 2 parts of the project (the DIY pcb you made and the box you customised) and be proud of yourself cause you just put the finishing touches to your own Simple SMS device!

I hope this tutorial helped every single one of you! I explained everything in as much detail as I could and you can always ask any questions ,that you may have, in the comments down below.

Until the next project...

SEE YAAA!