Hi,
I am trying to interface a SIM 300 Development board with Arduino Mega.
This is the development board I am using. You can see the schematic and other relevant documents there.
http://www.ebay.com/itm/Arduino-GPRS-GSM-SIM300-Module-Development-Board-Ver2-/270804700519?pt=LH_DefaultDomain_0&hash=item3f0d37cd67
As the first step I validated the AT commands I am going to use using putty (a serial emulator). I connected the modem through a USB port using a USB to TTL converter.
I connected Rx--Rx, Tx--Tx, GND--GND and and I could successfully execute AT commands. That means I have set the jumper settings on the module correctly so that the device can successfully communicate using TTL.
Now I want to replace the PC with my Arduino mega. I wanted to use Serial1 in my Mega and keep Serial to communicate with terminal emulator.
So I used PIN 18 (Tx1) and PIN 19(Rx1) of My arduino with SIM 300 as Tx1--Tx, Rx1--Rx and Gnd--Gnd.
Then I used Arduino's MultiSerialMega sample code with little modification.
void setup() {
// initialize both serial ports:
Serial.begin(9600);
Serial1.begin(9600);
Delay(2000);
Serial1.write("AT");
}
void loop() {
// read from port 1, send to port 0:
if (Serial1.available()) {
int inByte = Serial1.read();
Serial.write(inByte);
}
}
The modem should Ideally response as OK and I should see that in my console. But in this case I see nothing on the console.
My questions are,
- Have I connected my arduino with modem correctly or am I doing anything incorrect?
- Is my code logically correct? (I believe it is correct.
) or am I doing anything incorrect?
- If the answer is yes for above two, how can I troubleshoot this?