In today's society where the global energy crisis is prominent, LED lighting has become one of the most promising lighting methods with its advantages of green environmental protection and high efficiency and energy saving. LED is known as the "fourth generation light source of green lighting" and has gradually been applied to telecommunications, transportation, agriculture, medicine, military and other fields. LED (Light-emitting Diode) is a solid-state semiconductor component that can directly convert electrical energy into light energy. As a solid lighting source, LED has the characteristics of long life, high light efficiency, and multiple light colors. It can work under safe low voltage, and can also be continuously switched on and off, and can achieve 0% to 100% dimming.
This paper describes a design scheme for an automatic measurement and control LED energy-saving lighting system based on the single-chip microcomputer C8051F020. The system can regulate the luminous intensity of LED lamps. When the ambient light intensity decreases, the luminous intensity of LED lamps is automatically increased, and when the ambient light intensity increases, the luminous intensity of LED lamps is automatically reduced, maintaining the stability of the ambient light intensity value and achieving energy-saving effects. At the same time, the system also has three types of sensor switches to control the on and off of LED lamps: light intensity, temperature, and infrared. In addition, overvoltage and overcurrent protection measures are added to further improve energy-saving efficiency and ensure the normal operation of the lighting system. In addition, the system also uses liquid crystal to realize the external display of LED lighting working information. The system can be applied to many occasions such as corridor lighting, work lighting, equipment lighting, etc.
1 Overall design plan
This system uses the single-chip microcomputer C8051F020 as the core to realize the automatic measurement and control of LED lighting. The overall framework of the system is shown in Figure 1.
The design of the whole system is divided into hardware design and software design. The hardware design can be divided into three parts: power supply drive module, automatic measurement and control and display module.
The process of power supply drive module is as follows: 12~24 V DC power supply input, after passing through the overvoltage protection circuit, provides safe voltage to the LED drive circuit composed of SN3350 chip, and the drive circuit drives the LED lighting to work normally. The automatic measurement and control and display module mainly includes light intensity sensor, temperature sensor, infrared wireless sensor and LCD display. The light intensity sensor uses silicon photocell and integrated operational amplifier to form a photoelectric conversion circuit, which converts the light intensity in the environment into a voltage signal. After the A/D conversion of the single-chip microcomputer, the corresponding voltage value is converted into illumination according to the relationship curve between the measured voltage and light, and is displayed through LCD1602 liquid crystal; the temperature sensor uses the DS18B20 chip circuit to convert the real-time ambient temperature into an electrical signal and transmit it to the single-chip microcomputer for analysis and processing, and is also displayed through LCD1602 liquid crystal; the infrared wireless sensor uses a pyroelectric infrared wireless sensor circuit with BISS0001 as the core. After the sensing circuit receives the signal, it transmits it to the single-chip microcomputer to control the switch of the LED lighting.
The system realizes energy saving and automatic measurement and control functions by the single-chip microcomputer C8051F020. The idea of software programming is: the PWM signal generated by the single-chip microcomputer controls the ADJ pin of the SN3350 driver chip. By changing the duty cycle of PWM, any voltage can be input to ADJ, thereby controlling the switch and brightness adjustment of the LED lighting.
2 Hardware Circuit Design
2.1 Single-chip Microcomputer C8051F020
This system uses the single-chip microcomputer C8051F020, which contains the CPU core of CIP-51 and the instruction system is fully compatible with MCS-51. It contains 64 kB on-chip Flash program memory, 4 352 B RAM, 8 I/O ports with a total of 64 I/O lines, 1 12-bit A/D converter, 1 8-bit A/D converter, and 1 dual 12-bit D/A converter, 2 comparators, 5 16-bit general-purpose timers, a programmable counter/timer array of 5 capture/compare modules, a watchdog timer, a VDD monitor, and a temperature sensor. The C8051F020 microcontroller supports dual clocks and has an operating voltage range of 2.7 to 3.6 V (the voltage resistance of the port I/O, RST, and JTAG pins is 5 V).
2.2 LED drive circuit
This system uses the SN3350 chip as the core of the LED drive circuit. The SN3350 is a step-down inductive current continuous mode driver chip suitable for applications where the power supply voltage is higher than the voltage required by one or a string of LEDs. The chip has an input voltage range of 6 to 40 V, an output current of up to 750 mA, and an output power of up to 30W. Figure 2 shows the LED drive circuit used in this system.
In Figure 2, pin 3 ADJ is a multi-function switch/brightness control pin, and its pin characteristics are:
1) Pin floating: working in normal mode. (In normal mode, VADJ=VREF=1.2 V, working current IOUTnom=0.1/R1);
2) Input voltage is lower than 0.2 V: turn off output current;
3) Input DC voltage is from 0.3 to 1.2 V: output current adjustment range is from 25 to 100%;
4) Output current is controlled by PWM signals with different duty cycles;
5) When the ADJ pin voltage exceeds 1.2 V: the current is automatically clamped at 100%.
The output current of SN3350 can be set by adding a control signal to the ADJ pin. This system uses a single-chip microcomputer to generate a PWM signal and input it to the ADJ pin. The drive circuit enters different working modes at different voltage values according to the above pin characteristics.
2.3 Light intensity sensor
The light intensity sensor of this system uses a photoelectric conversion circuit, and its schematic diagram is shown in Figure 3. The function of the circuit is to convert the current output by the silicon photocell (equivalent to a light-controlled constant current source) into a voltage signal output through the integrated operational amplifier LM324 and the feedback resistor Rf. By adjusting the value of Rf, the output voltage value can be changed, so as to meet the requirements of the input signal voltage value of the subsequent control circuit. In practical applications, the light intensity affects the size of Is, which in turn causes the change of Vout, thereby realizing the conversion of the light intensity signal into a voltage signal.
Table 1 and Figure 4 show the illuminance-voltage relationship measured using an illuminance meter and a voltmeter in an actual photoelectric conversion circuit.
As shown in Figure 4, as the ambient light increases, the output voltage of the photoelectric conversion circuit also increases linearly, with a correlation of 99.1% and good linearity. This shows that the actual test results of the photoelectric conversion circuit made according to Figure 3 are in good agreement with the theoretical expectations. At the same time, the illuminance-voltage relationship straight line in Figure 4 also provides an important basis for the program design of the software part.
2.4 Infrared wireless sensor
The infrared wireless sensor of this system adopts a pyroelectric infrared wireless sensor circuit with BISS0001 as the core. BISS0001 is a digital-analog hybrid special integrated circuit composed of an operational amplifier, a voltage comparator, a state controller, a delay timer, and a blocking time timer. The pyroelectric infrared wireless sensor with BISS0001 as the core adopts a passive detection method, and its circuit principle is shown in Figure 5. The Fresnel lens (DSG) receives the infrared rays with a wavelength of 8 to 12 μm emitted by the human body entering the detection area, and converts the optical signal into an electrical signal through the pyroelectric sensor (PIR), which is amplified and filtered by the circuit system and finally outputs the signal.
2.5 Other circuit modules
There are two simpler circuit modules in this system: overvoltage protection circuit and temperature sensor circuit.
The significance of overvoltage protection is that when the internal voltage stabilization loop of the switching power supply fails or the output overvoltage phenomenon is caused by improper user operation, the overvoltage protection circuit can protect to prevent damage to the subsequent electrical equipment. In addition, a self-recovery fuse can be connected in series in the system power supply circuit to play the role of overcurrent protection.
The temperature sensor of this system uses the digital temperature sensor DS18B20 from Dallas Semiconductor. This is the world's first temperature sensor that supports the "one-line bus" interface. The circuit using DS18B20 as the temperature sensor is very simple, and the 9-bit temperature signal is directly transmitted to the microcontroller for processing via a bus.
3 Software design
The idea of software design is to design the modules independently first, and then comprehensively organize the modules. The flowchart of the program design of this system is shown in Figure 6.
The program is mainly divided into five modules: brightness control module, temperature detection processing module, light intensity detection processing module, infrared wireless detection processing module, and liquid crystal display module. The first three more complex modules are described below.
1) Brightness control module According to the pin characteristics of the given LED driver circuit chip SN3350, the brightness of the LED can be controlled by controlling the voltage of the signal of the ADJ pin. The single-chip computer 80C51F020 can generate a PWM signal of Vpp=5 V by itself, so the brightness of the LED lamp can be controlled by controlling the duty cycle of the PWM signal. According to the light intensity-voltage relationship straight line in Figure 4, the judgment program is set to obtain the corresponding duty cycle, and the brightness control can be achieved.
2) Temperature detection processing module Since the signal output pin of the DS18B20 chip outputs a digital signal, the content of this module is mainly to decode the digital signal obtained from the DS18B20 to obtain the actual ambient temperature value.
3) The light intensity detection processing module uses the photoelectric conversion circuit in Figure 3 to detect the ambient light intensity and output a voltage signal. This signal is an analog signal, so it needs to be converted to digital before it can be processed by a single-chip microcomputer. Using the A/D conversion module built into the 80C51F020, analog-to-digital conversion can be achieved. The voltage signal corresponding to the light intensity is between 0 and 2.4 V, so a certain voltage value is converted into an 8-bit digital signal, and then the light is controlled through processing similar to the temperature signal.
According to the ADJ pin characteristics of the SN3350 driver chip control terminal described in Section 2.2 of this article, the specific program design scheme is as follows:
Automatic adjustment and control of LED lights with external environmental illumination: When the actual illuminance measured is greater than 2 000 lx (the illuminance value can be set according to needs, the same below), the input voltage of the ADJ pin is set to 0, and the LED is off; when the actual illuminance measured is less than 1 000 lx, the input voltage of the ADJ pin is set to 0.3 V, and the LED is on; when the actual illuminance measured is greater than 1 000 lx and less than 2 000 lx, the input voltage of the ADJ pin is set to change accordingly between 0.3 and 1.2 V.
Automatic adjustment and control of LED lights with external environmental temperature: When the temperature of the LED is greater than 80℃ (the temperature value can be set according to needs, the same below), VADJ=0; when the temperature of the LED is less than 50℃, VADJ=1.2 V.
The LED light is automatically adjusted and controlled according to the external infrared radiation signal: when the pyroelectric infrared wireless sensor sends a sensing signal, VADJ=1.2 V, and when no signal is sent, VADJ=0.
4 System test
4.1 Basic working test
The power supply is 15 V; the working voltage at both ends of the three LED lights is 14V; the output current of the drive circuit is 320 mA; when the overvoltage protection test adjusts the input voltage to be greater than 24 V, the voltage at both ends of the LED drops quickly; when the input voltage rises to 27V, the voltage at both ends of the LED has dropped to 0V.
The test results show that this system can work normally and stably under low voltage conditions and has overvoltage protection function.
4.2 Functional test
1) Measurement and display function
Can the ambient light intensity be displayed: Yes, the LCD can display the ambient light intensity accurately to 1 lx;
Can the ambient temperature be displayed: Yes, the LCD can display the ambient temperature accurately to 0.1℃;
2) Automatic control function
Can the light be turned on and off when the light intensity changes: Yes, the light will be automatically turned off when the light intensity is greater than 2170 lx; the light will be automatically turned off when the light intensity is less than 1040lx (the design thresholds are 2000lx and 1000lx respectively); Can the
light be turned off when the temperature changes: Yes, the light will be automatically turned off when the temperature is higher than 82.5℃;
the light will be automatically turned on when the temperature is lower than 49.3℃ (the design thresholds are 80℃ and 50℃ respectively);
Can the ambient light intensity be maintained basically stable: Yes, when the ambient light intensity decreases but is not less than 1000 lx, the luminous intensity of the LED is automatically increased; when the ambient light intensity increases but does not exceed 2000 lx, the luminous intensity of the LED is automatically reduced;
Can the light be sensed and turned on and off by infrared radiation: Yes, when someone enters a certain distance (maximum radius 3.5 m), the light will be automatically turned on, and the light brightness will be gradually reduced after 10 s until it is turned off.
The test results show that the system has the function of automatically controlling the switch and adjusting the light intensity according to the changes of ambient light intensity, temperature and infrared radiation, and the measured data is in good agreement with the theoretical design value.
5 Issues that need to be paid attention to in the design process
The characteristic of this system is that there are many hardware module circuits, and attention should be paid to the common ground and interface matching during design. Specifically, the six modules of the single-chip microcomputer C8051F020, the SN3350 chip of the LED driver circuit, the integrated operational amplifier LM324 in the photoelectric conversion circuit, the core BISS0001 chip of the pyroelectric infrared wireless sensor circuit, the DS18B20 temperature sensor circuit and the overvoltage protection circuit must share the same ground with the DC power supply. The interface matching problem mainly exists between the output ports of the three sensors of light intensity, infrared radiation and temperature and the input ports of the single-chip microcomputer, and between the output ports of the single-chip microcomputer and the control pins of the LCD LCD1602 and the LED driver chip SN3350. In addition, since the operating voltage of chips such as LM324, BISS0001, and DS18B20 is 5 V, which is lower than the 15 V operating voltage of the LED lighting system, a 5 V power supply must be connected during testing. When actually making the finished product, a level conversion circuit must be added to convert the unified 15 V power supply voltage into a 5 V regulated output for the relevant chips.
When writing the program, the priority of the information transmitted by each sensor being processed by the microcontroller must be considered. According to actual needs, the reference priority order of the received signal of this system is: temperature signal, infrared signal, and light intensity signal.
6 Conclusion
The LED lighting system designed in this paper uses the microcontroller C8051F020 as the control core, and realizes the functions of automatic switching and brightness adjustment according to changes in ambient light intensity, infrared radiation, and temperature conditions, highlighting the advantages of LED energy-saving lighting, and thus has a good practical reference value. The biggest feature of this system is its high functional integration, integrating measurement, control, and display, including three sensors: light intensity, infrared radiation, and temperature. In practical applications, relevant thresholds can be set or a certain function can be highlighted according to different needs. For example, when it is used in corridor and toilet lighting, the infrared radiation sensing function is mainly used. The lights will not turn on when no one is there, and will turn on when someone is there, thus achieving the effect of saving electricity. When it is used in office and classroom lighting, the light intensity sensor and dimming function are mainly used to stabilize the ambient light intensity at a certain set value. The lights will not turn on or be dim during the day and will be on at night, thereby improving the energy utilization rate. When it is used in smart desk lamps and workpiece processing table lighting, the working temperature can also be monitored (for example, the light will turn off when it exceeds 80°C); and so on.
Previous article:Design of CAN bus system for a certain vehicle model based on single chip microcomputer
Next article:Design of a new energy-saving fluorescent lamp system based on single-chip microcomputer
Recommended ReadingLatest update time:2024-11-17 02:33
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- DSPF28335 source code about SPWM
- How to write printf macro switch
- Start with a Routine
- Share a reference book on servo motor drive
- Is FPGA a big deal in the field of artificial intelligence?
- 【GD32F310G-START】Voltage meter
- C language algorithm to calculate the age of beautiful women
- LOTO virtual oscilloscope about trigger sensitivity function
- [ST60 short-distance test] Part 2: Communication rate test
- PT4115 cannot be completely shut down