Go Down

Topic: Sending SMS using Nokia 5110 (Read 2060 times) previous topic - next topic

ElProblemo

Can someone spare some time to help this complete noooooob?

I have an Uno and Nokia 5110.  After some reading through the forums I've found some details in relation to sending SMS data from the Arduino using the 5110, but nothing that makes a great deal of sense.. What I have done is soldered up in preparation a cable for the 5110 from TX/RX & GND, I think I'll need that.

Question is how?  Looked for example code but again without a little guidance and a question here and there it may as well be written in Chinese+ let alone C+  :smiley-mr-green:

For a start I'm looking at sending the same string of data to one number, but eventually I'll be looking for data from GPS to be sent out to phone, perhaps to two seperate numbers.

I know I'm asking a lot but everyone has to learn somehow..

Thanks guys!
Complete Newbie...
But remember nobody knows everything!!!

PaulS

Quote
Looked for example code but again without a little guidance and a question here and there it may as well be written in Chinese+ let alone C+

Chinese++ maybe. There is no such language as C+.

What example code did you look at? What does not make sense? Have you read the AT command documentation for your phone?

ElProblemo


Quote
Looked for example code but again without a little guidance and a question here and there it may as well be written in Chinese+ let alone C+

Chinese++ maybe. There is no such language as C+.


My attempt and sarcasim.. Sorry



What example code did you look at? What does not make sense? Have you read the AT command documentation for your phone?


I've found the command set via the Nokia Developer site..

http://www.developer.nokia.com/Community/Wiki/AT_Commands

Found a couple of sites with some potentially useful code

This one is based on a PIR being activated, I thought this would give me a starter.
Code: [Select]
// Declare Constants
const int sensorPin = 2; // PIR Sensor is attached to digital pin 2
const int ledPin = 13; // Built-in LED
const int ledBlinkTime = 500; // Blink one for half a second while calibrating

// Wait for the seonsor to calibrate (20 - 60 seconds according to datasheet)
// 60 Seconds in milliseconds
const unsigned int calibrationTime = 60000;

void setup() {
 Serial.begin(115200);
 
 pinMode(sensorPin, INPUT);
 pinMode(ledPin, OUTPUT);
 
 // We need to wait one minute for the sensor to calibrate
 // Get out of view of the sensor for this duration!
 
 // Blink the LED while calibrating
 for (unsigned int i=0; i<calibrationTime; i+=ledBlinkTime*2) {
   digitalWrite(ledPin, HIGH);
   delay(ledBlinkTime);
   digitalWrite(ledPin, LOW);
   delay(ledBlinkTime);
 }
}

void loop() {
 // Constantly check the state of pin 2
 // If it is HIGH the sensor is detecting motion
 if (digitalRead(sensorPin) == HIGH) {
   // Turn the LED on
   digitalWrite(ledPin, HIGH);
   
   // Tell the host computer we detected motion
   Serial.print(1);
   
   // Sleep for a second to prevent flooding the serial
   delay(1000);
 } else {
   // Turn the LED off
   digitalWrite(ledPin, LOW);
 }
}



This one suggests a link from GPS to the SMS message, Then there is talk of PDU formatting... .... ... Sorry if it's dumb

Code: [Select]
/*
* Sending SMS using the Arduino GPRS module
* Copyright (c) 2009 Cool Components Ltd
* http://www.coolcomponents.co.uk
*/
int ModuleOnPin = 2; // the pin to switch the module on (without having to press the button)
void setup()
{
pinMode(led, OUTPUT);
pinMode(ModuleOnPin, OUTPUT);
Serial.begin(115200); // the GPRS baud rate
digitalWrite(ModuleOnPin,HIGH); // swith the module ON
delay(2000);
digitalWrite(ModuleOnPin,LOW);
for (int i=0;i<5;i++) //Assuming SIM card in + there is no pin#, wait 25 secs for module to connect to network
{delay(5000);}
Serial.println("AT+CMGF=1?); // set the SMS mode to text
}
void loop()
{
Serial.print("AT+CMGS="); // send the SMS the number
Serial.print(34,BYTE); // send the " char
Serial.print("07941123456?); // send the destination phone number
Serial.println(34,BYTE); // send the " char
delay(1500);
Serial.print("Hello World……."); // the SMS body
delay(500);
Serial.println(0x1A,BYTE); // end of message command 1A (hex)
delay(5000);
Serial.println("AT*PSCPOF"); // switch the module off
while(1) {} // Loop forever
}


Thanks

Complete Newbie...
But remember nobody knows everything!!!

PaulS

Quote
This one suggests a link from GPS to the SMS message

It apparently is only the mildest of suggestions. I don't see any use of a GPS anywhere in that code.

HansSW

Did you work this out?

I have a Nokia 5110 that I would much like to control with the Arduino.  To send basic SMS would give a start.

Can anyone help with code please?

Thanks

Go Up