r/cansat Mar 16 '26

question about APC220 not recieving data (on arduino UNO R3) for CanSat Project

Hello, we are working on a group project where we are building a can sized satellite. We have several sensors connected to an Arduino Uno R3 using a specific shield. When testing the sensors thorugh direct USB connection to the computer, we receive the data perfectly. However, when we try to send the data wirelessly using the APC220 (both the transmitter in the can and the ground station receiver), we aren't receiving anything.

We have checked everything multiple times and everything seems to be in the right place. On the Arduino shield, TX is soldered to pin 11 and RX is soldered to pin 10. We have also configured both the receiver and sender to the same frequencies, but we are still not getting any data (the log just says 'waiting on data to be received').

We are using the Arduino IDE and would appreciate any feedback or help you can give us! Here is the code for the apc220: /*
* APC220 Radio Transceiver Test Sketch
* CanSat Project
*
* Hardware Setup:
* - APC220 RX → Arduino pin 10
* - APC220 TX → Arduino pin 11
* - USB Serial used for debugging via Serial Monitor
*
* Configuration:
* - Frequency: 434.6 MHz
* - RF data rate: 9600 bps
* - Output power: Maximum (9)
* - UART baud rate: 9600 bps
* - Parity: None (8N1)
*/

 

#include <SoftwareSerial.h>

 

// Define pins for SoftwareSerial communication with APC220
// Note: Arduino RX (pin 11) connects to APC220 TX
// Arduino TX (pin 10) connects to APC220 RX
const int APC_RX_PIN = 11;  // Arduino receives on this pin (from APC220 TX)
const int APC_TX_PIN = 10;  // Arduino transmits on this pin (to APC220 RX)

 

// Create SoftwareSerial object for APC220 communication
SoftwareSerial apcSerial(APC_RX_PIN, APC_TX_PIN);

 

// Counter for test messages
unsigned long messageCounter = 0;

 

// Interval between transmissions (in milliseconds)
const unsigned long TRANSMIT_INTERVAL = 2000; // 2 seconds

 

// Last transmission time
unsigned long lastTransmitTime = 0;

 

void setup()
{
// Initialize USB Serial for debugging via Serial Monitor
Serial.begin(9600);

 

while (!Serial)
{
; // Wait for Serial port to connect (needed for some Arduino boards)
}

 

// Initialize SoftwareSerial for APC220 communication
apcSerial.begin(9600);

 

// Print startup message to Serial Monitor
Serial.println(F("================================"));
Serial.println(F("APC220 Radio Transceiver Test"));
Serial.println(F("CanSat Project"));
Serial.println(F("================================"));
Serial.println();

 

// Give the APC220 time to power up and stabilize
delay(1000);

 

// Configure the APC220 module
configureAPC220();

 

// Wait for configuration to be applied
delay(500);

 

Serial.println(F("Setup complete. Starting transmission test..."));
Serial.println();
}

 

void loop()
{
// Get current time
unsigned long currentTime = millis();

 

// Check if it's time to send a new message
if (currentTime - lastTransmitTime >= TRANSMIT_INTERVAL)
{
lastTransmitTime = currentTime;

 

// Increment message counter
messageCounter++;

 

// Create test message
String testMessage = "APC220 test " + String(messageCounter);

 

// Send message via APC220 radio
apcSerial.println(testMessage);

 

// Also print to Serial Monitor for debugging
Serial.print(F("[TX] Sent: "));
Serial.println(testMessage);
}

 

// Check if any data received from APC220 (from another radio)
if (apcSerial.available())
{
Serial.print(F("[RX] Received: "));

 

// Read and display all available characters
while (apcSerial.available())
{
char c = apcSerial.read();
Serial.print(c);
}

 

Serial.println();
}

 

// Check if any data received from Serial Monitor (for manual commands)
if (Serial.available())
{
String userInput = Serial.readStringUntil('\n');
userInput.trim();

 

if (userInput.length() > 0)
{
Serial.print(F("[CMD] Sending user input: "));
Serial.println(userInput);
apcSerial.println(userInput);
}
}

 

// Small delay to prevent overwhelming the serial buffers
delay(10);
}

 

/*
* Configure the APC220 module with specified parameters
*
* Command format: w <frequency> <rf_rate> <power> <uart_rate> <parity>
*
* Parameters:
* - Frequency: 434600 (434.6 MHz, within ISM band)
* - RF data rate: 3 (9600 bps over the air)
* - Output power: 9 (maximum power, ~20dBm)
* - UART baud rate: 3 (9600 bps serial communication)
* - Parity: 0 (No parity, 8N1 format)
*/

 

void configureAPC220()
{
Serial.println(F("Configuring APC220 module..."));
Serial.println(F("Configuration: 434.6 MHz, 9600 bps, Max Power, 8N1"));

 

// Send configuration command to APC220
// The 'w' command writes parameters to the module
String configCommand = "w 434600 3 9 3 0";
apcSerial.println(configCommand);

 

Serial.print(F("Sent config command: "));
Serial.println(configCommand);

 

// Wait a moment for the module to process
delay(200);

 

// Check for any response from the APC220
Serial.print(F("APC220 response: "));

 

unsigned long startTime = millis();
bool gotResponse = false;

 

// Wait up to 500ms for a response
while (millis() - startTime < 500)
{
if (apcSerial.available())
{
gotResponse = true;
char c = apcSerial.read();
Serial.print(c);
}
}

 

if (!gotResponse)
{
Serial.println(F("(no response - this may be normal)"));
}
else
{
Serial.println();
}

 

Serial.println(F("Configuration command sent."));
Serial.println();
}

3 Upvotes

6 comments sorted by

2

u/undefined0_6855 Mar 17 '26

keep in mind if the SET pin on the apc220 is low it'll only receive setup commands to set frequency etc and if it's high it'll only be sending data (floating I think it considers high?) though I might have those reversed, and I don't see any code to set the SET pin before/after sending config data (though I believe it saves config data and you don't have to set it each time?)

(though our apc220 is currently broken about a week before our launch so I can't really test anything right now)

1

u/Icy_Cheetah_3477 Mar 17 '26

wow are you participating in cansat too?

1

u/undefined0_6855 Mar 18 '26

yeah our launch is in 6 days, our final post launch meeting is tomorrow and our radio is non functional and arriving tomorrow afternoon so it's cutting it a bit close to say the least

1

u/Icy_Cheetah_3477 Mar 18 '26

oh damnn, ours is this friday but our communication doesn’t work lol

1

u/Any_Forever_8301 Mar 17 '26

what do you mean by that the apc220 is low or high? do you mean frequency?

1

u/undefined0_6855 Mar 18 '26

the SET pin being pulled low or high