RF Modules are popularly used in the remote control system. In Quadcopter, Robot remote control, Industrial remote control, telemetry and remote sensing etc. Get more details here RF_Wiki
RF module interfacing tutorial |
RF Module :
RF Module means Wireless Radio Frequency Module. RF module consists of two units. One Transmitter unit and another is Receiver unit. Basically, RF modules are used to building a wireless connection between two points. We can easily communicate over 300-500m distance through RF module . in this tutorial we are using RF Module at the 433Mhz frequency and it supports baud rate 9600. Although didn't try this. In this tutorial, I will use baud rate2400.We will use UART communication to interface RF Module with microcontroller. As we did previously in Bluetooth Interfacing with Pic Microcontroller tutorial. Now let's take a look on RF Transmitter and Receiver respectively .
RF Transmitter :
![]() |
RF Module ( Wireless Radio Frequency )Transmitter_Tx |
![]() |
max232 433mhz module |
RF Receiver :
![]() | |
RF 433 MHz (Wireless Radio Frequency) Communication Between two Microcontroller [Step By Step Tutorial ] |
![]() |
RF Module ( Wireless Radio Frequency ) Receiver Pinout |
MikroC Code :
Now open MikroC and Create a new Project .If you are an expert you don't have to follow this steps .




Mikro C Library Funtions :
UARTx_Init: This function will initialize USART option of Microcontroller with Baud rate . We will use baud rate 2400 . The code will be look like this :
UART1_Init(2400);
UARTx_Data_Ready: This checks if it is available to read or transmit data .
UARTx_Read_Text: To read text data .Look at the example .
if (UART1_Data_Ready() == 1) {
UART1_Read_Text( txt, ")" , 2); }
This is checking if data is available to read . ")" . The txt char array variable will be being stored until the ")" will be found . 2 means to try for 2 times . So , I think our text should not be longer than 2 character .
UARTx_Write_Text: This will send text data . Look at the example :
if (UART1_Tx_Idle() == 1) {// this will check , if the last data transmission is completed
UART1_Write_Text("button2");
}
UART1_Write_Text("button2");
}
UARTx_Write: This will send char data . Look at the example :
if (UART1_Tx_Idle() == 1) {// this will check , if the last data transmission is completed
UART1_Write( '(' );
}
UART1_Write( '(' );
}
Reducing Noise :
To reduce noise, we will use a trick. Before reading the data text we will keep a function and this will check the first character. If the character will be '(', it will be checked by an if statement. Finally read text function will be performed until the char ')' will be found. That means microcontroller will show us only the text between '(' and ')'.
Please follow the example:
Please follow the example:
If we send (A) , Lcd will show "A" . If we send (B) , we will get "B" . Unless we cant get any text output. If we send "(A" , this will show no output to LCD display.
Source Code :
# Transmitter :
char txt[16];
char chk;
int i=0,ckop=0;
void main() {
ADCON1=0x0F; // Configure RE1 pin as input
CMCON=7;
for(i=0;i<16;i++){txt[i]=' ';}
TRISA.F0=1;
TRISA.F1=1; // Initialize ADC
TRISA.F2=1;
TRISA.F3=1;
UART1_Init(2400);
delay_ms(200); // Initialize LCD
while(1){
if(PORTA.F0==0){ delay_ms(100);
if (UART1_Tx_Idle() == 1)
UARt1_Write_Text(",,,,,,,,,,,");
UART1_Write('(');
UART1_Write('A');
UART1_Write(')');
UARt1_Write_Text(",,,,,,,,,,,");
}
if(PORTA.F1==0){ delay_ms(100);
if (UART1_Tx_Idle() == 1)
UARt1_Write_Text(",,,,,,,,,,,");
UART1_Write('(');
UART1_Write('B');
UART1_Write(')');
UARt1_Write_Text(",,,,,,,,,,,");
}
if(PORTA.F2==0){ delay_ms(100);
if (UART1_Tx_Idle() == 1)
UARt1_Write_Text(",,,,,,,,,,,");
UART1_Write('(');
UART1_Write('C');
UART1_Write(')');
UARt1_Write_Text(",,,,,,,,,,,");
}
if(PORTA.F3==0){ delay_ms(100);
if (UART1_Tx_Idle() == 1)
UARt1_Write_Text(",,,,,,,,,,,");
UART1_Write('(');
UART1_Write('D');
UART1_Write(')');
UARt1_Write_Text(",,,,,,,,,,,");
}
}
}
# Receiver :
// LCD module connections
sbit LCD_RS at LATB7_bit;
sbit LCD_EN at LATB6_bit;
sbit LCD_D4 at LATB5_bit;
sbit LCD_D5 at LATB4_bit;
sbit LCD_D6 at LATB3_bit;
sbit LCD_D7 at LATB2_bit;
sbit LCD_RS_Direction at TRISB7_bit;
sbit LCD_EN_Direction at TRISB6_bit;
sbit LCD_D4_Direction at TRISB5_bit;
sbit LCD_D5_Direction at TRISB4_bit;
sbit LCD_D6_Direction at TRISB3_bit;
sbit LCD_D7_Direction at TRISB2_bit;
// End LCD module connections
char txt[16];
char chk;
int i=0,ckop=0;
void main() {
ADCON1=0x0E; // Configure RE1 pin as input
CMCON=7;
for(i=0;i<16;i++){txt[i]=' ';}
Lcd_Init();
UART1_Init(2400);
delay_ms(200); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursdhhdor off
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1, 4, "Welcome");
Lcd_Out(2, 2, "pictutorial.net");
delay_ms(1500);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1, 2, "Received Data");
while(1){
ckop=2;
if (UART1_Data_Ready() == 1){
chk = UART1_Read();
for(i=0;i<16;i++){txt[i]=' ';}
if(chk=='('){
UART1_Read_Text(txt,")",2); // reads text until 'enter' is found
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1, 2, "Received Data");
Lcd_Out(2,1,txt);
delay_ms(500);
}
}
}
}
Proteus Circuit:
![]() |
How to Create a New Project in Proteus 8_Step1 |
![]() |
How to Create a New Project in Proteus 8_Step2 |
![]() |
How to Create a New Project in Proteus 8_Step3 |
![]() |
How to Pick parts from Proteus library |
![]() |
How to find Power, Ground etc |
![]() |
RF 433 MHz (Wireless Radio Frequency) Communication Between two Microcontroller [Step By Step Tutorial ] |
Result :
![]() |
RF 433 MHz (Wireless Radio Frequency) Communication Between two Microcontroller [Step By Step Tutorial ] |
![]() |
RF Module ( Wireless Radio Frequency ) Controlled Simulation |