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
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.
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
- 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!
- 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
- Why can capacitors be used as isolation devices? What is the difference between capacitor isolation and transformer isolation?
- 【TI recommended course】#TI smart speaker solution full solution: speaker design "listens to you"#
- Corelinks SinA33 development board virtual machine compiles QT and Linux
- 1. Material unpacking and data link arrangement
- Code Composer C3x C4x version 4.10 installation package
- Help
- How to use GPIO of TI C55x series DSP
- Introduction to 5G R16 Standard Vertical Industry Extensions
- 【RPi PICO】CircuitPython driver ws2812
- dspIC30f6010a chip CAN communication and data processing