Automatic measurement and control of LED energy-saving lighting system based on single-chip microcomputer C8051F020

Publisher:rnm888Latest update time:2011-03-23 Keywords:C8051F020  led Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Keywords:C8051F020  led Reference address:Automatic measurement and control of LED energy-saving lighting system based on single-chip microcomputer C8051F020

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

LED display screen control system based on single chip IAP technology
LED display screen has become a new generation of information dissemination media tool due to its low power consumption, long service life, low cost, high brightness, few faults, wide viewing angle, and long viewing distance. Compared with LCD, the most prominent feature of LED is high brightness, low cost, and the scr
[Microcontroller]
LED display screen control system based on single chip IAP technology
Using variable duty cycle to achieve dimming of LED driver circuit
Pulse Width Modulation (PWM), short for "Pulse Width Modulation", is a very effective technology that uses the digital output of a microprocessor to control analog circuits. It is widely used in many fields from measurement, communication to power control and conversion. PWM rectifier is a new type of power converter
[Power Management]
Using variable duty cycle to achieve dimming of LED driver circuit
Application of C8051F020 single chip microcomputer in online automatic analyzer of total phosphorus
1 Overview The C8051FOXX series of single-chip microcomputers is a new mixed-signal system-level single-chip microcomputer launched by Cygnal. This series of single-chip microcomputers contains the CPU core of CIP-51, and its instruction system is fully compatible with MCs-51. Among them, the C8051F020 single-chip m
[Microcontroller]
Application of C8051F020 single chip microcomputer in online automatic analyzer of total phosphorus
IoT and LED may be the main direction of intelligent lighting
With the maturity of LED technology, IoT LED integration has become the main direction of future development of intelligent lighting. IoT and LED are two strategic emerging industries. If they are combined, they can bring very good application effects.   The combination of the Internet of Things and LED lighting is
[Analog Electronics]
IoT and LED may be the main direction of intelligent lighting
Design of campus LED bulletin board system based on ARM
    In recent years, LED electronic display screens have attracted increasing attention as a high-tech product. They can display text, graphics and image information in real time or in a loop. They have many advantages, such as rich display modes, strong viewing, convenient display content modification, high brightness
[Microcontroller]
Design of campus LED bulletin board system based on ARM
Engineer sharing: the whole process of making LED driver power supply
Design and manufacturing method of LED fluorescent lamp power supply I am engaged in switching power supply. I used to make adapters, chargers, and iron-shell switching power supplies. Later, I made LED power supplies. At first, I made some 1W and 3W high-power LED drivers, but later I made less. The reason i
[Power Management]
A brief analysis of the connection method when multiple LEDs are used together
   LED is a solid semiconductor light source based on the principle of electroluminescence, with many advantages such as rich colors, compact size, high brightness, long life, low operating voltage, safe use, fast response, 0~100% adjustable light output, impact and vibration resistance, no ultraviolet and infrared r
[Power Management]
ON Semiconductor's advanced LED driver solutions for different applications
Today, high-brightness LEDs have been comprehensively improved in terms of light output, energy efficiency and cost. They also have many advantages such as compactness, low-voltage operation and environmental protection, and their application scope is constantly expanding. In the future, LED lighting will have par
[Power Management]
ON Semiconductor's advanced LED driver solutions for different applications
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号