433 MHz RF Transceiver Module Documentation
The 433 MHz RF Transceiver Module is a low-power, low-cost wireless communication module designed for IoT applications. It operates on the 433 MHz frequency band and supports bi-directional communication. This module is widely used in remote control systems, wireless sensors, and IoT devices.
Frequency: 433 MHz
Data Rate: Up to 20 kbps
Range: Up to 100 meters (line of sight)
Power Consumption: Low power consumption (<20 mA)
Operating Voltage: 3.3V to 5V
| Pin | Function |
| --- | --- |
| VCC | Power Supply (3.3V to 5V) |
| GND | Ground |
| TX | Transmission Pin |
| RX | Reception Pin |
| ANT | Antenna Connection |
To use the 433 MHz RF Transceiver Module, connect it to a microcontroller or a development board as follows:
VCC to 3.3V or 5V power supply
GND to Ground
TX to a digital output pin on the microcontroller
RX to a digital input pin on the microcontroller
ANT to an antenna (optional)
### Example 1: Using the 433 MHz RF Transceiver Module with an Arduino Board
In this example, we will demonstrate how to use the 433 MHz RF Transceiver Module to send and receive data between two Arduino boards.
Transmitter Code (Arduino Board 1)
```c++
#include <RH_NRF.h>
#define TX_PIN 2 // Digital output pin for transmission
#define RF_freq 433e6 // 433 MHz frequency
void setup() {
pinMode(TX_PIN, OUTPUT);
Serial.begin(9600);
nrf.init();
}
void loop() {
char message[] = "Hello, world!";
nrf.send((uint8_t )message, strlen(message));
delay(1000);
}
```
Receiver Code (Arduino Board 2)
```c++
#include <RH_NRF.h>
#define RX_PIN 3 // Digital input pin for reception
#define RF_freq 433e6 // 433 MHz frequency
void setup() {
pinMode(RX_PIN, INPUT);
Serial.begin(9600);
nrf.init();
}
void loop() {
uint8_t buffer[32];
uint8_t buflen = sizeof(buffer);
if (nrf.recv(buffer, &buflen)) {
Serial.print("Received message: ");
Serial.println((char )buffer);
}
delay(1000);
}
```
### Example 2: Using the 433 MHz RF Transceiver Module with a Raspberry Pi (using Python)
In this example, we will demonstrate how to use the 433 MHz RF Transceiver Module to send and receive data between a Raspberry Pi and a remote device.
Transmitter Code (Raspberry Pi)
```python
import RPi.GPIO as GPIO
import time
# Set up GPIO pins
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT) # TX pin
while True:
# Send a message
message = "Hello, world!"
for bit in message:
GPIO.output(17, GPIO.HIGH)
time.sleep(0.001)
GPIO.output(17, GPIO.LOW)
time.sleep(0.001)
time.sleep(1)
```
Receiver Code (Remote Device)
```python
import RPi.GPIO as GPIO
import time
# Set up GPIO pins
GPIO.setmode(GPIO.BCM)
GPIO.setup(23, GPIO.IN) # RX pin
while True:
# Receive a message
message = ""
while GPIO.input(23) == GPIO.LOW:
message += str(GPIO.input(23))
print("Received message:", message)
time.sleep(1)
```
Note: In the above examples, the 433 MHz RF Transceiver Module is connected to the corresponding pins on the Arduino boards or Raspberry Pi. The antenna connection is optional, but recommended for better signal quality.