In this assigment I used the Fabduino PCB Board, designed in past assignments. Two PCB boards will be connected and communicate themself through RF signal.
I used two UHF RF modules at 433 MHz , for transmmiting and receiving data.
Frequency Range: 433.92 MHz
Modulation: ASK
Input Voltage: 5V
Price: $1 to $2
Frequency Range: 433.92MHz
Input Voltage: 3-12V
Price: $1 to $2
Xiao RP2040 PCB Board
01 RF Module 433 MHz Transmitter
01 RF Module 433 MHz Receiver
Jumpers
So, I made the next circuit to test the RF link.
I connectd the TX to pin D2, and the RX to pin D3.
Tx circuit
Rx Circuit
In the programming IDE we must select the board Seeed XIAO RP2040 through a USB Serial port.
Select the correct COM port
Amplitude-shift keying (ASK) is a form of amplitude modulation that represents digital data as variations in the amplitude of a carrier wave. In an ASK system, a symbol, representing one or more bits, is sent by transmitting a fixed-amplitude carrier wave at a fixed frequency for a specific time duration. For example, if each symbol represents a single bit, then the carrier signal could be transmitted at nominal amplitude when the input value is 1, but transmitted at reduced amplitude or not at all when the input value is 0.
Any digital modulation scheme uses a finite number of distinct signals to represent digital data. ASK uses a finite number of amplitudes, each assigned a unique pattern of binary digits. Usually, each amplitude encodes an equal number of bits. Each pattern of bits forms the symbol that is represented by the particular amplitude. The demodulator, which is designed specifically for the symbol-set used by the modulator, determines the amplitude of the received signal and maps it back to the symbol it represents, thus recovering the original data. Frequency and phase of the carrier are kept constant.
I used TinyRF-v1.7 library to test this circuit.
#include <RH_ASK.h>
#include <SPI.h> // Not actually used but needed to compile
RH_ASK driver;
void setup()
{
Serial.begin(9600); // Debugging only
if (!driver.init())
Serial.println("init failed");
}
void loop()
{
const char *msg = "Fab Academy!";
driver.send((uint8_t *)msg, strlen(msg));
driver.waitPacketSent();
delay(1000);
}
#include <RH_ASK.h>
#include <SPI.h> // Not actualy used but needed to compile
RH_ASK driver;
void setup()
{
Serial.begin(9600); // Debugging only
if (!driver.init())
Serial.println("init failed");
}
void loop()
{
uint8_t buf[12];
uint8_t buflen = sizeof(buf);
if (driver.recv(buf, &buflen)) // Non-blocking
{
int i;
// Message with a good checksum received, dump it.
Serial.print("Message: ");
Serial.println((char*)buf);
}
}
Code for transmitter PC board
Connecting the RF transmitter to PCB Board
Transmitter side sending the message to receiver
Connecting receiver RF module to the PCB Board
Serial Monitor showing the data received (message)
Library TinyRF-v1.7 es here
created with
Website Builder .