Arduino Zero with SaraR4 NB-IoT Shield (Communication Device)

This README provides instructions for setting up and using the Arduino Zero with the SaraR4 NB-IoT Shield. This guide assumes that you have the necessary dependencies installed, including Git, the Arduino IDE, VSCode, Python, and Bash.


  • Git
  • Repository
  • Arduino IDE
  • VSCode
  • Python
  • Bash
  • Arduino CLi (


  • Arduino Zero
  • SaraR4 NB-IoT Shield

Setup Steps

  1. Clone the Repository:
    git clone ``
  2. Install Arduino CLI:
    Refrence: Official Arduino CLI Installation Docuemnt

  3. Update Arduino Core:
    arduino-cli core update-index --additional-urls
  4. Connect Arduino Zero and SaraR4 NB-IoT Shield:
    Ensure that the shield is mounted on top of the Arduino Zero, and HardwareSerial serial1 is used for communication.

  5. Setup NB-IoT Shield:
    • Set switches on the shield to HardwareSerial and ArduinoPower.
    • Connect your laptop to the Arduino Zero via the programmer’s port.
    • Open a serial monitor in the IDE with “Both NL & CR” and baudrate 115200.
    • Run the following Arduino sketches:
      • zero/setup/register_operator/register_operator.ino
      • zero/setup/serial_passthrough/serial_passthrough.ino
  6. Setup Shield Certificates:
    • Navigate to AWS IoT: AWS IoT → Manage → All devices → Things
    • If the thing already exists, create a new certificate and download all the generated certificates. Otherwise, go to Create Thing and create a new thing.
    • For Configure device certificate, choose Auto-generate a new certificate (recommended)
    • Download the certificates and keys, move them to the zero/setup/certificates folder, and rename as follows:
      • Device certificate: certificate.pem.crt
      • Public key file: public.pem.key
      • Private key file: private.pem.key
      • AmazonRootCA1.pem
      • AmazonRootCA3.pem
    • setup Virtual Environment:
      • Open a terminal window
      • cd zero/setup/certificates
      • Depending on how your python executable is set up, run one of the following commands:
            python -m venv venv


            python3 -m venv venv


            python3.11 -m venv venv
      • Activate virtual environment

        For macOS and Linux:

            source venv/bin/activate
      • Install dependecies:
            pip install -r requirements.txt
    • Close Arduino IDE before you run this command:
          python --port [port number of Arduino] --cert-dir [directory to your certificates]


          python --port /dev/ttyACM0
  7. Upload Code:
    • Please use git bash for this.
    • cd zero/
    •     chmod +x
    • For help:
          ./ -h
    • To install core, burn bootloader, compile and upload code:
          ./ -i -b -c -u PORT=[Arduino port]


          ./ -i -b -c -u PORT="dev/ttyACM0"

Now your Arduino Zero with SaraR4 NB-IoT Shield is set up and ready for NB-IoT communication.