Hi to everybody, i want to be able to call a number and speak each other without any problem (just like calling the number from my mobile phone) , the only differance is that i will be staying about 1m-1.5m from the speaker and i should be able to hear normal from the arduino`s speaker.
So i will need:
1.Arduino uno rev3
2.Arduino GSM shield right
right?
my questions are
1. Can i make a call with a single click of a button? If the answer is yes, is this button built in or i have to do it myself (where i should solder 2 wires of the button)
2. How big speaker can i solder to the system ? Can i solder something like this (http://upload.wikimedia.org/wikipedia/commons/thumb/0/0a/3.5_Inch_Speaker.jpg/800px-3.5_Inch_Speaker.jpg)
and also how many Watts can the speaker be?
3.Do i need to have any other board(s) accessoaries or parts to make this work?
Thanks!
Hi,
You can make a call pushing down a button writing a function in your sketch. This function checks button status and, if it pressed, do something like this:
Using this code, you can finish the call by pressing enter in the serial monitor (with new line option selected).
char remoteNumber[21] = "+12345678910"; // Telephone number
// let the user know you're calling:
Serial.print("Calling to : ");
Serial.println(remoteNumber);
Serial.println();
// Check if the receiving end has picked up the call
if(vcs.voiceCall(remoteNumber))
{
Serial.println("Call Established. Enter line to end");
// Wait for some input from the line
while(Serial.read()!='\n' && (vcs.getvoiceCallStatus()==TALKING));
// And hang up
vcs.hangCall();
}
Serial.println("Call Finished");
To connect a speaker to the GSM shield, you can read this tutorial to learn how to connect the hardware: http://arduino.cc/en/Guide/ArduinoGSMShield#toc11 (http://arduino.cc/en/Guide/ArduinoGSMShield#toc11)
Greetings.
Thanks for your reply. But how i will set up exactly wich button to be listened and by pressing it, this function to be executed?
Does this shield has several different buttons pins so i can solder couple of buttons and setup different functions to them?
How can i define in my program/function for example if it was php
function b1()
{
$my_number='00359888888';
if($button1_status=='pressed')
{
lets_call_my_number();
}
if ($button2_status=='pressed')
{
send_sms_to_my_number();
}
}
i hope you can understand my idea, i am not a professional in c or c++ but like in php this gives a simple view of my idea
Thanks
call
}
any examples where to solder a button for voice calling ?
Please i need to do this ->http://www.youtube.com/watch?v=zTCXtRiVk9Y
what is the wiring diagram of the button and also how can i tell to call a given number by pressing the button
any tutorials?
Hello:
You need to use the Arduino to control the button. See here:
http://arduino.cc/en/Tutorial/Button
but use pin number 2.
Remember that the shield pins are connected to the Arduino pins except pins 2, 3 and 7.
You have to merge both sketches (button example and SMS example). This should run:
// libraries
#include <GSM.h>
#define PINNUMBER ""
// initialize the library instance
GSM gsmAccess; // include a 'true' parameter for debug enabled
GSM_SMS sms;
// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 6; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup()
{
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
// initialize serial communications
Serial.begin(9600);
Serial.println("SMS Messages Sender");
// connection state
boolean notConnected = true;
// Start GSM shield
// If your SIM has PIN, pass it as a parameter of begin() in quotes
while(notConnected)
{
if(gsmAccess.begin(PINNUMBER)==GSM_READY)
notConnected = false;
else
{
Serial.println("Not connected");
delay(1000);
}
}
Serial.println("GSM initialized");
}
void loop()
{
Serial.print("Enter a mobile number: ");
char remoteNumber[20]; // telephone number to send sms
readSerial(remoteNumber);
Serial.println(remoteNumber);
// sms text
Serial.print("Now, enter SMS content: ");
char txtMsg[200];
readSerial(txtMsg);
Serial.println("SENDING");
Serial.println();
Serial.println("Message:");
Serial.println(txtMsg);
// send the message
sms.beginSMS(remoteNumber);
sms.print(txtMsg);
sms.endSMS();
Serial.println("\nCOMPLETE!\n");
}
/*
Read input serial
*/
int readSerial(char result[])
{
int i = 0;
while(1)
{
while (Serial.available() > 0)
{
char inChar = Serial.read();
if (inChar == '\n')
{
result = '\0';
Serial.flush();
return 0;
}
if(inChar!='\r')
{
result = inChar;
i++;
}
}
}
}
You have to use the Arduino to control the button.
See this page for button control, but use pin 6 instead of 2.
http://arduino.cc/en/Tutorial/Button
Remember shield pins are connected to Arduino pins (except 2,3 and 7), so you can connect to the shield +GND, 5V and pin 6.
Now you have to merge both examples: sendSMS and button. This sketch should run, please check it:
// libraries
#include <GSM.h>
#define PINNUMBER ""
// initialize the library instance
GSM gsmAccess; // include a 'true' parameter for debug enabled
GSM_SMS sms;
// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 6; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup()
{
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
// initialize serial communications
Serial.begin(9600);
Serial.println("SMS Messages Sender");
// connection state
boolean notConnected = true;
// Start GSM shield
// If your SIM has PIN, pass it as a parameter of begin() in quotes
while(notConnected)
{
if(gsmAccess.begin(PINNUMBER)==GSM_READY)
notConnected = false;
else
{
Serial.println("Not connected");
delay(1000);
}
}
Serial.println("GSM initialized");
}
void loop()
{
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
// send the message
sms.beginSMS("+123456789");
sms.print("Hi!");
sms.endSMS();
Serial.println("\nCOMPLETE!\n");
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}
thank you, but i just need it to make a voice call instead of sending sms , how i shoud connect 2 pin button to the 3 pin as you said (GND, PIN6, 5V) ??
HI,
I've been working with the GMS shield for a couple weeks now, but i'm at the point in need to set up voice calling. I don't believe i have a software issue, but just a hardware issue. When i establish a call, my speaker is unclear and crackly. I'm just trying to use the speaker and mic setup from the GSM tutorial guide.
In the picture i attached there are two parts circled in red. I assumed they were some zener diode. Can any specify exactly what these are suppose to be? If they are some kind of diode, what rating should it be? also, do i need anything for the "differential layout"? I think these are my problems. Thanks.