How to use SIM900A with Arduino R3?

Hey, I am making a vehicle accident system, in which I am using Arduino R3, SIM900A GSM Module. I have done everything in my project, but still my SIM900A is not sending SMS to the desired number. The SIM900A is connected to the network (the LED light around the antenna is blinking slowly), but still it is not sending any SMS. I tried my code and ChatGPT's code too, but still nothing seems to work, and also the SIM900A is not responding to AT commands. What should I know as I have already replaced my SIM900A with a new one but still no response from SIM900A as of now? The most shocking part the module is connected to network and when I ring the sim the ring goes and the sim is not switched off but still the sim900a is not responsing on the serial monitor. Please help me and tell me whats wrong with my code.

Code -

#include <SoftwareSerial.h>

SoftwareSerial sim900a(8, 9); // RX, TX

void setup() {
  Serial.begin(9600);
  sim900a.begin(9600);
  delay(1000);

  Serial.println("Type your AT commands:");
}

void loop() {
  if (Serial.available()) {
    while (Serial.available()) {
      sim900a.write(Serial.read());
    }
  }

  if (sim900a.available()) {
    while (sim900a.available()) {
      Serial.write(sim900a.read());
    }
  }
}

That’s priority #1 to solve
Put all the complex code away and focus on getting that to work.

Explain how you wired things on your UNO R3 and how the module is powered.

A hand drawing of the circuit would be great

It's a very simple connection I have done:-
(from SIM900A) VCC - 5v (on Arduino)
(from SIM900A) GND - GND (on Arduino)
(from SIM900A) RX - 8 (on Arduino)
(from SIM900A) TX - 9 (on Arduino)

I am powering the module with the help of the Arduino Cable itself as of now (USB 3.0 on my pc) otherwise I will be using a 5V adapter but as of now for coding and seeing if it works I will be using USB ig.

PS:- Thank you so much for replying

It looks like you have these connections the wrong way round

Pin 8 on the Arduino is Rx and pin 9 is Tx in your code

Also

Although it seems fine as the module connects and rings - This might not provide enough current to your module - which one is it and what are the requirements and how do you power the Arduino (if through USB quoi only have 500mA to play with).

So, what power supply I should use? 9V battery maybe?

Not if it is a PP3 that you have in mind

I will be buying a duracell 9V battery. (Just for the SIM900A otherwise gps and etc. are working just fiine with arduino power supply)

Is it a PP3 like this ?

those are even worse than using the 5V pin from your arduino. They are good for smoke detector but can't provide high current for a long time. Also your module does not need 9V, it probably needs 5V...

I tried finding it in my area but it was not available so I am planing on using just a normal 9v

should I use a 9v adapter to Adruino. Adruino can power up sim900a then?
But I don't think there is a power supply issue cause the module is connected to network and sim is accepting calls (bell is ringing) but the main problem is the module is not responsing in serial monitor

which sim900a module do you have ? what current does it need.

As it seems you have enough current for the time being, focus on fixing the AT issue.

Don't use a PP3 battery of any kind

its a 2g gsm module, and it needs 4.2-5v power.

that's voltage, not power.

The SIM900A GSM module has an operating voltage of 3.4V – 4.5V indeed but it draws high current — up to 2A when transmitting data — so I would advise using a good quality power supply with capacity of 2.5A for example. Don't forget to join the GNDs with the Arduino.

Okay, thank you so much

Hey,
I added a new code and everything seems to working fine, the module is responding when message is beint recieved but not sending messages and showing question mark.... is it something with my module or baud rate or anything else?

I suspect wiring is not good. Verify connections are solid.

I have checked the connections atleast 10 times now. Changes wires even atleast 5 times. I don't what's the problem now. I am fed up lol