How to use RF Module (AM Radio) ?

RF Module

Introduction

Radio waves refer to a form of electromagnetic radiation that have wavelengths that are longer than those of infrared light, yet shorter than those of microwaves. They are created by oscillating magnetic and electric fields, and have the capability to pass through air, space, and certain materials. Radio waves are widely used for various communication purposes, such as in television and radio broadcasting, wireless networks, cellular phones, and satellite communication. Radio waves typically cover a frequency range of 3 kHz to 300 GHz, with lower frequencies corresponding to longer wavelengths, and higher frequencies corresponding to shorter wavelengths.

What is Modulation

Modulation refers to the technique of modifying certain characteristics of a periodic waveform called the carrier signal in order to convey information. By changing the amplitude, frequency, or phase of the carrier signal in response to the modulating signal, which carries the desired information, modulation makes it possible to transmit the modulated signal over a communication channel that is optimized for the transmission of the unmodulated carrier signal.

What is AM Modulation

Amplitude Modulation (AM) is a technique that allows information to be transmitted through radio waves by modifying the amplitude of the carrier wave. For example, in AM radio broadcasting, a high-frequency carrier signal is modified in proportion to the instantaneous amplitude of the modulating signal (baseband signal) that contains the audio information to be transmitted. As a result, the amplitude of the carrier wave varies in time with the amplitude of the modulating signal, allowing the audio information to be transmitted over long distances.

While AM is widely used in radio broadcasting due to its simplicity and cost-effectiveness, it has some limitations in terms of signal quality and susceptibility to noise and interference. For instance, changes in the amplitude of the carrier signal can be affected by changes in the signal-to-noise ratio, leading to distortion and reduced signal quality. Therefore, other modulation techniques such as frequency modulation (FM) and digital modulation have largely replaced AM in modern communication systems.

AM Radio

An AM radio is a device that receives radio signals transmitted using amplitude modulation (AM) technology. It is composed of two main components: a encoder and a demodulator. The tuner selects the desired frequency from the available range of frequencies, and the demodulator separates the audio signal from the carrier signal. The audio signal is then amplified and sent to a speaker for listening.

AM Radio

Tuner and demodulator

The tuner is an essential element of a radio receiver that performs the task of selecting a particular radio frequency and filtering out other frequencies. Its main function is to adjust the resonant frequency of a tuned circuit to match the frequency of the desired radio station. Additionally, it may also amplify the radio signal before sending it to the demodulator.

A demodulator is a vital component of a radio receiver that retrieves the original information signal from the modulated carrier signal. In the case of AM radio, the demodulator's role is to distinguish changes in the amplitude of the radio signal and extract the audio signal from the carrier wave. The amplified audio signal is then forwarded to the speaker or headphones. In contrast, for FM radio, the demodulator distinguishes changes in the frequency of the radio signal to extract the audio signal.

Encoding

Encoding is a crucial process in digital systems that involves converting information from one form to another, to make it easier to store, transmit, or interpret by electronic devices like computers. In the context of computing, encoding refers to representing characters, symbols, or data in a standardized format that can be read and processed by a computer. Common encoding techniques include ASCII, Unicode, and binary encoding. The importance of encoding cannot be overstated, as it plays a vital role in communication, data storage, and information processing in modern digital systems.

Use of AM radios

Tuning into a local news station on a car radio while driving is an example of AM radio.

AM Transmitter and ReceiverBuilding an AM radio using an RF module using RF 433MHz with Arduino UNO.

Parts Requires :

    1. 2x Arduino UNO
    2. RF 433MHz Receiver/Transmitter
    3. Breadboard
    4. Jumper wires

Library installation

Before we start building the AM radio, we need to install the Radiohead Library, which is a popular library for controlling wireless radios. Here are the steps to install the Radiohead Library:

    1. Go to the Radiohead Library GitHub page at https://github.com/adafruit/RadioHead.
    2. Click on the "Clone or Download" button and select "Download ZIP".
    3. Extract the downloaded ZIP file.
    4. Open the Arduino IDE and go to Sketch > Include Library > Add . ZIP Library.
    5. Select the extracted Radiohead ZIP file and click "Open".
    6. Go to File > Examples > Radiohead and select any example to test the installation.
    7. Once you have installed the Radiohead Library, you can proceed with building the AM radio.

Transmitter Sketch

You can upload the following code to an Arduino board to function as a transmitter. This code is based on one of the examples provided by the RadioHead library.

#include  "RH_ASK.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 = "Hello World!"; 
    driver.send((uint8_t )msg, strlen(msg)); 
    driver.waitPacketSent(); 
    delay(1000); 
} 

Receiver Sketch

Upload the code below to the Arduino connected to the receiver. This is based on one of the examples provided by the RadioHead library.

#include  "RH_ASK.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() {
uint8_t buf[12];
uint8_t buflen = sizeof(buf);
if (driver.recv(buf, &buflen)) // Non-blocking {
Serial.print("Message: "); Serial.println((char*)buf);
}
}