Design of wireless remote control switch system for long-distance lighting control based on single chip microcomputer

Publisher:q13358975046Latest update time:2012-07-02 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 System Design

With the continuous development of electronic technology, wireless technology plays an increasingly important role in intelligence. This design is a wireless remote control switch system that can realize long-distance lighting control. It consists of two parts: the transmitting system and the receiving system. The system uses a wireless transceiver module to form a radio frequency transmitting and receiving circuit. The transmitting part is mainly composed of a key addressing circuit, an encoding circuit and a transmitting module; the receiving part is mainly composed of a receiving module, a single-chip control circuit and a load circuit.

The transmitting system is powered by 1 12 V dry battery, the receiving system is powered by 3 1.5 V dry batteries, and the microcontroller is powered by 5 V DC power supply. The power supply system is energy-saving and simple.

2 System Implementation

2.1 Component Selection and System Block Diagram

Considering the compatibility, practicality, low cost and energy saving of the system, the AT89S52 single-chip microcomputer is selected, and the PT2262/2272 wireless transceiver module is used to realize 315 MHz wireless communication. The AT89S52 single-chip microcomputer is a low-power, high-density CMOS 8-bit single-chip microcomputer manufactured by ATMEL using non-volatile storage technology. It contains 8 KB ISP (In-system programmable) Flash read-only program memory that can be repeatedly erased and written 1,000 times. It is compatible with the standard MCS-51 instruction system and 80C51 pin structure, and can provide cost-effective solutions for many embedded control application systems.

PT2262/PT2272 is a low-power, low-cost general-purpose codec circuit manufactured by Taiwan Pucheng Company using CMOS technology. PT2262/PT2272 can have up to 12 bits (A0-A11) of three-state address pins (floating, connected to high level, connected to low level). Any combination of the 12 bits (A0-A11) of three-state address pins can provide 531 441 address codes. PT2262 can have up to 6 bits (D0-D5) of data pins. The set address code and data code are serially output from pin 17 [2].

The system block diagram of the circuit is shown in Figure 1.

2.2 System Circuit Diagram

The system circuit consists of two parts: wireless transmitting system and wireless receiving system.

(1) Wireless transmission system circuit (as shown in Figure 2): It is mainly completed by PT2262 chip. Circuit PT2262 encodes the key signal and can control 4 channels. In Figure 2, pins 1 to 8 of PT2262 are the encoding address terminals. Each address terminal can be set to three states: "high level" (this pin is connected to 12 V), "low level" (this pin is grounded), and "suspended". Pins 10 to 13 are the encoded data input terminals D3 to D0 (using 4-bit data). A button is connected to each data terminal to control different devices. When the button is pressed, the button adds 12 V voltage to the corresponding data terminal, and the data terminal information is transmitted through the crystal oscillator. PT2262 will encode according to the address code setting and the input data, and output the encoding pulse from pin 17. Wireless communication is controlled by coded pulses [2-3]. When the pulse at pin 17 is "1", the oscillator composed of V1 works, generates a 315 MHz high-frequency signal and transmits it; when the output pulse at pin 17 is "0", the oscillator composed of V1 stops working. [page]

(2) Wireless receiving system circuit: The receiving system circuit is mainly composed of the receiving module (including the RF module, chip PT2272 and peripheral circuits), relay circuit and load circuit, as shown in Figure 3. Pins 1 to 8 of PT2272 are decoding address terminals. Each address terminal can be set to "high level" (the pin is connected to 5 V), "low level" (the pin is grounded), and "floating". The setting of the decoding address corresponds to the address code of PT2272. When the RF module receives the signal sent by the transmitting circuit, PT2272 compares and checks the address code (decoding). If the address code is correct, the signal sent by the TE pin of the transmitting module (the coding start end is used for the coding transmission of multiple data, and the low level is effective) enters the PT2272 through the Din pin (pin 14) of the RF module, and the data enters the microcontroller through the data output pins D0~D3 (pins 10~13) of PT2272; otherwise, the data output pin of PT2272 does not have any action. When the signal enters the microcontroller, the microcontroller analyzes it and makes corresponding control. If the first signal received is high level, the digital display tube controlled by the single-chip microcomputer will display "11" (the first "1" indicates the first signal, and the second "1" indicates that the signal is high level), and the single-chip microcomputer sends a high level to the relay circuit, the relay is energized, and the load circuit works; when the high level is received for the second time, the corresponding port level is set to zero through the single-chip microcomputer; when the high level is received for the third time, it is set to 1 again, and so on; when the digital tube displays "1 1" (the first 1 indicates the first signal, and the second 1 indicates that the signal is low level), the single-chip microcomputer sends a low level to the relay circuit, the relay is disconnected, and the load stops working. Relays and digital tubes can be used to achieve flexible control and clear display.

3 Program Writing and Debugging

The control program is written into the AT89S52 microcontroller using Keil C51, and the output signal of the microcontroller is assigned different levels ("1" or "0") using the serial port debugging assistant. The test result can reach 100%, the maximum control distance can reach 50 m, and the response time is no more than 1 s.

This design uses the AT89S52 microcontroller and the PT2262/2272 chipset to implement a programmable 4-way wireless switch system for lighting control, avoiding the limitations of using dedicated decoding chips, making full use of system software and hardware resources, and providing a scientific solution for smart home lighting control with good scalability and flexibility, low cost and low power consumption.

Reference address:Design of wireless remote control switch system for long-distance lighting control based on single chip microcomputer

Previous article:SPCE061A single chip collects voice signals and transmits them to PC for analysis
Next article:Analysis of the application fields of single chip microcomputer

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号