Go Down

Topic: error connecting arduino with the Sony Ericsson K700 (Read 3 times) previous topic - next topic

dodokoke

I have a problem connecting with the Sony Ericsson K700 arduino.
I first connect the K700 to the computer and use the hyper terminal no problem I can perform such commands with the AT command.
then i try to connect arduino with serial Software to K700 and upload multple serial test. to test connection

#include <SoftwareSerial.h>

SoftwareSerial gsm(2, 3); // RX, TX

void setup() 
{
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }


  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  gsm.begin(9600);
  gsm.println("Hello, world?");
}

void loop() // run over and over
{
  if (gsm.available())
    Serial.write(gsm.read());
  if (Serial.available())
    gsm.write(Serial.read());
}


problems can't connect k700 to the arduino, as shown below


i try to send AT command  and no respon, error

this my connection arduino with k700




for connection i use same like this tread http://arduino.cc/forum/index.php/topic,52794.0.html
Phone Tx (Transmit -pin5) connect to Arduino Rx (Receive);
Phone Rx (pin4) connect with Arduino Tx;
ground Arduino connect to ground of the phone(pin10).

It woks like this but it is probably better to use a voltage divider or resistor to lower the voltage from Arduino's Tx to around 3V. I use 2kOhm resistor between Arduino Tx and phone Rx and it works fine for K700i.

what any setting at phone k700 ?
please help me


power7net

#2
Jan 23, 2013, 09:16 am Last Edit: Jan 23, 2013, 09:37 am by antkan Reason: 1
Try use simple serial(0,1 pins) use the sketch from my site power7.net and test it...Tx,Rx test opposite...i think not need resistor...I don't know if gsm library suport cellphones...convert my code...for simply test AT OK...reply me if you solve your problem!You send AT from your sketch?
Web / sms / bluetooth / arduino / android remote control. Home Automation projects.
http://www.power7.net

dodokoke

Dear Antkan,

sorry can replay now, acces internet in my home problem.

i can now connect to sonny ericsson K700,
step,
i no use resistor try and in my program for Ctrl + z , i can't use At command Serial.write(26);//Ctrl-z but i use  Serial.write(0x1A); //Ctrl-z CTRL-Z and now i can send sms via K700

Thanks Mr. Antkan

But i now have new problem,
i try sketch below,

#include <SoftwareSerial.h>

SoftwareSerial phone(2,3);       // phone connected to pins 2,3

const int ledPin = 13;           // LED on pin 13
String input;                    // phones response is saved into this string
int state = 0;                   // current state of the LED

void setup ()
{
  // Serial connection
  Serial.begin(9600);
  Serial.println("Arduino connected.");
  delay(200);

  // phone connection
  phone.begin(9600);
  Serial.println("Ericsson T610 connected.");
  delay(500);
 
  // LED pin init
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, LOW);

  // phone init
  Serial.println("Start of phone init...");
  phone.println("AT+CPMS=\"ME\",\"ME\",\"ME\"");   // phone memory used for SMS storage
  delay(2000);
  phone.println("AT+CNMI=2,3,0,0,0");              // forward all received stuff into terminal window
  delay(2000);
  phone.flush();
  Serial.println("End of init. Waiting for command SMS...\n");
}

void loop ()

  while (phone.available() == 0);         // waiting for phones response 

  while (phone.available() > 0)           // read incoming data from phone and save it into input string
  {
    char aChar = phone.read();
    input += aChar;
  }

  // phones (partial) response displayed in serial window
  Serial.println(input);

  // "decoding" received SMS
  int index1 = input.indexOf("CC2211");
  int index2 = input.length() - 2;
 
  // if received SMS "LED ON" turn on LED
  if (input.substring(index1,index2) == "CC2211F47402")
  {
    digitalWrite(ledPin, HIGH);
    state = 1;
  }
 
  // if received SMS "LED OFF" turn off LED
  else if (input.substring(index1,index2) == "CC2211F4341A01")
  {
    digitalWrite(ledPin, LOW);
    state = 0;
  }
 
  input = "";                                 // reset input string
}


when the K700 recive sms "LED ON" the ledPin = 13 not HIGH,
please help me

power7net

You must put some delay after digitalWrite(high,13).....delay(3000) else led on only for 1 msec and you can't see anything....
Web / sms / bluetooth / arduino / android remote control. Home Automation projects.
http://www.power7.net

Go Up