8-way infrared remote control switch controller (expandable to 32-way)

Publisher:andyliow1980Latest update time:2011-02-27 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

What is provided here is just a DEMO, which mainly focuses on the application of single-chip microcomputer. Please consider adding safety aspects on your own.


There are some people on the forum who want to DIY a multi-channel infrared remote control switch. I made a DOME version here. I also use the decoding program of SAA3010T that I am familiar with (saving a lot of time). The program

can be directly used for AT89C51 or AT89C2051 or compatible chips. When using 2051, P1.0 and P1.1 should be pulled up with 10K resistors. When using an integrated receiving head, the power supply must be filtered well

, such as using a large filter capacitor to make the DC more stable, using a small capacitor of 104 (0.1uF) to remove high frequencies, etc. Only in this way can the anti-interference performance be improved to a certain extent. In terms of the program,

I did it very simply here. I used the 1-8 keys of the remote control to control the 1-8 relays. Pressing once will turn on the relay, and pressing again will continue. The interval between the two presses is about 1 second, so that

pressing a key once can avoid the relay being turned on and off repeatedly (the time of pressing a key once is uncertain, and the number of times the key value is sent is also uncertain). I also used the power button of the remote control. When pressed, all circuit breakers are turned

off. If this circuit uses AT89C51, it can find 32 or more control channels. Some netizens said that it is possible to make a multi-remote control learning type. I think it is feasible. Then IC2 devices will be used to

store the received data for learning and compare them when receiving. However, if you have a lot of data, it will cause problems such as slow speed. I personally think it is better to use a dedicated remote control. For example, if

you use a TV remote control to control the TV and the infrared switch, when you turn on the TV, you may trigger the infrared switch at the same time.

Minghao 2004.03.28


Experimental photos
click to enlarge
Schematic diagram - 1 Click to enlarge ( pin 31 (EA/VPP) should be connected to +5V )
click to enlarge
Schematic diagram - 2 Click to enlarge


Key-Value Coding

MCU HEX file download: 04032801_1_8COM.rar

C51 source code:

/*----------------------------------------

8-way infrared remote control switch controller
(SAA3010T TV remote control)

Copyright 2004/3/27
http://www.cdle.net
http://bbs.cdle.net

All rights reserved.Minghao

E-mail: pnzwzw@163.com
pnzwzw@cdle.net

When only eight channels are used, AT89C2051 can be used instead of AT89C51.
The integrated receiver output terminal pulls P3.2 (int0), and P1 is the control output terminal.
It can be expanded to 32 channels or more .
The output is low level valid
----------------------------------------*/

#include

static unsigned char data IRCode[3],IRCON,IRCON2;
static unsigned char data DT;

void main(void)
{
unsigned int de;

TMOD =0x01; //Timer 0 mode 1
EA =1; //Allow CPU interrupt
IT0 =1; //INT0 falling edge is valid
EX0 =1; //Open INT0 interrupt;
do
{
for (de=0; de<10000; de++)
P3_6 =1;
for (de=0; de<10000; de++)
P3_6 =0;
if (DT)
{
for (de=0; de<30000; de++) //There will be a delay after the key value is correct to prevent repeated key presses
P3_6 =1;
for (de=0; de<30000; de++)
P3_6 =0;
DT =0;
}
EX0 =1;
}
while(1);
}

//Timer 0 interrupt processing
void timeint(void) interrupt 1 using 2
{
TH0=0xFD;
TL0=0x1E; //Set the time value to 800us

if (IRCON<3)
{
if (IRCON2<8) //Read the status of the remote control receiver once per interrupt, and each second time is a bit in the remote control code
{
IRCON2++;
IRCode[IRCON]=IRCode[IRCON]<<1; //Read a binary bit in the variable each time, and shift it left one bit each
timeIRCode[IRCON]=IRCode[IRCON] | P3_2; //Fill up a byte every eight times, and one byte stores 4 bits of remote control code
}
else
{
IRCON++; //Fill up a byte and point to the next variableIRCON2
=0; //Count cleared
}
}
else
{
TR0 =0; //Turn off timerET0
=0; //Timer 0 interrupt turned
offif ((IRCode[1]!=0xFF) && (IRCode[2]!=0xFF))
{
if (IRCode[1] ==0x55)
{
switch (IRCode[2])
{
case 0xAB: //1-8 key controlP1_0
=~P1_0;
DT =1;
break;
case 0xAC:
P1_1 =~P1_1;
DT =1;
break;
case 0xAD:
P1_2 =~P1_2;
DT =1;
break;
case 0xB2:
P1_3 =~P1_3;
DT =1;
break;
case 0xB3:
P1_4 =~P1_4;
DT =1; break
; case
0xB4:
P1_5 =~P1_5 ; DT =1; break; case 0xB5: P1_6 =~P1_6; DT =1; break; case 0xCA : P1_7 =~P1_7; DT =1; break; case 0xD2: //Press the power off button to turn off all relays P1 =0xFF; DT =1; break; } } } } }


















//INT0 interrupt
void INT0Fun(void) interrupt 0 using 2
{
EX0 =0; //External interrupt 0 disabled
ET0 =1; //Timer 0 interrupt enabled
TH0=0xFD;
TL0=0x1E; //Set the time value to 800us

for (IRCON=0; IRCON<3; IRCON++)
IRCode[IRCON] =0;
IRCON =0;
IRCON2 =0; //Count clear

TR0 =1; //Start counting

Reference address:8-way infrared remote control switch controller (expandable to 32-way)

Previous article:Multifunctional digital clock design
Next article:Use TV remote control to switch lamps--Klin switch

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号