Real-time sampling of AD sampling based on STC12C5A60S2 microcontroller is used to detect whether the circuit is normal or not.
The system employs the STC12C5A60S2 microcontroller for real-time analog-to-digital (AD) sampling to monitor the circuit's condition. It uses the NRF24L01 module for wireless communication with the host system, while the main controller manages the 12864 display to show the status of the circuit. In case of a failure in the main circuit, the system automatically switches to the backup circuit. Once the main circuit is repaired, it can automatically revert back to the primary configuration, or users can manually switch between circuits using a button.
Hardware Design
Figure 1: System Block Diagram
As shown in Figure 1, the overall system consists of several key modules: the control unit, 12864 display, user buttons, the NRF24L01 wireless communication system, and the AD sampling module. The detection module continuously performs AD sampling to check the integrity of the main circuit and sends the results wirelessly to the main control unit via NRF24L01. The main control module then displays the status on the 12864 screen. If a fault is detected, the system automatically switches to the standby circuit, and manual switching is also possible through the button interface.
Software Design
The software includes functions such as AD sampling, button control, 12864 display management, and 2.4G wireless communication. The program flow is outlined in the following diagrams.
Figure 2: Main Flow Chart of Detection Module; Figure 3: Main Flow Chart of Control Module
One of the main challenges in the software design was ensuring seamless synchronization between the main control module and the wireless transmission module. After collaborative effort from all team members, this issue was successfully resolved.
Testing and Analysis
In this test, an LED lighting circuit was used as the subject. A comprehensive intelligent optimization circuit function test was conducted. The results are detailed below:
Circuit Self-Repair Function Test
Figure 4: Diode Normal Illumination
Figure 5: Main Circuit Working Normally
When the main circuit is operating normally, both the white and red LEDs indicate proper operation, as shown in Figure 4. The 12864 display on the main control module confirms that the main circuit is functioning correctly, as seen in Figure 5.
Figure 6: Channel Usage
Figure 7: White LED Off
Figure 8: Normal Operation
When the main circuit fails, the sampling analysis module sends the alert wirelessly. The main control unit instantly switches the function and displays the result, as shown in Figure 6. The white LED turns off, and the red LED lights up, indicating that the main circuit has failed and the backup is now active, as illustrated in Figure 7. Figure 8 shows the LED lighting circuit working properly, with a smooth transition between the main and backup circuits.
Manual Selection Circuit Function Test
If the main control circuit does not resolve the fault within the set time, the system enters manual selection mode, as shown in Figures 9, 10, and 11.
Figure 9: Manual Mode
Figure 10: Selecting Main Circuit
Figure 11: Selecting Alternate Circuit
Low Rate Nicd Battery KPL Series
Established in 1956, during the China first five-year-plan, Henan Xintaihang Power Source Co., Ltd. (Factory No.755) was the first R&D and manufacturing enterprise in China in the field of alkaline storage batteries and modular power system and it was also the military factory which owned the most varieties rechargeable batteries in domestic. Taihang was located in national Chemistry and Physicals Power Source Industrial Park, Xinxiang City, Henan, China.
Low Dishcharge Rate Nickel Cadmium Battery, KPL10~KPL1200, Max. discharge current <0.5C.
The nickel–cadmium battery (NiCd battery or NiCad battery) is a type of rechargeable battery using nickel oxide hydroxide and metallic cadmium as electrodes. The abbreviation NiCd is derived from the chemical symbols of nickel (Ni) and cadmium (Cd).
Ni Cd Battery,110V Kpl 300Ah Battery,Kpl1000Ah Nicd Battery,Low Rate Nicd Battery Kpl Series
Henan Xintaihang Power Source Co.,Ltd , https://www.taihangbattery.com