Abstract: Based on AVR single chip microcomputer, a LED remote control lighting system is designed. The design method of infrared receiving module and LED driving module, as well as the software program flow are given. After testing, the scheme is feasible and has certain application value.
Keywords: PWM; LED lighting; AVR
IntroductionLED
lighting has entered the home users. Compared with traditional lighting equipment (such as incandescent lamps and fluorescent lamps), it has the advantages of high purity of light source, diverse colors, high efficiency, and adjustable light intensity. Aiming at the problem that the brightness of traditional lighting is not easy to adjust and the switch position is fixed, this paper designs an LED remote control lighting system based on AVR microcontroller and proposes the method of driving and brightness adjustment of LED lighting.
1 Principle of LED lighting control system
The system schematic diagram is shown in Figure 1. When the infrared receiver receives the infrared remote control signal, the AVR microcontroller is awakened from sleep mode through an external interrupt; the AVR microcontroller starts to parse the infrared signal, and if it matches the system address, it will change the input of the LED constant current source driver according to the parsed command, thereby changing the state of the LED light.
2 System Hardware Design
2.1 Controller
The controller uses AVR microcontroller ATmega8. ATmega8 is an AVR microcontroller launched by Atmel in 2002, using a small pin package. ATmega8 integrates 8 KB of programmable F1ash, 512 bytes of EEPROM and 1KB of internal SRAM; 3 PWM channels, which can realize any PWM pulse width modulation output less than 16 bits, with adjustable phase and frequency; 1 programmable serial USART interface, supporting synchronous, asynchronous and multi-machine communication automatic address recognition; 5 power saving modes. In this system, the main function of the controller ATmega8 is to analyze infrared signals and control the LED driver.
2.2 Infrared receiving module
The main component of the infrared receiving module is IRM-2368V, which is often used in the remote control of home appliances such as home DVD, TV, air conditioner, etc. IRM-2368V has the following features: operating voltage is 2.4~6 V; high sensitivity, strong anti-interference ability; can directly extract remote control signal from carrier, output matching TTL, CMOS level, can be directly interfaced with single chip microcomputer; remote control distance can reach 12m. Figure 2 is the schematic diagram of infrared receiving module. PD2 is multiplexed as external interrupt INTO of ATmega8, and the power supply part uses 5 V power supply of the system.
2.3 LED driver module
The LED driver module uses the HV9910 integrated chip. It has the following features: high energy efficiency of more than 90%; wide voltage input of 8 to 450 V; adjustable output current from a few mA to 1A; can drive up to 100 LED lights; PWM current regulation. Figure 3 is the LED constant current source driver schematic, the drive circuit is a typical buck-boost converter design. The input power supply voltage Vin = 12V in the driver drives 3 to 6 350mA high-brightness LED lights.
When HV9910 is working, the internal oscillation frequency fosc is determined by the resistance on the pin Rosc. In this design, Rosc is 470 kΩ, and the switching frequency of the gate end of the MOSFET tube Q1 is set to 50kHz. Rosc and fosc satisfy the following relationship (the unit of Rosc is kΩ):
The voltage drop of each LED lamp is about 3 V when it is working. When there are 3 LED lamps connected in series at the output end, the driver output voltage Vled=91 V. It can be obtained that the control signal duty cycle D of the Q1 tube when the LED is working at full current is:
Q1's conduction time Ton=D/fosc=8.6μs, the output current Iled=350 mA, and the harmonic current is suppressed within 30%, then the value of the inductor L1 can be obtained by the following formula:
In this scheme, L1 actually uses 1 mH.
The feedback voltage on R1 is compared with the internal comparison voltage of HV9910 250 mV. If the feedback voltage is greater than 250 mV, Q1 is turned off. R1 can be calculated from the harmonic current relationship:
3 System software design
The system software flow is shown in Figure 4. After the system is powered on, it first reads the system status configuration and sets the working status of the LED light; then it enters the sleep mode, and the timer still works in the PWD state. The output port of IRM-2368V is connected to the PD2 port of ATmega8. In the sleep state, this port is configured as interrupt INT0; after the interrupt wakes up, the interrupt is turned off and the port is configured as an input port.
4 System Test
Under the condition of load (LED lamp), the experimental results of the set PWM duty cycle and load current are listed in Table 1. It can be seen that the output current is basically linearly proportional to the PWM signal duty cycle.
Conclusion
This solution uses infrared remote control to achieve good dimming control of household LED lighting. The advantages of ATmega8 and infrared remote control can be further utilized: ATmega8's three timers can be configured as three-way PWM output, that is, it can control three strings of LED lights, and can provide support for multi-color LED lighting and decorative lighting; ATmega8's powerful processing power can also provide strong support for personalized lighting solutions; in addition to sending control signals, the infrared transceiver system can also transmit the lighting control solution to ATmega8, and the system will be able to freely change personalized lighting solutions.
Previous article:High-speed data acquisition system based on AVR and CPLD
Next article:Design of a Presettable Programmable Broadband DC Power Amplifier Circuit Based on AVR Microcontroller
- 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
- 2020 Global Engineering Survey: Better understanding of engineers at work (first World Engineering Day)
- The college entrance examination is over, but we are still in the "high-school" mode
- 【Arduino】168 Sensor Series Experiments (211) --- WS2812B Ring 93 Light Module
- The dry goods in the jar are worth the quick surfing ANT series
- Matching of vivado version and modelsim version
- I have some questions about project handover (software) at work. I hope experienced seniors can give me some guidance.
- Learn about RF MEMS switches in one article
- CC2541 Bluetooth Learning-Clock Setting
- Dismantle ABC and CCB U-Shield
- How to view MSP430 technical data