Maybe it’s baud or power problems but I’m stuck. Seems like I’m getting the feedback from sim900 but uno3 can’t read it.. It shows that it gets phone call, but don’t make the call..
Usimg external 5v 3a power supply.
The serial output:
Initializing SIM900... x��x� ���� Setup complete. Waiting for incoming call... Data received: xreceived: xxx Data received: xxxx�x�x�����xxxxx�xx�x
#include <SoftwareSerial.h>
// Create a software serial port for SIM900
SoftwareSerial sim900(7,8); // RX, TX
void setup() {
// Begin serial communication for debugging
Serial.begin(9600);
// Begin serial communication with SIM900 module
sim900.begin(9600);
// Give some time for the SIM900 module to initialize
delay(1000);
sim900.println("ATZ");
sim900.println("AT+IPR=9600");
Serial.println("Initializing SIM900...");
sim900.println("AT"); // Initial AT command to check communication
// Initial AT command to check communication
delay(1000);
if (sim900.available()) {
Serial.println(sim900.readString());
}
// Set SIM900 to text mode
sim900.println("AT+CMGF=1");
delay(1000);
if (sim900.available()) {
Serial.println(sim900.readString());
}
Serial.println("Setup complete. Waiting for incoming call...");
}
void loop() {
// Check if data is available from SIM900
if (sim900.available()) {
String sim900Data = sim900.readString();
Serial.println("Data received: " + sim900Data);
// Check if there's an incoming call indication
if (sim900Data.indexOf("RING") != -1) {
Serial.println("Incoming call detected. Waiting for 3 seconds...");
delay(3000);
// Hang up the incoming call
sim900.println("ATH");
delay(1000);
if (sim900.available()) {
Serial.println(sim900.readString());
}
// Dial the number +37065891672
Serial.println("Dialing number +37065891672...");
sim900.print("ATD+37065891672;r");
delay(1000);
if (sim900.available()) {
Serial.println(sim900.readString());
}
}
}
}
enter image description here
THANKS FOR HELP IN ADVANCE!
I tried to chage Baud rate, chage wires.
user2333040 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.