Design of a new energy-saving fluorescent lamp system based on single-chip microcomputer

Publisher:糖果龙猫Latest update time:2011-03-23 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

With the development of society and the growth of population, energy conservation has become an important social issue. Fluorescent lamps are the most widely used lamps at present, but like most lamps, once turned on, no matter how strong the external light intensity is, they can only emit light of a single intensity, which causes energy waste. In response to this phenomenon, this paper proposes a new fluorescent lamp system based on a single-chip microcomputer. By collecting external light intensity information and using the AT89C51 single-chip microcomputer to control the output light intensity of the fluorescent lamp, the fluorescent lamp automatically adjusts the irradiation light intensity as the external light intensity changes, and achieves the purpose of energy saving while meeting the user's lighting requirements. The system has the characteristics of simple structure, high reliability and low cost, and can be widely used in school learning and family life.

1 Hardware circuit composition and working principle
1.1 System hardware structure
The system composition is shown in Figure 1. The system is divided into three parts: light collection, single-chip microcomputer control and automatic adjustment of fluorescent lamps. The light collection part is mainly composed of photoresistors, transistors and supporting circuits; the single-chip control part is mainly composed of AT89C51 single-chip microcomputer and its peripheral circuits, ADC0809 analog-to-digital converter; the fluorescent lamp automatic adjustment part system is mainly composed of optocoupler MOC3052, bidirectional transistor BT136 and its peripheral circuits. The light collection part senses the external light intensity through the photoresistor, and converts the change of external light intensity into the change of output voltage through the change of its resistance value. The single-chip control part converts the analog quantity of voltage into digital quantity through ADC0809, and outputs a PWM wave with controllable duty cycle after analysis and processing. The fluorescent lamp automatic adjustment part adjusts the voltage at both ends of the fluorescent lamp tube according to the PWM wave, and can achieve a high control accuracy (0.1 V) within a certain voltage range to achieve the purpose of controlling the irradiation light intensity.


1.2 Light intensity collection circuit
As shown in Figure 2, this design uses a base voltage divider emitter bias circuit, which consists of Vcc (5 V), base resistors R5, R1 and collector resistor R6. The transistor emitter is directly grounded, where R5 and R6 are ordinary resistors and R1 is a photoresistor. This circuit has good stability. The large resistance R5 is directly connected to the base of the transistor, which plays a strong role in controlling the base current and can effectively prevent the influence of resistance fluctuations caused by temperature and other reasons on the measurement results. The photoresistor directly receives external light intensity. The selected photoresistor spectrum peak is 540 nm, the bright resistance (10LUX) is 5~10 kΩ, and the dark resistance is 0.6 MΩ.


When the external light intensity increases, the resistance of the photoresistor R1 decreases, the current IR1 decreases, the base current Ib of the transistor decreases, and the collector voltage, that is, the output voltage IN0-BAK, increases. Similarly, when the external light intensity decreases, the output voltage IN0-BAK decreases. In this way, the transistor converts the current change caused by the change in light intensity into a voltage change output, which is connected to the input port of the ADC0809 digital-to-analog converter.
1.3 A/D conversion circuit design
This design uses the 8-bit analog-to-digital converter ADC0809. This chip is a typical 8-bit 8-channel successive approximation A/D converter, which can realize time-sharing conversion of 8 analog voltages. For the convenience of conversion, the reference voltage is set to 5 V, that is, when the analog input is +5.0, the ADC output is 0FFH, that is, 225, and the system resolution is 50/255=0.2V/LSB. The reference voltage is set to 5 V, and to ensure the accuracy of the conversion, it is provided by the LM7805 precision regulator.
The connection method of LM7805 is shown in Figure 3. J1 is connected to a 12 V ordinary DC power supply, C6 and C7 are used as input and output filter capacitors, C12 is the input resistor, and C3 is the load resistor.


1.4 Single-chip microcomputer circuit design
This system uses the AT89C51 single-chip microcomputer produced by Atmel. It is a low-voltage, low-power, high-performance CMOS 8-bit single-chip microcomputer with 8 kB rewritable program memory and 256 B data memory. The single-chip microcomputer and its necessary peripheral circuits, including the reset circuit and crystal oscillator circuit, are shown in Figure 4.


This system uses the built-in PWM module of AT89C51, and adopts pulse width modulation technology through the internal timer. The input terminals P2.0~P2.7 input 8-bit digital input quantity converted from the voltage of IN0-BAK terminal, and the square wave with different duty ratio is output from the P1.3 port. In this way, the change of the input external light intensity is converted into the change of the duty ratio of the output PWM wave.
1.5 Fluorescent lamp control circuit
As shown in Figure 5, this module is the core part. P1.3 is the PWM wave input, the high and low levels are 5 V and 0 V respectively, and R11 is a pull-up resistor, which plays a current limiting role. The SMD component is MOC3052, which is an optocoupler device used for effective isolation of weak current circuits and strong current circuits. J2 is connected to 220 V AC power supply, J3 is grounded, R10 is a fluorescent lamp resistor, and the two ends are connected to the live wire and ground wire of the fluorescent lamp respectively. R7 and R8 are symmetrical high-power resistors, which play a current limiting role.
When the input of P1.3 is low, the optocoupler MOC3052 is turned on, providing a conduction pulse for the bidirectional thyristor control electrode, and the bidirectional thyristor is turned on, playing a shunt role. Let the voltage across the resistor R10 of the fluorescent lamp be V12 at this time; similarly, when the input of P1.3 is high, the optocoupler is cut off, the bidirectional thyristor is cut off, and the voltage across R10 is V2. Among them, V2 a high voltage is required when the fluorescent lamp tube starts to ignite, a small current is allowed to pass when it is normally lit. At this time, the voltage across the lamp tube is lower than the power supply voltage. The power of the fluorescent lamp used in this experiment is 40 W. After measurement, the minimum starting voltage is 200 V, and the voltage requirement for maintaining stable brightness after normal lighting is 165~245 V, that is, the voltage controllable range is 165~245 V.

2 System software design
The main task of the system is to monitor the external light intensity in real time, and then control the opening and closing of the optocoupler by outputting PWM waves through the single-chip microcomputer to achieve the purpose of controlling the intensity of the fluorescent light. The focus of the system software design is on the programming of the single-chip microcomputer. The main program flow of the system is shown in Figure 6.


The microcontroller programming mainly includes initialization program, light intensity acquisition processing program and PWM wave output program. Initialization includes hardware initialization and timer initialization; light intensity acquisition processing mainly completes the conversion of externally acquired light intensity: interrupt delay and loop instruction are used to generate PWM wave. The following is a detailed analysis of each part.
First, the corresponding light intensity is sensed by the photoresistor and converted into a digital variable and transmitted to the microcontroller. The ADC0809 integrated in the microcontroller converts the light intensity analog variable into a digital variable (because ADC0809 is an 8-bit channel, its conversion range is 0 to 255), and the obtained 8-bit digital variable is input to AT98C51 from P2.0 to P2.7 ports. The program reads the 8-bit input and divides it by 255 to obtain the light intensity coefficient, which is represented by variable 1d here (variable range 0 to 1).
After obtaining the light intensity coefficient, this number is used as the duty cycle to output a PWM signal to control the photocoupler. This step is implemented in the program by calling the timer and setting the output port to P1.3. The period of the output square wave is set to 50 Hz based on the frequency of daily fluorescent lamps, because the light energy of 50 Hz frequency makes the human eye unable to feel the flicker of AC light. The time span of the positive wave is assumed to be 1s, so the time span of the negative wave is (1-1)s. The time span of the positive wave can be obtained by multiplying the light intensity coefficient by the period. In this way, the timer is set. First, the timer mode is adjusted to mode 0 in the program, a 12 MHz crystal oscillator is used, and it is called through an interrupt response.
According to the timing initial value = , t is the required timing time (ms), the initial value is calculated to be 5 ms, and then the timing process is performed with 5 ms as a cycle. Because the frequency is 50 Hz, the period is 0.02 s, so this timer needs to be cycled 4 times. This system synchronizes the number of cycles with the number of timer interrupts, that is, one timer interrupt counts as one cycle, so that the cycle length of 0.02s can be guaranteed.
The positive and negative nature of the output square wave can be determined according to the value obtained by multiplying the light intensity coefficient by 4. When the number of cycles is less than this number, the output is a positive wave, and when it is greater than this number, the output is a negative wave. In this way, a square wave with a frequency of 50 Hz and a corresponding light intensity coefficient can be output to control the photoelectric coupler. The microcontroller outputs the corresponding PWM wave from the P1.3 port. After receiving it, the system makes corresponding judgments and makes corresponding adjustments according to the duty cycle to determine the size of the output voltage. When the positive wave time span is greater than a certain value, it means that the light intensity is small and the light needs to be turned on. When the positive wave time span is less than the specified value, it means that the light intensity is large enough and the light does not need to be turned on. When the positive wave time span is within the specified range, the photosensitive lamp works normally.

3 System test
In the test, an independent light source with variable light intensity is used to illuminate the photoresistor (at a distance of 20 cm), and the light intensity gradually changes from dark to bright. Then the voltage at both ends of the fluorescent lamp is tested, and a photometer is placed 1 m away from the lamp to test the light intensity; a power meter is connected to the lamp to test the power. During the test, the only light source received by the photoresistor is the independent light source, and the only light source received by the photometer is the fluorescent lamp. The test data range is the range where the fluorescent lamp maintains a stable light intensity (170-245 V), and the number of measurements is 10. The test results are shown in Table 1. The light intensity data in the table is the average value of the 10 measurements by the photometer, and the power ratio is the ratio of the average power value of the 10 measurements to the power of the unmodified fluorescent lamp (40W).


It can be seen from the table that the new fluorescent lamp has significant energy-saving effect under the premise of satisfying the user's sufficient light intensity. After repeated debugging, the lamp is more sensitive to light intensity, has a larger range of luminous brightness, and is more stable in luminescence, which is suitable for wide use in daily learning and life.

4 Conclusion
This paper designs a new fluorescent lamp system based on a single-chip microcomputer to solve the problem of energy waste caused by the fixed light intensity of ordinary fluorescent lamps. This system collects and analyzes the external light intensity, and controls the light intensity of the fluorescent lamp through the single-chip microcomputer, so that it can make corresponding adjustments according to different external environments. Under the premise of meeting the user's light requirements, the power of the fluorescent lamp is greatly reduced, energy is saved, and it is suitable for promotion and use.

Reference address:Design of a new energy-saving fluorescent lamp system based on single-chip microcomputer

Previous article:Automatic measurement and control of LED energy-saving lighting system based on single-chip microcomputer C8051F020
Next article:Design of automatic temperature measurement and alarm system based on single chip microcomputer

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号