Abstract: With energy becoming increasingly scarce, energy conservation and emission reduction have become particularly important. In order to promote this concept, a classroom lighting control system is designed. This system uses the STC89C51 single-chip microcomputer as the control core, and uses pyroelectric infrared sensors, light intensity detection modules, and counting modules as front-end signal acquisition units. The single-chip microcomputer will comprehensively control the brightness of the fluorescent lamps in the classroom according to the input infrared signal, light intensity signal, and number of people signal to achieve the purpose of energy conservation and emission reduction.
You may have seen various energy-saving products in your life, such as energy-saving lamps, variable-frequency air conditioners, solar street lights, low-power LCD TVs, etc. However, for students, there seem to be few energy-saving applications on campus. Coupled with the extensive power management model, the waste of electricity can be seen everywhere. Classroom lighting electricity accounts for most of the campus electricity consumption, so considering how to minimize classroom lighting electricity consumption is to consider how to achieve energy-saving control of classroom lighting.
With its low price and reliable operation, the single-chip microcomputer has replaced the computer and become the core of the new generation of automatic control. This system uses the single-chip microcomputer as the main control core, and uses pyroelectric infrared sensors, photoelectric detection modules and counting modules as front-end signal acquisition. After the logic judgment of the single-chip microcomputer, the output signal drives the relay to realize the control of the fluorescent lamp.
1 Overall system design
The system consists of 7 parts. The light intensity detection module, pyroelectric infrared sensor and number detection module are used as front-end signal acquisition units to input the signal into the microcontroller. After the logic judgment of the microcontroller, the output signal controls the relay, and then controls the brightness of the fluorescent lamp. If in an emergency, all the lights need to be turned off or on, you can press the forced button to turn all the lights on or off. And the forced button will not affect the normal operation of the system. The overall block diagram of the system is shown in Figure 1.
Figure 1 System block diagram
1.1 Light intensity detection circuit
A photoresistor is a component whose resistance changes with the change of external light intensity. When the light intensity increases, the resistance decreases, and vice versa. The light intensity detection circuit is designed based on this characteristic of the photoresistor. When the light is on, the transistor is turned on and outputs a low level, otherwise it outputs a high level. The light detection circuit is shown in Figure 2.
Figure 2 Schematic diagram of light detection circuit
1.2 Infrared signal detection circuit
The pyroelectric infrared sensor is used as the personnel position signal detector of the system. The pyroelectric infrared processing chip BISS0001 is adopted. The chip has high-performance sensor signal integration processing capabilities. The passive pyroelectric infrared measurement module is composed of a pyroelectric infrared sensor and a small number of components. With the addition of a Fresnel lens, it can detect a 150-degree cone range, and the straight-line detection distance is about 5 meters.
1.3 Counting circuit
In order to determine whether a student is entering or leaving the classroom, the counting circuit uses two sets of signal modules. One is installed on the wall outside the door, and the other is installed on the wall inside the door. The installation direction is parallel to the wall. In this way, as long as you detect which sensor sends a signal first, and then detect whether the other sensor has a signal, you can count. If the signal outside the door comes first and the signal inside the door comes later, it means that someone has entered the classroom; otherwise, it means that someone has left the classroom. The number of people remembered is stored in the microcontroller for standby use.
The circuit uses a laser head and a set of light intensity detection circuits to form a counting module, allowing the light emitted by the laser head to directly shine on the photoresistor of the light intensity detection circuit. If someone passes through the door, the laser emitted by the laser head will be blocked, causing the light intensity on the photoresistor to change, thereby generating a signal to supply the microcontroller. The principle diagram is shown in Figure 3.
Figure 3 Counter installation diagram
1. 4 Output drive circuit
To control a fluorescent lamp with an AC voltage of 220 V, a relay must be used to isolate strong and weak currents to ensure safety. The working voltage of the relay is DC 12 V. In order to prevent interference to the microcontroller system when the drive part is working, a photoelectric isolation is added after the output buffer unit 74HC244. The working coil of the relay will generate a back electromotive force when the power is off, and a freewheeling diode is required to prevent possible interference to the system.
1.5 Power module
The power supply circuit of this system is only briefly introduced because the technology is relatively mature. The AC 220 V is reduced to AC 15 V and 6 V through a transformer, then converted to DC through a rectifier bridge, and then filtered by capacitors and stabilized by LM317 to DC 5 V and DC 12 V for use by the microcontroller and relay.
2 Overall hardware circuit
The overall hardware circuit of the system mainly includes the following parts: light intensity detection, counting, infrared signal detection, photoelectric isolation part, output drive part, and display output part. The overall circuit is shown in Figure 4.
Figure 4 System overall circuit
The choice of single-chip microcomputer should be based on the object to be controlled. Since controlling fluorescent lamps will not take up too many input and output ports, and the program will not take up much space, the 51 series single-chip microcomputer can meet the requirements. The serial communication between the single-chip microcomputer and the computer uses the MAX232 chip, which is a low-power level conversion chip designed specifically for the computer's RS-232 standard serial port.
Isolation is very necessary for microcontrollers working around strong electricity, which can reduce the interference of strong electricity changes on microcontrollers. The photoelectric isolation chip TLP521-4 is an optocoupler device that can achieve signal isolation between the front end and the load end, which can enhance the safety of the circuit and reduce interference.
The output driver uses 74HC244 and ULN2003 chips.
Both chips have the function of enhancing the loading capacity of the microcontroller.
The display part consists of two 8-segment LED digital display tubes, which show the real-time number of people in the classroom.
3 System Programming
From the perspective of energy saving, the system can control the lighting conditions in the classroom according to the light intensity, the number of people in the classroom and the location of people.
Take the example of three lights in a classroom. When there is no external forced condition interruption, the light intensity is dim and the infrared sensor detects someone entering the classroom to turn on the lights. At first, when there is no one in the classroom, all lights will not be turned on. When the number of people is greater than 0 and less than 5, the lights in area 2 are forced to turn on. When the number of people is greater than or equal to 5 and less than 9, the position of the people detected by the infrared sensor is used to determine which area to turn on. When the number of people is greater than or equal to 9, all lights are turned on. When the number of people decreases to less than 9 and greater than or equal to 5, the infrared detection of area 3 for a period of time to see if there is anyone, the lights in area 3 will be turned off if there is no one, and the lights in area 1 will be turned off if there is someone. When the number of people is less than 5, all lights except for the number 2 lamp will be turned off.
When the number of people reaches zero, all lights go out.
When there is an external interrupt, one interrupt will light up all the lights, and another interrupt will restore them to their original state. The program flow chart is shown in Figure 5.
Figure 5 Program flow chart
4 Conclusion
After the final test, the system can meet the design requirements and has broad application prospects. It is not only suitable for classrooms, meeting places, waiting rooms and other places where people gather, but can also be used as a building lighting control system. With just a little change, it can adapt to lighting control in many occasions. In the future, multiple systems can be centrally controlled by the host computer, and the power coordination and distribution function can be added to better achieve the purpose of saving power.
Previous article:Analysis of Counter PWM Design Scheme
Next article:Is an Android phone plus a Bluetooth expansion circuit equivalent to an oscilloscope?
- Popular Resources
- Popular amplifiers
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- MCU Principles and Interface Technology C51 Programming (Edited by Zhang Yigang)
- Quick Reference Manual for Common Electrical Technical Data
- Principles and Applications of Single Chip Microcomputers (Second Edition) (Wanlong)
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- TI MCU has launched a new product! August live broadcast reveals new features video replay summary!
- Please restore the number of invitees to 8. Thank you. Thank you. I invited 8 people before, but there are already 6 people in the list.
- Experts talk about IPC7351
- 5G commercial use is on the way, are you ready?
- Chat with Vicor engineers about efficient power supply and learn about modular power solutions for drones!
- Download the practical guide - Motor Control Basics
- DDR4 signal reference power layer, will the impedance have any impact?
- Right leg drive circuit
- Crazy Shell AI open source drone serial port (visual data acquisition)
- Questions about adjustable color temperature LED lamp circuit