No AT command return from SIM 7020G to Pololu A-Star 328PB

I'm trying to use a Pololu A-Star 328PB to control a SIM7020G NB-IOT module. I've used the SIM 7020 standalone using a Sparkfun FTDI serial to USB converter to issue AT commands to the module with success. The wiring diagram for that is as follows:

SIM 7020G -> Sparkfun FTDI
TX -> RX
RX -> TX
GND -> GND

I've moved on to try and control the SIM module with the Pololu board. I chose this specific Pololu board because the ATMEGA 328PB has 2 USART so I could have one used for serial monitor debugging and the other used for communication with the SIM module. The wiring diagram for this is as follows:

SIM 7020G -> Pololu Board
TX -> RX
RX -> TX

The Pololu board is connected/powered via the Sparkfun FTDI serial to USB converter board and in both instances described above the SIM module is powered by 2 18650 batteries.
The code I am using to try and communicate from the SIM board to the Pololu board and then output to the serial monitor is below.

void setup() {
  Serial.begin(115200);
  Serial1.begin(115200);
}

void loop() {
  Serial1.println("AT");
  Serial1.flush();
  while (!Serial1.available());
  char payload = Serial1.read();
  Serial.println(payload);
  Serial.flush();
  delay(2500);
}

The output on the serial monitor has been an odd mix of the initial "AT" command followed by some incoherence then just outputting "A", rather than the expected "OK" output that should be present when "AT" is input to the SIM module.


I bought two of the same SIM modules and have tried both of them as well as another of the same Pololu boards with this code and wiring setup with identical results. Any ideas as to why this is happening?

Hi @anon80656603,

Here is a similar problem and solution that might help.
https://forum.pololu.com/t/second-serial-on-a-star-328pb-not-working/14540/8

Hi, thank you for the response. I just checked via the boards manager which version of the Pololu boards package is installed and it is 4.0.2 which contains the USART update that 4.0.1 introduced. I've also verified that USART1 works on it's own when USART0 is not in use.

Best

You could try changing println to print and replace the while with an if loop. I’m not sure what the problem is. It’s late here, I’ll go to sleep and rethink it in the morning.

I think I got this sorted out. I posted on the Pololu forum as well and it turns out there needed to be a ground connection between the SIM module and the Pololu board. Once that was made, the SIM module began returning proper AT command responses.