Application of AVR microcontroller in LED remote control lighting

Publisher:HeavenlyWhisperLatest update time:2011-01-25 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

7a.jpg

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.

7b.jpg 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.

7c.jpg


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Ω):
7d.jpg
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:
7e.jpg
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:
7f.jpg
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:
7g.jpg

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.

7h.jpg

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.

7i.jpg

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.

Reference address:Application of AVR microcontroller in LED remote control lighting

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

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号