Design of intelligent lighting controller based on LPC2104

Publisher:Jinghua6666Latest update time:2007-01-19 Source: 国外电子元器件Keywords:wireless Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

With the improvement of people’s quality of life, lamps are no longer just basic indoor lighting tools, but also a practical art for architectural decoration. When there are various lamps in the home, they must be carefully matched together. Achieving the most suitable atmosphere effect is a need for high-quality life. At present, lighting control is mainly manual, and all lamps are controlled one by one. This is not only troublesome but also inefficient, and does not meet the standards of modern comfortable life.

Therefore, designing an intelligent lighting system that can easily control lights and also provide scene combination and other functions not only has practical value, but also has broad market prospects.

2 Design Goal

: Design an intelligent lighting controller that can be installed in every room of the home to provide rich functions such as wireless remote control, light-touch lighting control, scene combination, and preset storage. Use the handheld remote control to control all the lights in the house; use the scene setting button on the remote control to easily set the lighting scene and quickly switch. You can control the switch and brightness of the light, or multiple lights, through the touch button on the panel. The lights enter a certain preset scene, and each lighting controller communicates with the home Ethernet network terminal through the RS485 bus to realize remote control and query of the light brightness.

The intelligent lighting control system is divided into two parts: receiving external control signals and executing control operations. In order to receive control signals, the system needs to have a wireless receiving function and a key input panel. In order to control the lamps, a 220V dimming control circuit needs to be designed.

LPC2104 has rich peripheral interface resources, high reliability and computing speed, and is very suitable for the design of this system. The principle of the intelligent lighting controller is shown in Figure 1.

3 LPC2104 Function Introduction

LPC2104 is a cost-effective microcontroller solution specially provided by PHILIPS for embedded applications. It adopts ARM's 16-bit/32-bit RISC structure. The core is ARM7TDMI-S. The CPU operating frequency can reach 60MHz. On-chip integration: 128KB Flash program memory with ISP and IAP functions, 16KB static RAM, 2 UARTs, 1 I2C serial interface, 1 SPI serial interface, up to 6 output PWM, 2 timers, each with 4 capture/compare channels, real-time clock and watchdog timer, etc., can be connected with commonly used peripheral devices To achieve seamless connection and powerful functions, this article uses LPC2104 as the core to design an intelligent lighting controller with simple structure and stable performance.

4 Wireless data transmission module design

4.1 Introduction to nRF401

There are three options for realizing wireless communication: Bluetooth communication, infrared wireless remote control, and the use of short-range wireless data transmission devices. For Bluetooth solutions, transmission distance and device cost are issues worth considering. Bluetooth is mainly used for short-distance transmission (up to 10m), and the cost has always been on the high side. Although infrared transmission does not need to consider the cost issue, from the perspective of the power consumption that handheld devices can provide, the distance it can transmit is too short, only a few meters, and there are certain requirements for the infrared emission angle. There are two "must ensure the transmission of information" "The devices are facing each other, and there can be no obstacles in the middle" and other fatal flaws. Compared with the first two solutions, the use of short-range and low-power wireless radio frequency device nRF401 is the best choice.

The nRF401 wireless communication transceiver integrates functions such as high-frequency transmission/reception, PLL synthesis, FSK modulation/demodulation and multi-channel switching. It has outstanding technical advantages in low-cost digital communication applications. Its main technical features are: (1) Works on two internationally common channels: 433.92MHz and 434.32MHz, which can be used without channel application; (2) Using DSS+PLL frequency synthesis technology, the external components are only a crystal oscillator and several resistors, capacitors and inductors , it can work basically without debugging and has good stability; (3) Digital communication adopts the FSK modulation method with high anti-interference ability, supports direct data input and output operations, and can be directly connected to the UART serial port of the MPU; ( 4) There are 2 selectable working channels, using half-duplex working mode, the maximum data transmission rate can reach 20bk/s; (5) The working voltage is 2.7V-5V, and the power consumption in standby state is only 8μA, which can meet the requirements of low Requirements for power consuming devices.

The nRF401 device does not require initialization and configuration, does not require Manchester encoding of data, and can use cheap PCB antennas without complex RF circuit design and debugging, making product development and application more convenient.

4.2 Connection between nRF401 and LPC2104

There are many options for connecting nRF401 and LPC2104, such as GPIO, I2C, UART, etc. From the perspective of the simplest hardware connection and communication protocol, it is the best solution to choose the serial port to connect to the wireless module. TXD1 and RXD1 of UART1 are respectively connected to DIN and DOUT connections of nRF401. The interface circuit between nRF401 and LPC2104 is shown in Figure 2.

As can be seen from Figure 2, the control interface of the embedded CPU to the wireless module mainly consists of 5 signal lines, namely DIN, DOUT, TXEN, PWR_UP, and CS. Among them, TXEN is the transmission enable terminal. By setting and resetting TXEN, the transmission state and the reception state are switched and controlled through the GPIO port. PWR_UP is the energy-saving control terminal. It is programmed using a GPIO port of LPC2104 to achieve Switching between the working mode and sleep state of the wireless module; CS can select channels, and through GPIO settings, the UART1 serial port of LPC2104 can be used to control DIN and DOUT signals.

In order to save energy, nRF401 should be turned off in most cases. The wireless hardware does not have an automatic wake-up function. A reasonable communication protocol must be adopted through software to ensure energy saving without data loss.

5 The dimming control circuit design

uses the method of sinking current through the I/O port of the microcontroller to control the thyristor to achieve switching and dimming control. The photoelectric coupler MOC3041 with an internal zero-crossing detection circuit is used as the thyristor driver, which can simultaneously realize the isolation of strong and weak currents.

Traditional dimming methods use phase-shifted trigger thyristors to control the output power by controlling the conduction angle of the thyristor. Not only is the synchronous detection circuit complex, but also high-order harmonic interference will be generated at the moment the thyristor is turned on, causing grid voltage waveform distortion and affecting The normal operation of other electrical equipment and communication systems. In this system, the time ratio between the on and off time of the zero-crossing trigger thyristor is used to adjust the power of the lamp. Since the zero-crossing trigger does not change the voltage waveform, it only changes the full wave of the voltage passing through. times and will not cause pollution to the power grid. Therefore, this system adopts the zero-crossing trigger method.

MOC3041 contains an internal zero-crossing detection circuit. When input pin 1 inputs a 15mA current and the voltage between output pins 6 and 4 slightly crosses zero, the internal bidirectional thyristor is turned on, triggering the external thyristor to turn on. When MOC3041 When the input current of the input pin is 0, the internal bidirectional thyristor is turned off, and the external thyristor is also turned off. The dimming control circuit is shown in Figure 3.

6 Wireless module software design

The wireless module is connected to the system through the UART serial port, so the UART must be initialized. The UART serial port of LPC2104 complies with the RS232 standard and also supports the 550 industrial standard.

LPC2104 has two general-purpose asynchronous serial interfaces (UART). The UART default state is unavailable at startup, and they must be enabled by programming the GPIO register.

This system uses UART1 to connect with nRF401. UART1 has a modem interface and 16-byte receive and transmit FIFO. Built-in baud rate generator and contains standard modem interface signals.

When using UART1, you must first set the TXD1 and RXD1 pin connection methods, and then set the baud rate and working mode of the serial port to send and receive data. This system uses an 11.0592MHz crystal oscillator and is not suitable for PLL and VPB. Divide by 4, set the UART1 baud rate to 9600bit/s, then the divisor value N=18, which is 12H. The initialization procedure of UART1 is as follows:

In the operating system environment, the serial port will be automatically initialized when the system starts, so the application Calling serial port resources will become easier. It is worth noting that applications are often multiple systems. In order to monitor serial port messages in real time, a separate serial port scanning task is generally opened in the operating environment to ensure that information is not lost. , add the serial port register initialization code in the main function of an existing project file, and add the serial port scanning task. Since the wireless module is controlled by the system GPIO, the scanning program also includes the I/O When the system receives the serial port information, it will actively send a serial port information to the main task. When the main task receives the information, it will call the response function to respond to the message.

7 Conclusion

The wireless communication module nRF401 integrates transmitting and receiving, which greatly simplifies the complexity of lighting controller design. Intelligent lighting controllers can easily be networked through the RS485 interface, which provides convenience for realizing smart home networking.

Keywords:wireless Reference address:Design of intelligent lighting controller based on LPC2104

Previous article:Design and implementation of a liquid crystal display based on DSP control
Next article:LED drive control design based on TPIC6B273

Recommended ReadingLatest update time:2024-11-17 02:55

Developing Battery-Powered Devices Using Windows Embedded Standard
As 32-bit RISC systems become more powerful, the desktop x86 architecture is also gradually reducing its power requirements. Today, both platforms can be used to design battery-powered mobile devices. However, when desktop applications are actually used in mobile devices, some special considerations are required, an
[Power Management]
Developing Battery-Powered Devices Using Windows Embedded Standard
In-depth analysis: Wireless charging technology Qi Wireless Charging Qi
Smartphones are changing our lives day by day, both online and offline. However, with the continuous increase of new features, the battery life has not kept up. Whenever the phone issues a "sad" low-battery warning sound, the most annoying thing is to jump around to borrow a charger... What if you don't like this? Ima
[Power Management]
In-depth analysis: Wireless charging technology Qi Wireless Charging Qi
Building QT/Embedded4.8.5 development environment on s3c2410 (Part 4)
【Target board】s3c-2410 CentOS6.4 kernel-2.6.32 【Compiler】gcc-4.4.6 Currently, among the 4.8.5 versions on the QT official website, Qt libraries 4.8.5 for Linux/X11 (230 MB) (Info) and Qt libraries 4.8.5 for embedded Linux (230 MB) (Info) are actually the same source code package, but you can use different compi
[Microcontroller]
Latest Power Management Articles
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号