Typical Case Development of Single Chip Microcomputer (4)

First, the design of intelligent LED street light controller based on STC microcontroller

Abstract: In order to fully save energy and improve the intelligence of street lamp control system, an intelligent LED street lamp controller based on STC single chip microcomputer is introduced. Online monitoring, PWM and power line carrier communication technology are introduced. The practical application effect is good, and the cost is low. Stable features. The controller is very helpful for intelligent street lamp management and has broad application prospects.

The current huge energy consumption and the resulting energy shortages and price increases have made saving energy a very urgent task. A large part of the energy consumed by countries is used for lighting. Among them, urban public lighting (mainly road lighting and landscape lighting) accounts for 30% of China's lighting power consumption. According to statistics, the annual electricity used for lighting is 300 billion kWh. Above, if LED lighting is used, it can save 1/3 of the lighting power every year, which is basically equivalent to the annual power generation of the Three Gorges Project with a total investment of more than 200 billion yuan. Combining the above advantages, LED light source has naturally become the first choice for urban public lighting. At present, the road lighting management system of most cities in China still uses traditional light control, clock control and other traditional control methods. These systems are generally difficult to feedback the status information of street lights, difficult to control remotely, etc., basically no power saving effect, and the use of traditional manual inspection, not only makes the task of the street lamp management department heavy, but also increases the cost of operation and maintenance. With these factors in mind, this paper developed a smart street light controller for LED light sources. Combined with the characteristics of LED light source, and introduced power line carrier communication technology, PWM dimming technology.

1 LED Technology Overview

1.1 Small and sturdy

The LED is basically a small chip that is encapsulated in epoxy, which is stronger than both the bulb and the fluorescent tube. There is no loose part in the lamp body, which is not easy to damage.

1.2 Low power consumption

In general, the working voltage of the LED is 2~3.6 V. The working current is 0.02~0.03 A. That is to say: it consumes no more than 0.1 W.

1.3 Long service life

When the luminous flux is attenuated to 80%, its lifetime reaches 25 000 h. The life of metal halide lamps is 6,000 to 12 000 h, and the life of high-pressure sodium lamps is 12 000 h.

1.4 Dimming function

Since the working range of the LED is large, its light output is proportional to the operating current, so it can be dimmed by reducing the current. The dimming of the LED can also be obtained by the pulse width adjustment method, and the luminous intensity of the LED is effectively adjusted by adjusting the duty ratio of the voltage and the operating frequency.

1.5 Environmental protection

LEDs are made of non-toxic materials, unlike mercury-containing fluorescent lamps that can cause contamination and LEDs can be recycled.

1.6 Light color, good color rendering

At the intermediate visual level, the human eye is more likely to distinguish things in a high color temperature environment than in a low color temperature environment. The color rendering of white LEDs is also much better than that of high-pressure sodium lamps. The color rendering index of high-pressure sodium lamps is only about 20, while white LEDs can reach 65~80.

2 How the system works

The intelligent LED street lamp controller is used as a reference for the intelligent street lamp control system. It is mainly composed of STC MCU, sampling circuit and carrier transceiver module. The commands of the host computer and the feedback of the controller are transmitted and received by the carrier module through the power line; the voltage and current of the street lamp are collected by the sampling circuit in real time; the single-chip microcomputer processes the collected voltage and current in real time, performs judgment processing, and judges the instruction of executing the upper computer at the same time. , timely feedback information on street lights.

3 hardware circuit design

3.1 Selection of main components and related performance

The STC12C5404AD microcontroller is a high-speed, wide-voltage, low-power, enhanced 8051 core microcontroller with up to 16 kbytes of on-chip Flash program memory and 512-byte on-chip RAM data memory. The STC12C5404AD has a 10-bit ADC channel capture/compare unit, six 16-bit timers, a hardware watchdog, a high-speed SPI communication port, and a full-duplex asynchronous serial port. Each general-purpose I/O port can drive up to 20 mA. Online programmable, no need for programmers, no emulators, remote upgrades, cost savings, and convenient for customers.

PL2102 is a low-voltage power line carrier communication chip specially developed for the harsh environment of China Power Network. It is powered by a single +5 V supply and an external interface circuit is coupled to the power line. In addition to the basic communication control functions, the PL2102 also has five commonly used function circuits: real-time clock circuit with digital frequency correction, 32 Bytes SRAM, voltage monitoring, watchdog timer and reset circuit. They are connected to an external microprocessor via a standard I2C interface, where the real clock and 32 Bytes SRAM can continue to operate with a 3 V backup battery when the mains supply is powered down. Due to the large-scale digital/analog mixed 0.35 μm CMOS process, it has outstanding performance in anti-jamming, anti-fading performance and performance and price ratio of similar products at home and abroad.

3.2 Communication technology features

The controller adopts the mainstream spread spectrum communication technology, which effectively improves the reliability of communication, and at the same time creatively adopts a dynamic routing algorithm to reliably extend the control range.

(1) Spread spectrum communication technology has a signal that occupies a bandwidth much larger than the minimum bandwidth necessary for the transmitted information. The broadening of the frequency band is achieved by means of coding and modulation, independent of the transmitted information data. The receiving end uses the same spreading code as the transmitting end to perform correlation demodulation, and recovers the transmitted information. According to Shannon's theory of channel capacity:

C=WLog2 (1 ten P/N).

Where: C is called channel capacity; W is the bandwidth; P/N is the power ratio of signal to noise. This formula shows that under the condition that the information capacity C is kept unchanged, there may be different W and P/N, that is, if the bandwidth is widened, the signal to noise of the channel can be relatively low, and the same channel capacity can be achieved ( Effective information transfer rate). Even in the case where the signal is flooded by noise, as long as the signal transmission bandwidth is increased correspondingly, the purpose of reliable transmission can be achieved. Spread spectrum communication is based on this principle.

(2) The dynamic routing method needs to establish a central routing table and a pheromone table in the concentrator, each terminal establishes a sub-routing table, and the concentrator and all terminals must establish respective electrical distance tables for recording other terminals that can directly communicate with them. Electrical distance. The algorithm mainly includes two parts: route discovery and route maintenance, which are described separately below.

Route discovery refers to finding and discovering routes according to certain rules, that is, the process of establishing a routing logic tree. The concentrator establishes a central routing table according to the response signal of the destination terminal, and other terminals continuously update their electrical distance table according to the calculated electrical distance value by receiving or listening to the signal on the power line, thereby adjusting the direct routing table to the node.

The carrier signal starts from the concentrator, and according to the constraints of the constraint set, the pheromone concentration Ï„i, j and the heuristic information of the problem, the next terminal is selected according to a certain strategy until reaching the target terminal. At the same time, the carrier signal returns according to the original path. After returning to the concentrator, the path quality is evaluated, and the global update rule is used to update the pheromone concentration on the iterative or global optimal path.

Since the power line channel environment changes slowly with time, the pheromone obtained in the pheromone table at an earlier time will gradually lose the effectiveness of representing the current environmental condition of the power line channel, so the pheromones of other paths are periodically volatilized according to a certain ratio. Mechanisms. At the same time, in order to avoid the stagnation of the search, the upper and lower limits of the concentration value of the pheromone on the path are set. When the obtained optimal path reaches the required accuracy, the route discovery is considered complete. The concentrator completes the route discovery process of each terminal by continuously issuing the path finding signal, and finally establishes a central routing table to each terminal.

In the algorithm, when the carrier signal selects the next node, the gas distance is used as the candidate set strategy of the constraint, and the routing principle of deterministic randomness is combined. First, set a threshold for the electrical distance that can be normally passed. When the electrical distance is greater than this threshold, the channel state is considered to be poor, and the two nodes cannot communicate directly.

From a large number of experimental results, the nodes near the maximum communicable distance are not stable in communication and are not suitable for use as relays. Therefore, the electrical distance is selected as the threshold [1/2, 3/4] in the algorithm. The node on this interval serves as a candidate set for the next node. At the same time, formula (1) is adopted as the selection strategy of the next node.

Where: pi,j(t) is the transition probability of the node numbered i to the node numbered j in the t-th iteration; τi,j(t) is the pheromone strength on the path (i,j) ;a is the pheromone adjustment factor; ηi,j is the electrical distance value from node i to node j; allowed is the next hop candidate node set of the carrier signal; q is the random distribution uniformly generated in the interval [0,1] Number; q0 is the probability metric threshold for selecting the next hop for the carrier signal. When q≤q0, the carrier signal selects the path node with the largest pheromone as the next hop node. This is the deterministic selection strategy. When q “q0, according to formula (2), the next hop is randomly selected by the betting round method. This is the random selection strategy. The determinism of the algorithm makes the selection tend to obtain the optimal candidate solution, while the randomness finds the new solution through the disturbance to prevent the local optimality.

Route maintenance refers to the process of updating the routing table when the previous route becomes invalid or in order to find a better route that is more suitable for the current power line condition. When the concentrator sends a control command to the target terminal according to the route in the central routing table, the communication fails because the load on a certain path in the route becomes large or is strongly interfered, and the concentrator confirms that the path is not suitable for the current channel. In the case, the route will be re-selected or a route discovery rule will be used to find a new route to the destination node. The search process for route maintenance is performed for individual nodes or local area nodes, so that time can be greatly saved.

Oval Series Sensor Automatic Dustbin

Auto Trash Can,Oval Series Sensor Automatic Dustbi,Oval Series Sensor Dustbin,Oval Series Sensor Office Dustbin

NINGBO ZIXING ELECTRONIC CO.,LTD. , https://www.zixingautobin.com