- Home >> Technical Service >> MCU
Intelligent study lamp system design
Design of intelligent study lamp system based on single chip computer
In the current society, students have heavy learning tasks, and they spend a long time with desks and books every day. When night falls, when the light is not enough on cloudy days, they need a suitable desk lamp. This light has a suitable brightness and can protect their eyesight. When they are studying seriously, they don't need to pay attention to whether the light is suitable; when they have something to leave and forget to turn off the light, the light will automatically turn off. Therefore, we need an intelligent desk lamp to help children learn better and more comfortably.
The times are constantly advancing, and at the same time, science and technology and people's living standards are also constantly improving, and people's requirements for quality of life are also constantly improving. Intelligence is an important means to improve the quality of life, and it has become an inevitable trend. As early as a few years ago, the research and development and application of intelligent light control have been started abroad, and many intelligently controlled desk lamps have appeared in China, but people's requirements are constantly improving, and the design needs to be constantly adjusted and optimized. This design not only considers intelligent dimming, but also considers the situation that people forget to turn off the lights when they leave, and further optimizes the design to save energy.
1. The goal and design block diagram of the intelligent study lamp system design
1. Design tasks
The intelligent study light system of the single-chip microcomputer can detect the current light brightness in the study and whether there is anyone in the study in real time.
2. Design requirements
The photosensitive module collects the light brightness in the study, and the human body sensor module collects whether there are people in the study. The single-chip control system receives these two signals, compares them with the thresholds set in advance, and sends out control signals to control the lights in the study. The single-chip microcomputer achieves dimming control of the brightness of the light by adjusting the PWM second pulse.
3. Design block diagram
Design idea: sensor information collection→sensor information processing→single chip microcomputer control. This design is mainly composed of single-chip microcomputer control module, human body induction module, photosensitive module, relay module and LED lighting module.
2. Hardware design of intelligent study lamp system
This design is an intelligent study lamp design based on the STC89C52 single-chip microcomputer as the control core. The system is divided into automatic mode and manual mode.
1. STC89C52 microcontroller main control module design
The single-chip microcomputer control module is composed of the main control chip STC89C52 as the core, the minimum control system composed of the reset circuit and the clock circuit. STC89C52 single-chip microcomputer is a low-voltage, high-performance, 8-bit CMOS microprocessor, which can be erased and written more than tens of thousands of times. It has the advantages of simple programming, low price, and convenient use. This design uses a power-on reset and a 12MHz crystal oscillator clock circuit to form the smallest system.
Photosensitive circuit module: the AD8217 input terminal collects the voltage of GR1 terminal, performs A/D conversion, and sends the conversion result to the P2.7 port of the single-chip microcomputer through its OUT port, thereby completing the collection of indoor light brightness; infrared pyroelectric human body induction: Collect the high and low levels of the infrared sensor, and send the result to the P1.3 port of the single-chip microcomputer, so as to complete the judgment of presence or absence; relay control module: the P1.0 port of the single-chip microcomputer controls the relay, so as to realize the automatic control of the study lamp.
2. Human body sensor module design
The main function of the human body sensor module is to detect whether there are people. It adopts the human body infrared sensor HC-SR501, which has the advantages of high sensitivity, fast response, good stability, and long service life. It has a digital output interface connected to the main control chip to detect wavelengths. It is 10 μm, because the normal human body emits infrared rays with a size of about 10 μm. When the infrared ray of this wavelength is detected (that is, the person enters its sensing range), it will output a high level. When the infrared ray of this wavelength is not detected (that is, the person leaves the sensing range), it will automatically delay turning off the high level and output a low level. .
3. Photosensitive module design
The photoresistor GR1 is a component that is sensitive to light intensity, and different light rays will produce different resistance values on the component. The stronger the brightness, the lower the resistance value. With the increase of brightness, the resistance value keeps decreasing to below 1kΩ. When the brightness of the light becomes larger, its resistance value will become smaller, and the voltage value of the GR1 terminal will become lower at this time. The voltage of the GR1 terminal is collected by the ADC, and then the output signal is sent to the single-chip microcomputer. The single-chip microcomputer judges the range of the brightness and adjusts it. The brightness of the study lamp.
4. LED lighting module design
The brightness adjustment of the LED lighting module is automatically adjusted by PWM dimming technology. The principle of the PWM dimming method is that the single-chip microcomputer outputs a digital pulse signal with a certain duty cycle to control the driver, so that the driver works according to the set frequency, so as to control the switching speed, so as to realize the control of the average current of the LED and achieve the effect of dimming.
3. Software design of intelligent study lamp system
Software Design Ideas:
(1) The system has two working modes: manual mode and automatic mode; (2) The single-chip microcomputer control module recognizes external sensor signals; (3) Generates simple digital pulse signals (ie PWM pulse signals) through single-chip microcomputer programming to realize the adjustment of LED lights brightness changes. The manual and automatic modes of the system are switched by keys. When the system enters the automatic mode, the relay automatically controls to turn on the power switch, detects whether there is anyone through infrared detection, and detects the brightness through the photosensitive resistor. If no one is detected, the small light will go out after waiting for a certain period of time.
4. Realization and Results of Intelligent Study Lighting System
This design has two modes, manual and automatic, and all debugging will be carried out according to these two modes.
1. Manual mode
After the system is powered on, press the manual mode switch to enter the manual mode. In manual mode, several PWM pulse duty cycles are set in advance, and different duty cycles can be set through the number of keys to control the brightness of the lamp. The manual mode does not involve the application of the sensor, only the LED small light lighting system is applied, the procedure is simple, and the test is relatively successful.
2. Automatic mode
After the system is powered on, press the automatic mode switch to enter the automatic mode.
(1) Adjustment of different brightness: When testing the automatic mode, in order to make the test phenomenon more obvious, different shading cloths are used to cover the photosensitive sensor so that it can obtain different brightness. The brightness can be adjusted, and the debugging is successful.
(2) Test with and without people: After the system is started, the light is on, the inspector leaves the detection range, and the LED light is automatically turned off after the set time is reached; when the system is started, the light is on, the inspector leaves the detection range and reaches the set time. time, return to the detection range, and the LED light operates normally. Through the above tests, it is confirmed that the system can achieve the expected goal, that is, the brightness of the lamp can be adjusted manually, or the brightness of the lamp can be controlled automatically, and the power can be turned off in time, which not only protects the eyes, but also can turn off the light in time to save power.
Summarize
The design scheme in this paper is basically only a design on the principle level. Tested in the simulation software, the components and the environment in the simulation are ideal environments, without any major interference, and the working state of the circuit can achieve the effect of theoretical analysis. In the future, we will further improve the scheme proposed in this paper from the actual situation. According to the scheme designed in this paper, the design is made into a real object and tested in various environments to find out the problems of the scheme in different environments and optimize it to finally reach the optimal design of the scheme.
The above are the details of the design of the intelligent study lamp system based on the single-chip microcomputer introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things module. We have hardware design and software development capabilities. Covering circuit design, PCB design, single-chip microcomputer development, software custom development, APP custom development, WeChat official account development, voice recognition technology, Bluetooth development, wifi technology, etc. It can also undertake the research and development of smart electronic products, the design of household appliances, the development of beauty equipment, the development of Internet of Things applications, the design of smart home solutions, the development of TWS earphones, the development of Bluetooth earphone speakers, the development of children's toys, and the development of electronic education products.
- TOP