Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Interfacing RF Module with 8051 Microcontroller- (Part 15/45)

By Gurmeet Singh July 30, 2021

 

Requirements:

1. AT89S52 microcontroller
2. RF module (433 MHz Rx/Tx)
3. Encoder/Decoder IC (HT12E/D)
4. 16X2 alphanumeric LCD
5. 7805 IC
6. 11.0592 MHz crystal

 

7. 4X4 keypad

This project is about interfacing RF (Radio Frequency) module with the 8051 microcontroller. These RF modules help us in sending and receiving the data wirelessly up to certain distance thereby offering ease  in wireless data transferring. There are many forms of wireless technologies which can transfer the data such as Bluetooth modules, ZigBee modules, and Wi-Fi modules.

RF is one of these technologies that can be availed at a much less cost and works quite well for small scale projects. These modules are really easy to deal with as they just require the data to be transferred serially and VCC+GND supply of course.

Prototype of 8051 Microcontroller based RF Data Transmission

Fig. 1: Prototype of 8051 Microcontroller based RF Data Transmission

In this project, I have also made use of the encoder/decoder IC (HT12E/D) to transfer the parallel 4 bit data serially.
A 4X4 keypad sends the signals to the microcontroller on pressing any digit. The microcontroller then analyses the digit pressed and sends the corresponding 4 bit data to the encoder which further sends the serially packed data to the RF transmitter part. This was the transmitter part of my project.

Image of RF data transmitter based on HT12E encoder IC

Fig. 2: Image of RF data transmitter based on HT12E encoder IC

Talking about the receiver’s end; the RF Receiver part receives the signals from the previous transmitter in serial format. These signals are then fed to the decoder IC which  parallelizes the data into 4 bits so that they can be read by the microcontroller to perform further operations. When a 4 bit data is received by the microcontroller it analyses the data and displays the corresponding character value on 16X2 LCD.

Image of RF data receiver based on HT12D decoder IC

Fig. 3: Image of RF data receiver based on HT12D decoder IC

I have connected my Encoder/Decoder ICs to the lower half of PORT 3 of the microcontrollers.
At receiver side the LCD is connected to PORT 2 while the RS, RW and E are connected to pin P1^5, 6 and 7 respectively.
In my coding part I have used three user defined header files: <delay.h>,
<lcd.h> and <keypad.h>
<delay.h>: provides the delay_msec().
<lcd.h>: provides all the functions related to LCD programming.
<keypad.h>: provides the Read_Keypad() which returns the pressed digit on keypad.
Note:
These encoders/decoders can deal with only 4 bit data, thus for sending a higher bit data the ICs should be replaced with the desired one.
Also the TX/RX pin, P3^0, on the microcontrollers can alone  transmit/receive data serially, thus removing the encoder/decoder ICs from the circuit. But it didn’t work with me, so if anyone knows how to do it please let me know.

Applications:

This technology can be used to make wireless control systems like door locks, operating home appliances wirelessly and much more.
For children, a wireless spy car is the best option!!!

 

Project Source Code

###



TX

#include
#include
void main()
{
char p=0;
while(1)
{
               p=Read_Keypad();
                while(p)
                {             
                                if(p=='1')
                                P3=0x10;
                                if(p=='2')
                                P3=0x20;
                                if(p=='3')
                                P3=0x30;
                                if(p=='4')             
                                P3=0x40;
                                if(p=='5')
                                P3=0x50;
                                if(p=='6')
                                P3=0x60;
                                if(p=='7')
                                P3=0x70;
                                if(p=='8')             
                                P3=0x80;
                                if(p=='9')
                                P3=0x90;
                                if(p=='0')
                                P3=0x00;
                                if(p=='*')
                                P3=0xa0;
                                if(p=='#')            
                                P3=0xb0;
                                if(p=='A')            
                                P3=0xc0;
                                if(p=='B')            
                                P3=0xd0;
                                if(p=='C')            
                                P3=0xe0;
                                if(p=='D')            
                                P3=0xf0;
                                p=Read_Keypad();
                }
}
}

RX

#include
#include
#include
void main()
{
char p=0;
P3=0xf0;
Lcd8_Init();
while(1)
{                             
                 while(p!=P3)
                                {
                                                p=P3;
                                                Lcd8_Cmd(0x80);
                                                if(p==0x10)
                                                Lcd8_Write_Char('1');
                                                if(p==0x20)
                                                Lcd8_Write_Char('2');
                                                if(p==0x30)
                                                Lcd8_Write_Char('3');
                                                if(p==0x40)
                                                Lcd8_Write_Char('4');
                                                if(p==0x50)
                                                Lcd8_Write_Char('5');
                                                if(p==0x60)
                                                Lcd8_Write_Char('6');
                                                if(p==0x70)
                                                Lcd8_Write_Char('7');
                                                if(p==0x80)
                                                Lcd8_Write_Char('8');
                                                if(p==0x90)
                                                Lcd8_Write_Char('9');
                                                if(p==0x00)
                                                Lcd8_Write_Char('0');
                                                if(p==0xa0)
                                                Lcd8_Write_Char('*');
                                                if(p==0xb0)
                                                Lcd8_Write_Char('#');
                                                if(p==0xc0)
                                                Lcd8_Write_Char('A');
                                                if(p==0xd0)
                                                Lcd8_Write_Char('B');
                                                if(p==0xe0)
                                                Lcd8_Write_Char('C');
                                                if(p==0xf0)
                                                Lcd8_Write_Char('D');
                                }
                }
}

Delay.h

void delay_msec(int time)
{
int i=0;
while(i
//LCD Module Connections
                sbit RS=P1^5;
                sbit RW=P1^6;
                sbit E=P1^7;
//End LCD Module Connections
char *string;
//LCD 8 Bit Interfacing Functions
void Lcd8_Cmd(unsigned char value)
                {
                P2=value;
                RS=0;
                RW=0;
                E=1;
                delay_msec(1);
                E=0;
                }
void Lcd8_Init()
{
  Lcd8_Cmd(0x38);    //function set
  Lcd8_Cmd(0x0C);    //display on,cursor off,blink off
  Lcd8_Cmd(0x01);    //clear display
  Lcd8_Cmd(0x06);    //entry mode, set increment
}
void Lcd8_Write_Char(unsigned char value)
                {
                P2=value;
                RS=1;
                RW=0;
                E=1;
                delay_msec(1);
                E=0;
               }
void Lcd8_Write_String(char *a)
{
                int i;
                string=a;
                for(i=0;a[i]!='';i++)
                Lcd8_Write_Char(a[i]);
}

Keypad.h


sbit R1 = P1^7;
sbit R2 = P1^6;
sbit R3 = P1^5;
sbit R4 = P1^4;
sbit C1 = P1^3;
sbit C2 = P1^2;
sbit C3 = P1^1;
sbit C4 = P1^0;
//End Keypad Connections
char Read_Keypad()
{
  C1=C2=C3=C4=1;
  R1=0;
  R2=1;
  R3=1;
  R4=1;
  if(C1==0){while(C1==0);return '1';}
  if(C2==0){while(C2==0);return '2';}
  if(C3==0){while(C3==0);return '3';}
  if(C4==0){while(C4==0);return 'A';}
  R1=1;
  R2=0;
  R3=1;
  R4=1;
  if(C1==0){while(C1==0);return '4';}
  if(C2==0){while(C2==0);return '5';}
  if(C3==0){while(C3==0);return '6';}
  if(C4==0){while(C4==0);return 'B';}
  R1=1;
  R2=1;
  R3=0;
  R4=1;
  if(C1==0){while(C1==0);return '7';}
  if(C2==0){while(C2==0);return '8';}
  if(C3==0){while(C3==0);return '9';}
  if(C4==0){while(C4==0);return 'C';}
  R1=1;
  R2=1;
  R3=1;
  R4=0;
  if(C1==0){while(C1==0);return '*';}
  if(C2==0){while(C2==0);return '0';}
  if(C3==0){while(C3==0);return '#';}
  if(C4==0){while(C4==0);return 'D';}
 return 0;
}

###

 


Circuit Diagrams

Circuit-Diagram-8051-Microcontroller-433-Mhz-Rf-Module-Based-Rf-Data-Communication

Project Video


Filed Under: Featured Contributions
Tagged With: 8051, RF module
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Voltage mode pushpull is a nonsense SMPS?
  • Input impedance matching network
  • High Side current sensing
  • The comparison of different Tcl script checkers
  • Reducing "shoot-through" in offline Full Bridge SMPS?

RSS Electro-Tech-Online.com Discussions

  • Is AI making embedded software developers more productive?
  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe