Here is the code and connections
Arduino >> Sim900a
Pin 10 >> 5VR
pin 9 >> 5VT
GND >> GND
Also, I've used a 4.5V battery for the power supply of the sim900a
#include <SoftwareSerial.h>
SoftwareSerial SIM900A(9, 10);
// Connect the SIM900A TX to Arduino pin 9 RX.
// Connect the SIM900A RX to Arduino pin 10 TX.
char c = ' ';
void setup()
{
// start th serial communication with the host computer
Serial.begin(9600);
while (!Serial);
Serial.println("Arduino with SIM900A is ready");
// start communication with the SIM900A in 9600
SIM900A.begin(9600);
Serial.println("SIM900A started at 9600");
delay(1000);
Serial.println("Setup Complete! SIM900A is Ready!");
}
void loop()
{
// Keep reading from SIM900 and send to Arduino Serial Monitor
if (SIM900A.available())
{ c = SIM900A.read();
Serial.write(c);
}
// Keep reading from Arduino Serial Monitor and send to SIM900A
if (Serial.available())
{ c = Serial.read();
SIM900A.write(c);
}
}
A common reason for seeing unreadable garbage when doing serial comms is that the sender and the receiver are configured differently. For example perhaps the SIM900 is sending at 4800 baud but the receiving Uno has 9600.
What are the defaults for the SIM900 and is there a method to reset it to those defaults?
The default baud rate for sim900a is 9600bps and yes, there is a method to reset those defaults but to set it the sim900a must response first to the arduino