Design of a programmable 4-way wireless switch system for lighting control based on a single chip microcomputer

Publisher:之敖赵先生Latest update time:2018-04-01 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    1 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.

    5

    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.

    5

    (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.

   5

    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.


Keywords:MCU Reference address:Design of a programmable 4-way wireless switch system for lighting control based on a single chip microcomputer

Previous article:Design of Punch Press Controller Based on AT89S51 Single Chip Microcomputer
Next article:Low-cost temperature control experimental system based on AT89C51 single-chip microcomputer

Recommended ReadingLatest update time:2024-11-16 19:46

Case study of power-on reset fault of microcontroller using oscilloscope
Recently, a product was designed using the CY7C68013A chip. In fact, there is a 51 microcontroller inside to control USB communication. During the test, it was found that after some circuit boards were powered on, the computer could not discover the new USB hardware, nor did it prompt that it could not be recognized.
[Test Measurement]
Case study of power-on reset fault of microcontroller using oscilloscope
Hardware Design of Digital Sensor System Based on C8051F060 MCU
With the development of science and technology, intelligent control technology has begun to be widely used in the field of electronic testing. In modern industrial measurement and control systems, people often hang various sensors on the field bus to form a sensor network system. Various sensor devices are used as n
[Microcontroller]
Hardware Design of Digital Sensor System Based on C8051F060 MCU
STC MCU AD and EEPROM programming C code
/*----------------------------------------------------------------     *File Name: stc_AD.c - *Description: A/D conversion program              *Project: - *MCU type: STC12C5410AD -                                                                        - *Company: WY - *Compiler: KEIL C51 - *DESINER: Guo Zhun 06.2.7 -
[Microcontroller]
PIC microcontroller - use of seven-segment digital tube
1. Write a subroutine LED_Display to display a number on a certain 7-segment LED according to the input parameters. The number of the LED bits that are lit is in the W register, and the number displayed by the bit is in the variable wdata. The position of the variable wdata is set by the user. After calling this subro
[Microcontroller]
13-Alcohol concentration detection alarm system based on 51 single chip microcomputer
Specific implementation functions It consists of STC89C51 microcontroller + MQ-3 alcohol sensor + ADC0832 module + LCD1602 module + alarm module + power supply. Specific functions: 1. LCD1602 displays alcohol concentration in real time; 2. You can press buttons to set the alarm value and realize sound and light
[Microcontroller]
13-Alcohol concentration detection alarm system based on 51 single chip microcomputer
51 single chip microcomputer button control servo
#include reg52.h #define Stop 0 //Macro definition, stop #define Left 1 //Macro definition, turn left #define Right 2 //Macro definition, turn right sbit ControlPort = P1^0; //Servo signal port sbit KeyLeft = P1^1; //Left turn button port sbit KeyRight = P1^2; //Right turn button port sbit KeyStop = P1^3; //Home b
[Microcontroller]
Design of intelligent electronic heat scale using STC89C52 microcontroller
1 Introduction Weighing devices are indispensable measurement tools in industrial and agricultural production and commodity circulation expansion. Electronic scales are favored by people for their many advantages such as accuracy, speed, convenience, and intuitive display. With the improvement of people's living stand
[Microcontroller]
Design of intelligent electronic heat scale using STC89C52 microcontroller
Learning MCU Steps
Learning to use a microcontroller means understanding the microcontroller hardware structure and the application of internal resources, learning the initialization settings of various functions in assembly or C language, and programming to implement various functions. Step 1: Use of digital I/O Use buttons to input
[Microcontroller]
Learning MCU Steps
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号