This paper aims at the shortcomings of traditional night scene cube, such as difficult installation, easy corrosion, high maintenance cost and power consumption.
A nightscape cube control scheme based on NRF24CL01 wireless transmission is proposed, which consists of wireless sender, wireless receiver and lighting control circuit. The main function of the system is to switch the keys of the display pattern of the night scene lamp in a wireless way over a long distance, and to automatically control the starting of the night scene lamp according to the brightness of the ambient light, so as to achieve the purpose of energy saving. With the development of the city, the gorgeous architectural night view is becoming a distinct city business card.
Nightscape lamp is to improve the appearance of the city, tourism prosperity, has significant benefits. At present, thermostatic element the control of night scene lamp is mainly wired, but because the control circuit is exposed to open air for a long time, under complex and changeable weather conditions, it will undoubtedly cause corrosion and damage to the circuit and reduce the service life of the line. With the rapid development of wireless technology in recent years, more and more miniaturization, intelligent, convenient development, so many control areas are now widely used in wireless mode. In addition, in today’s information and network era, computer has become an indispensable basic tool in people’s work and life, of which the most people contact is the micro-computer. Therefore, the design of a wireless light control, and intelligent control of the operation status, not only can save a lot of trouble, but also has a good market application prospects. At present, the installation position of night scene lamp is high, which is not suitable for large-scale wiring. Therefore, this paper uses NRF24 short-range wireless communication technology. This technology can carry out point-to-point communication or multi-point communication. It has the characteristics of low cost and convenient use. NRF24L01 mainly uses GFSK modulation mode and works in 2.
4 GHz-2.5 GHz ISM band. In addition, its peripheral circuit design is simple, chip power consumption is low, transmission distance can reach 40-50 meters outdoors, to meet the various control requirements of the current night scene lamp. The night scene lamp controller is based on STC12C5A60S2 MCU. The photoresistor circuit transmits information to the MCU according to the change of ambient brightness. The MCU transmits the received information to the receiver through NRF24L01 radio frequency module, and then controls the operation of optical cube circuit. Controllers can also transfer trigger information through key circuit, then process it through single chip computer, transmit it through wireless module, and finally switch the display pattern of optical cube. This includes both local adaptive energy-saving control and remote control functions. Nightscape lighting control system is mainly composed of three parts: command sender, command receiver and light cube lighting control circuit. The transmitter hardware circuit includes STC12C5A60S2 control circuit, photoresistor detection circuit, key detection circuit, power supply circuit, radio frequency module; the receiver hardware circuit includes STC12C5A60S2 control circuit, radio frequency module, power supply circuit, etc. As shown in Figure 2, the peripheral design schematic diagram of the single chip computer is shown. The starting capacitance C1 and C2 of the crystal oscillator circuit of the single chip computer are generally in the range of 15-33pF, so the 20p capacitor of the circuit is adopted; the P0 port is the open-leak output, and the pull resistance is added when it is used as the output port, and the 10K discharge resistance is generally used.
Other IO ports are integrated with pull-up resistors, which can be used as output ports directly. Fig. 3 is a photosensitive detection circuit.
When there is light, the resistance of photosensitive resistor decreases, then V2 > V3, that is, the reverse terminal voltage is greater than the same terminal voltage, then the output terminal of comparator LM324 outputs low level 0 to the single chip computer. When there is no light, the resistance of photosensitive resistor becomes larger, then V2 cubic night scene lamps are arranged in the form of 8 *8 led, with 64 vertical faces each.
Four 74HC15 are connected with 64 negative pole connections on the side, and each row of the base is connected with each other.
Then eight positive poles are connected with a 74HC245 chip. As shown in Fig. 4, there are 16 data lines connected with the MCU in the optical cube circuit. When the device is powered on, the MCU is initialized, the wireless module is initialized, the sender is initialized as the sending mode, and the receiver is the receiving mode. When a key is triggered or the photosensitive detection circuit returns to the ambient brightness data, the sender will execute the sending function and wait for the next trigger after sending the command.
The receiver waits for the data from the sender and is in the receiving mode.
When the receiver receives the command, it controls the switching optical cube circuit. After initialization, the sender program enters the main program cycle: the program continuously scans and detects the P2.7 port (corresponding to the output of the photosensitive detection circuit), and if P2.7 is 1:00 (dark condition), it enters the key detection program. If the key is pressed, the TxBuf array is assigned to the relevant serial number to execute the sending function; if P2.7 is low level 0 (bright condition), the TxBuf array is assigned to the relevant serial number, and then the sending function is executed.
The L01_RxPacket (RxBuf) function sets the return value of the nRF24L01_RxPacket function to 1 if it receives data.
The display function is executed according to the command RxBuf array received, and the optical cube displays the corresponding pattern or closes. The process of sending mode: set the PWR_UP in the register to low level; when the MCU has data to send, write the address of receiving node and valid data into the register of NRF24L01 through SPI interface. When CSN is low level, write to register and wait for transmission; Set CE to high level, start the chip for transmission. CE takes at least 10us for high-level time; start internal clock, MCU set transmission speed to 1Mbps or 2Mbps, wireless transmission data.
The process of receiving mode: setting the PWR_UP in the register to a high level; setting the data channel used, the automatic response function and the effective data width; setting CE to a high level to enter the receiving mode; NRF24L01 to detect air information after 130us; if the valid data segment is received, the data will be stored in the RxBuf array, and RX Buf will be stored at the same time.
_ The DR position is high; if the automatic response function is activated, the chip will send and receive the successful response signal; the MCU sets the CE foot low and enters the standby mode. In this paper, an intelligent and convenient wireless night-view lamp control system is proposed to overcome the shortcomings of the current night-view lamp controller. The system is introduced in detail from two aspects of hardware and software. The hardware part mainly includes MCU control circuit, photoresistor detection circuit, key detection circuit, radio frequency circuit, optical cube circuit and so on. The software part mainly includes NRF24L01 program, optical cube program, light control program and key detection program. Order and so on. The system adopts the idea of modular design, which makes both hardware and software modular design, reduces the complexity of hardware and software, and further improves the reliability of the system. The system not only realizes the wireless long-distance switching of the night scene lamp display pattern, but also intelligently controls the light according to the day and night. Therefore, the system has high application value and practical significance.