Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

RF based 16 Channel wireless control using 8051 microcontroller

By Ashutosh Bhatt

The simple wireless RF remote using HT12E & HT12D set of encoder/decoder and RF module has limitation of providing only 4 controls to the user. This topic presents a way to create 16 channels of output corresponding to 4 channels of input. This has been achieved by using AT89C51 of 8051 family of microcontrollers on the receiver end. In this application, a maximum of 16 appliances can be switched by four inputs at transmission end.


The provision of providing input to the circuit has been provided by a set of four switches. These switches are connected to the encoder IC HT12E. The binary logics from 0000 to 1111 can be passed through these switches. For example, a 1001 logic can be sent by pressing the 2nd and 3rd switches (since the switches are connected to ground). The encoder converts the parallel logic to serial form which gets transmitted through the antenna of the RF transmitter. For more details, refer wireless RF remote. The RF receiver acquires these signals and sends it to the decoder IC HT12D. HT12D decodes the serial data to generate the parallel signals again.

The output bits from the decoder are supplied to AT89C51. The microcontroller is programmed to read these inputs and provide the corresponding output. From four input options, a total of 16 (24) combinations can be provided for output. The high voltage devices can be switched using these signals through relays.
The four inputs (from decoder) to the microcontroller are provided through pins 0-3 of port P0. Port P1 and P3 are the output ports to connect the appliances or relays to be switched.


Project Source Code

###

#include<reg51.h>
sbit in1=P2^0;	 //input pin1
sbit in2=P2^1;	 //input pin1
sbit in3=P2^2;	 //input pin1
sbit in4=P2^3;	 //input pin1

sbit out1=P1^0;	 //output pins for 16 controls/appliances
sbit out2=P1^1;
sbit out3=P1^2;
sbit out4=P1^3;
sbit out5=P1^4;
sbit out6=P1^5;
sbit out7=P1^6;
sbit out8=P1^7;

sbit out9=P3^0;
sbit out10=P3^1;
sbit out11=P3^2;
sbit out12=P3^3;
sbit out13=P3^4;
sbit out14=P3^5;
sbit out15=P3^6;
sbit out16=P3^7;

void main()
{	in1=in2=in3=in4=1;	  //configuring as input pins
    	out1=out2=out3=out4=out5=out6=out7=out8=out9=out10=out11=out12=out13=out14=out15=out16=1;	 //making output pins high

 	while(1)
  	{
   		while(in1==1&&in2==1&&in3==1&&in4==1)	 //signal (1111) is fed to output pin 1
		{
		 	out2=out3=out4=out5=out6=out7=out8=out9=out10=out11=out12=out13=out14=out15=out16=1;
		  	out1=0;
		}
		 
   		while(in1==1&&in2==1&&in3==1&&in4==0)	 //signal (1110) is fed to output pin 2
		{ 
    	  		out1=out3=out4=out5=out6=out7=out8=out9=out10=out11=out12=out13=out14=out15=out16=1; 
		  	out2=0;
		}

   		while(in1==1&&in2==1&&in3==0&&in4==1)	//signal (1101) is fed to output pin 3
		{
		 	out1=out2=out4=out5=out6=out7=out8=out9=out10=out11=out12=out13=out14=out15=out16=1;
		  	out3=0;
		}

   		while(in1==1&&in2==1&&in3==0&&in4==0)   //signal (1100) is fed to output pin 4
		{
		 	out1=out2=out3=out5=out6=out7=out8=out9=out10=out11=out12=out13=out14=out15=out16=1;
		  	out4=0;
		}

   		while(in1==1&&in2==0&&in3==1&&in4==1)	//signal (1011) is fed to output pin 5
		{
		 	out1=out2=out3=out4=out6=out7=out8=out9=out10=out11=out12=out13=out14=out15=out16=1;
		  	out5=0;
		}

   		while(in1==1&&in2==0&&in3==1&&in4==0)   //signal (1010) is fed to output pin 6
		{
		 	out1=out2=out3=out4=out5=out7=out8=out9=out10=out11=out12=out13=out14=out15=out16=1;
		  	out6=0;
		}
							
   		while(in1==1&&in2==0&&in3==0&&in4==1)  //signal (1001) is fed to output pin 7
		{
		 	out1=out2=out3=out4=out5=out6=out8=out9=out10=out11=out12=out13=out14=out15=out16=1;
		  	out7=0;
		}

   		while(in1==1&&in2==0&&in3==0&&in4==0)  //signal (1000) is fed to output pin 8
		{  
			out1=out2=out3=out4=out5=out6=out7=out9=out10=out11=out12=out13=out14=out15=out16=1;
		  	out8=0;
		}

   		while(in1==0&&in2==1&&in3==1&&in4==1)  //signal (0111) is fed to output pin 9
		{   
			out1=out2=out3=out4=out5=out6=out7=out8=out10=out11=out12=out13=out14=out15=out16=1;
		  	out9=0;
		}

 		while(in1==0&&in2==1&&in3==1&&in4==0) //signal (0110) is fed to output pin 10
		{
		 	out1=out2=out3=out4=out5=out6=out7=out8=out9=out11=out12=out13=out14=out15=out16=1;
		  	out10=0;
		}
   
		while(in1==0&&in2==1&&in3==0&&in4==1)   //signal (0101) is fed to output pin 11
		{
		 	out1=out2=out3=out4=out5=out6=out7=out8=out9=out10=out12=out13=out14=out15=out16=1;
		  	out11=0;
		}

   		while(in1==0&&in2==1&&in3==0&&in4==0)   //signal (0100) is fed to output pin 12
		{
		 	out1=out2=out3=out4=out5=out6=out7=out8=out9=out10=out11=out13=out14=out15=out16=1;
		  	out12=0;
		}

   		while(in1==0&&in2==0&&in3==1&&in4==1)  //signal (0011) is fed to output pin 13
		{
		 	out1=out2=out3=out4=out5=out6=out7=out8=out9=out10=out11=out12=out14=out15=out16=1;
		  	out13=0;
		}

   		while(in1==0&&in2==0&&in3==1&&in4==0)  //signal (0010) is fed to output pin 14
		{
		 	out1=out2=out3=out4=out5=out6=out7=out8=out9=out10=out11=out12=out13=out15=out16=1;
		  	out14=0;
		}

   		while(in1==0&&in2==0&&in3==0&&in4==1)   //signal (0001) is fed to output pin 15
		{
		 	out1=out2=out3=out4=out5=out6=out7=out8=out9=out10=out11=out12=out13=out14=out16=1;
		  	out15=0;
		}

   		while(in1==0&&in2==0&&in3==0&&in4==0)  //signal (0000) is fed to output pin 16
		{
		 	out1=out2=out3=out4=out5=out6=out7=out8=out9=out10=out11=out12=out13=out14=out15=1;
		  	out16=0;
		}

 	} 
}

###

 


Circuit Diagrams

Transmitter-Part
Receiver-Part

Project Components

  • AT89C51 Microcontroller
  • HT12D Decoder IC
  • HT12E Encoder IC
  • Relay Switch


Filed Under: 8051 Microcontroller

 

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



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

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!


Featured Tutorials

  • Introduction to Brain Waves & its Types (Part 1/13)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)
  • Performing Experiments with Brainwaves (Part 3/13)
  • Amplification of EEG Signal and Interfacing with Arduino (Part 4/13)
  • Controlling Led brightness using Meditation and attention level (Part 5/13)
  • Control Motor’s Speed using Meditation and Attention Level of Brain (Part 6/13)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • What are the battery-selection criteria for low-power design?
  • Key factors to optimize power consumption in an embedded device
  • EdgeLock A5000 Secure Authenticator
  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver
  • Introduction to Brain Waves & its Types (Part 1/13)

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Avalanche Pulser
  • Measure AC current accurateley (100mA to 10A)
  • SDR with external LO input
  • Timer MC14541B wrong delay
  • simple LSB explanation please

RSS Electro-Tech-Online.com Discussions

  • bluetooth jammer
  • Disabled son needs advice please
  • DIY bluetooth speaker
  • Someone please explain how this BMS board is supposed to work?
  • HV Diodes
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 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 | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering