Skip to content

Radio Shield 2

Radio Shield 2 with pin headers

The Radio Shield 2 is an add-on for the Arduino development board that provides AX.25 packet radio send and receive capability, a prototyping area, and an HD44780-compatible LCD interface.

Packets are sent and received in AX.25 UI frames at 1200 baud. This allows operation on the VHF APRS network.

The Radio Shield 2 replaces the original Radio Shield and comes pre-assembled, except for the pin headers that connect it to the Arduino. The interface is unchanged. Further documentation will be posted soon.

Assembly

Radio Shield Schematic

  1. Solder on Arduino side pin headers
  2. Solder on data cable paying attention to the pinout for your particular radio
  3. Program Arduino with sample code from below, connect radio and insert shield to Arduino.

Radio Interfacing

Four interface lines are provided at one edge of the board for connecting a radio:

Pin Function
GND Ground
TX Transmit audio (radio mic)
RX Receive audio (radio speaker)
PTT Push-to-talk (active low)

Usage

Remove the entire shield when programming the Arduino board.

All serial communication with the Radio Shield is at 4800 baud. Use Serial.begin(4800); to achieve this.

Configuration parameters are stored in flash memory, therefore only need to be called once (i.e. in setup()).

All commands start with a single character and end with a CR/LF.

LCD Commands

Command LCD Function
W Write to LCD
G Go to LCD line (0 or 1) and column
C LCD clear
H LCD home
B LCD contrast, 0–1023

Note that pin 16 of the LCD interface does not connect to any other circuitry on the PCB. Some LCD panels may require this pin to be connected to ground. If your display's backlight does not turn on when power is supplied to the Arduino and RadioShield, you may need to ground this pin — check your LCD's datasheet to be sure.

Radio Commands

Command Function
! Send plain text packet
@ Send Morse code text
M Set my callsign (returns 1 for success)
S Status. Returns 1
V Reports version (added in firmware v1.1)
L<0-255> Set TX audio level
D<0-255> Set TX delay (1/120 sec intervals)
P Set AX.25 path (e.g., WIDE1-1,WIDE2-1)

Received Packet Format

Received packets are output with source and destination call, followed by packet contents and CR/LF. Example:

N1VG-14>APOTW1:!3455.15N/12026.29W_301/005g009t067P000h36b10187OTW1

Sample Applications

LCD Counter

int counter = 0;

void setup()
{
  Serial.begin(4800);
  delay(3);
}

void loop()
{
  Serial.print("C\r\n");
  delay(10);
  Serial.print("WCount: ");
  Serial.print(counter);
  Serial.print("\r\n");
  delay(8000);
  counter++;
}

Display Incoming Packets

char inbyte = 0;
char buf[260];
int buflen = 0;

void setup()
{
  Serial.begin(4800);
  delay(3);
  Serial.println("B100");
  Serial.println("C");
  delay(10);
  Serial.println("WWaiting");
}

void loop()
{
  while (Serial.available() > 0)
  {
    inbyte = Serial.read();
    if (inbyte == '\n')
    {
      Serial.println("C");
      delay(10);
      Serial.print("W");
      Serial.println(buf);
      buflen = 0;
    }
    else if (inbyte > 31 && buflen < 260)
    {
      buf[buflen++] = inbyte;
      buf[buflen] = 0;
    }
  }
}

Transmit Packets

int counter = 1;

void setup()
{
  Serial.begin(4800);
  delay(3);
  Serial.print("MW1AW\r\n");
  delay(10);
  Serial.print("PWIDE1-1,WIDE2-1\r\n");
  delay(10);
}

void loop()
{
  Serial.print("!>This is RadioShield test message #");
  Serial.print(counter);
  Serial.print("\r\n");
  counter++;
  delay(30000);
}

Note: The delay() is not from the end of the APRS packet but from the time the transmit command is issued.

Revision History

  • Firmware revision 1.1 (4/23/2013): Fixed buffer overrun bug in P command; added V command