An intelligent street lamp system and method based on an arduino master control circuit

CN122765798APending Publication Date: 2026-09-15TIANJIN STREET LAMP MANAGEMENT OFFICE +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610925898.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-25
Publication Date
2026-09-15

AI Technical Summary

Technical Problem

[0005]本发明要解决的技术问题在于,针对现有路灯控制方式存在的固定时段控制适应性差、分段阈值调光易产生亮度突变、实时触发控制存在响应滞后、光照与交通流量融合控制精度不足以及末梢道路交通数据缺乏的问题,提供一种基于Arduino主控电路的智能路灯系统及方法,通过太阳能电池板采集环境光照,通过对射式红外对管采集交通流量,并结合15分钟预测预调和1秒实时模糊PID微调,实现路灯亮度的平滑自适应调节、异常交通状态实时响应和运行数据上传

Benefits of technology

[0029] This invention integrates an ATmega328 microcontroller with ATmega328 as its hardware core, a solar panel, a through-beam infrared photocell sensor, an LED driver circuit, an LED street light load, a serial-to-Wi-Fi module, and an Android display terminal onto the street light body, enabling the street light system to simultaneously possess the capabilities of ambient light perception, traffic flow perception, adaptive brightness adjustment, and operational data feedback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122765798A_ABST
    Figure CN122765798A_ABST
Patent Text Reader

Abstract

The application discloses an intelligent street lamp system and method based on an Arduino master control circuit, and belongs to the technical field of urban municipal lighting and embedded intelligent control, which comprises a street lamp body, a control box is installed on the street lamp body, a control circuit board is installed in the control box, an ATmega328 single-chip microcomputer with ATmega328 as a hardware core is installed on the control circuit board, a solar cell panel is installed at a light collecting position of the street lamp body, the solar cell panel is connected with an analog quantity collecting end of the ATmega328 single-chip microcomputer and is used for outputting a voltage analog signal representing environmental illumination intensity to the ATmega328 single-chip microcomputer, environmental illumination is collected through the solar cell panel, traffic flow is collected through a parabolic infrared pair tube, and 15-minute prediction and pre-adjustment and one-second real-time fuzzy PID fine adjustment are combined to realize smooth self-adaptive adjustment of street lamp brightness, real-time response to abnormal traffic states and operation data uploading.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the interdisciplinary field of urban municipal lighting and embedded intelligent control, and more specifically, relates to an intelligent street light system and method based on Arduino main control circuit. Background Technology

[0002] Urban road lighting systems are a crucial component of municipal infrastructure, and their operational performance directly impacts nighttime road safety, urban energy consumption, and lighting maintenance efficiency. Existing street light control methods primarily include manual intervention control, clock control, and independent control based on microcontrollers or digital signal processors. Manual intervention control typically involves maintenance personnel switching lights on and off based on experience. While simple in structure, it suffers from poor real-time performance, struggling to respond promptly to sudden changes in ambient light caused by heavy rain, fog, or seasonal variations. It also requires significant manpower and cannot achieve precise brightness adjustment. Clock control usually operates based on a fixed schedule or astronomical clock. Some systems incorporate simple light control thresholds to enable early lighting or delayed lighting, but its primary reliance on preset times makes it difficult to adapt to daily weather variations and actual road traffic conditions. It may maintain high brightness even during late-night periods with low traffic volume, resulting in ineffective energy consumption.

[0003] With the development of embedded control and sensing technologies, some street lighting systems have begun to adopt microcontrollers, photosensitive elements, infrared sensors, radar, and other components to achieve semi-intelligent control. For example, some systems use light thresholds to determine when to turn the lights on and off, trigger brightness increases when a vehicle passes by, and then return to low brightness after the vehicle leaves. While this approach offers a certain level of intelligence compared to traditional manual and timed control, it still has significant shortcomings in actual operation. First, existing solutions often use segmented threshold control, which can cause sudden changes in brightness near the threshold, leading to driver discomfort and glare, thus compromising nighttime driving safety. Second, the weights of light and traffic flow factors are usually fixed in advance, making it difficult to dynamically adjust based on road grade, time of day, and traffic conditions, resulting in a lack of optimal balance between lighting safety and energy efficiency. Third, many systems rely on real-time trigger control, increasing brightness only after a vehicle or pedestrian is detected by the sensor. However, the LED light source and driver circuit still have a certain response time, which may result in insufficient brightness or delayed adjustment when a vehicle or pedestrian first enters the illuminated area.

[0004] Furthermore, existing intelligent street light systems often focus solely on lighting control, failing to fully utilize the high density and wide coverage of streetlights to create traffic sensing nodes at the road's edge. While urban arterial roads are typically equipped with cameras, radar, or dedicated traffic detection equipment, the data collection capabilities for community roads, park roads, and secondary roads are relatively weak, making it difficult to provide effective data support for traffic status visualization, streetlight operation and maintenance decisions, and road usage analysis. Therefore, there is an urgent need for an intelligent street light system and method that can achieve ambient light detection, traffic flow detection, predictive pre-dimming, real-time fuzzy dimming, and operational data uploading with low-cost hardware. This would enable streetlights to perform smooth, continuous, proactive, and feedback-based brightness control based on changes in ambient light intensity and traffic flow. Summary of the Invention

[0005] The technical problem this invention aims to solve is to address the shortcomings of existing street light control methods, such as poor adaptability of fixed-time-period control, easy brightness abruptness caused by segmented threshold dimming, response lag in real-time trigger control, insufficient accuracy of integrated control of illumination and traffic flow, and lack of traffic data on peripheral roads. This invention provides an intelligent street light system and method based on an Arduino main control circuit. It collects ambient light through solar panels, collects traffic flow through through-beam infrared diodes, and combines 15-minute predictive pre-adjustment and 1-second real-time fuzzy PID fine-tuning to achieve smooth adaptive adjustment of street light brightness, real-time response to abnormal traffic conditions, and uploading of operational data.

[0006] To solve the above problems, the present invention adopts the following technical solution.

[0007] A smart street light system based on an Arduino main control circuit includes a street light body.

[0008] A control box is installed on the street light body, and a control circuit board is installed inside the control box. The control circuit board adopts an Arduino main control circuit with ATmega328 as the core.

[0009] A solar panel is installed at the light-receiving position of the street lamp body. The solar panel is connected to the analog signal acquisition interface of the ATmega328 microcontroller and is used to output a voltage analog signal representing the ambient light intensity to the ATmega328 microcontroller.

[0010] The street light body is equipped with through-beam infrared photocells along the traffic path. Each through-beam infrared photocell includes an infrared transmitter and an infrared receiver arranged opposite to each other. The signal output of the through-beam infrared photocell is connected to the digital acquisition terminal of the ATmega328 microcontroller and is used to output a blocking pulse signal representing traffic flow to the ATmega328 microcontroller.

[0011] The street light body is equipped with an LED street light load, and the control box is equipped with an LED driver circuit. The LED driver circuit is connected between the PWM output terminal of the ATmega328 microcontroller and the LED street light load, and is used to adjust the brightness of the LED street light load according to the PWM duty cycle.

[0012] The control box is also equipped with a serial-to-Wi-Fi module based on RT5350. The serial port of the serial-to-Wi-Fi module is connected to the ATmega328 microcontroller, and the Wi-Fi communication port is connected to the Android display terminal to upload the street light operation data to the Android display terminal.

[0013] The ATmega328 microcontroller is programmed with an intelligent dimming control program. This program is used to collect and store historical traffic flow data for different time periods according to a set time period. Based on the historical traffic flow data, it predicts the traffic flow for the next statistical period and generates a pre-adjusted PWM duty cycle. Within the 15-minute statistical period, it performs fuzzy PID control based on the real-time ambient light intensity and real-time traffic flow according to the sampling period to generate a PWM duty cycle fine-tuning amount. This enables the LED driver circuit to drive the LED street light load according to the final PWM duty cycle formed by the pre-adjusted PWM duty cycle and the PWM duty cycle fine-tuning amount. When the deviation between the real-time traffic flow and the predicted traffic flow meets the abnormal deviation condition, it switches to real-time dimming mode. Through the collaboration of solar panels, infrared photodiodes, PWM drive, and Wi-Fi upload, the street light has the capabilities of light sensing, traffic sensing, predictive dimming, and remote display.

[0014] As a further technical solution of the present invention, the intelligent dimming control program is used to obtain the light intensity deviation based on the real-time ambient light intensity and the reference light demand parameters, and to obtain the traffic flow deviation based on the real-time traffic flow and the reference traffic flow parameters. The light intensity deviation, traffic flow deviation and their changes are used as inputs for fuzzy PID control to dynamically correct the PID parameters and generate the PWM duty cycle fine-tuning amount. By having the light intensity deviation and traffic flow deviation participate in the fuzzy PID control, the PID parameters can be dynamically corrected, making the brightness adjustment smoother and reducing threshold jump interference.

[0015] As a further technical solution of the present invention, the intelligent dimming control program is used to predict historical traffic flow data for different time periods based on a sliding window time series model, wherein the sliding window time series model includes an ARIMA time series model; when the deviation between real-time traffic flow and predicted traffic flow exceeds a preset ratio, the ATmega328 microcontroller switches to real-time dimming mode and records abnormal traffic flow data, predicts traffic flow through the sliding window time series model, and switches to real-time dimming when the deviation is abnormal, which can take into account both advance adjustment and emergency traffic response capabilities.

[0016] A method for creating a smart street light based on an Arduino main control circuit includes the following steps:

[0017] S1. Initialization and Data Establishment: The ATmega328 microcontroller, with ATmega328 as its hardware core, establishes a data channel between the solar panel, through-beam infrared photocell sensor, LED driver circuit, serial-to-Wi-Fi module, and Android display terminal. It also establishes a control output channel for driving the LED street light load via the LED driver circuit, and loads initial PID parameters, baseline illumination demand parameters, baseline traffic flow parameters, initial PWM output value, abnormal deviation judgment conditions, and time-segmented historical traffic flow data.

[0018] S2. Environmental and Traffic Data Acquisition: The ATmega328 microcontroller acquires the light detection signal output from the solar panel and the traffic detection signal output from the through-beam infrared photocell sensor, processes them to obtain real-time ambient light intensity and real-time traffic flow, and uses the real-time ambient light intensity and real-time traffic flow as input data for subsequent real-time fine-tuning.

[0019] S3. Predictive and Pre-adjustment: The ATmega328 microcontroller calculates and updates the historical traffic flow data for each time period based on real-time traffic flow in a 15-minute statistical cycle. The ATmega328 microcontroller then predicts the traffic flow for the next statistical cycle based on the historical traffic flow data for each time period and generates a pre-adjusted PWM duty cycle in combination with the baseline illumination demand parameters.

[0020] S4. Real-time fine-tuning: Within a 15-minute statistical period, the ATmega328 microcontroller updates the real-time ambient light intensity and real-time traffic flow according to a 1-second sampling period, and performs fuzzy PID control based on the updated real-time ambient light intensity and real-time traffic flow to generate a PWM duty cycle fine-tuning amount for correcting the pre-adjusted PWM duty cycle.

[0021] S5. Driving and Feedback: The ATmega328 microcontroller superimposes the pre-adjusted PWM duty cycle and the PWM duty cycle fine-tuning amount to form the final PWM duty cycle, and outputs it to the LED driver circuit to drive the LED street light load. When the deviation between the real-time traffic flow and the predicted traffic flow meets the abnormal deviation judgment condition, the ATmega328 microcontroller switches to real-time dimming mode. At the same time, the ATmega328 microcontroller uploads street light operation data to the Android display terminal through the serial-to-Wi-Fi module. Through the continuous steps of initialization and filing, environmental acquisition, prediction and pre-adjustment, real-time fine-tuning and drive feedback, the street light brightness is adjusted on demand and the operation data is feedback in a closed loop.

[0022] As a further technical solution of the present invention, in S1, the initial PID parameters include the initial proportional coefficient, the initial integral coefficient, and the initial derivative coefficient. The reference illumination demand parameter is determined based on sunrise and sunset times, seasonal changes, road grade, and lighting safety requirements. The reference traffic flow parameter is determined based on the traffic flow reference value under the corresponding time period and road type. The determination basis of the initial PID parameters, the reference illumination demand, and the reference traffic flow is clearly defined, so that subsequent prediction, pre-adjustment, and fuzzy control have a stable parameter basis.

[0023] As a further technical solution of the present invention, in S2, the ATmega328 microcontroller acquires the light detection signal output by the solar panel through the analog acquisition terminal, and obtains the real-time ambient light intensity according to the relationship between the output voltage of the solar panel and the field calibration; the ATmega328 microcontroller acquires the traffic detection signal output by the through-beam infrared phototransistor sensor through the digital acquisition terminal, and obtains the real-time traffic flow according to the number of occlusion pulses, thus refining the acquisition and processing methods of the light detection signal and the traffic detection signal, so that the detection data of the solar panel and the infrared phototransistor can be accurately converted into control input.

[0024] As a further technical solution of the present invention, in S3, the ATmega328 microcontroller uses a sliding window time series model to predict historical traffic flow data for different time periods. The sliding window time series model includes the ARIMA time series model, and the ATmega328 microcontroller trains and updates the parameters of the ARIMA time series model during periods of low traffic flow. By predicting traffic flow for different time periods through the ARIMA time series model and training and updating the parameters during periods of low traffic flow, the accuracy and adaptability of the prediction and pre-lighting are improved.

[0025] As a further technical solution of the present invention, when the ATmega328 microcontroller uses the ARIMA time series model for prediction, it takes the historical traffic flow data of the most recent several days in different time periods as training data and validation data, and adjusts the order of the ARIMA time series model when the validation error is greater than the preset error condition. By adjusting the order of the ARIMA model through training data, validation data and error judgment, the prediction model can be updated with changes in traffic patterns, thereby reducing prediction deviation.

[0026] As a further technical solution of the present invention, in S4, the ATmega328 microcontroller obtains the light intensity deviation based on the real-time ambient light intensity and the reference light demand parameters, and obtains the traffic flow deviation based on the real-time traffic flow and the reference traffic flow parameters. The light intensity deviation, traffic flow deviation, and the corresponding deviation changes are used as fuzzy PID control inputs to dynamically correct the PID parameters and generate PWM duty cycle fine-tuning. By using the light intensity deviation, traffic flow deviation, and their changes as fuzzy PID inputs, smooth fine-tuning control of the fusion of light intensity and traffic flow parameters can be achieved.

[0027] As a further technical solution of the present invention, in S5, the ATmega328 microcontroller limits the final PWM duty cycle to the range of 0% to 100%, and uploads real-time ambient light intensity, real-time traffic flow, predicted traffic flow, pre-adjusted PWM duty cycle, PWM duty cycle fine-tuning amount, final PWM duty cycle, system operating mode and abnormal status flags to the Android display terminal through a serial-to-Wi-Fi module. Limiting the range of the final PWM duty cycle and uploading multiple types of operating data can avoid abnormal brightness output and improve the monitoring and maintenance assistance capabilities of the Android display terminal.

[0028] Compared with the prior art, the advantages of this invention are:

[0029] This invention integrates an ATmega328 microcontroller with ATmega328 as its hardware core, a solar panel, a through-beam infrared photocell sensor, an LED driver circuit, an LED street light load, a serial-to-Wi-Fi module, and an Android display terminal onto the street light body, enabling the street light system to simultaneously possess the capabilities of ambient light perception, traffic flow perception, adaptive brightness adjustment, and operational data feedback.

[0030] Compared with traditional manual control, clock control, and simple threshold control methods, this invention uses solar panels to convert external ambient light into voltage analog signals, avoiding the need for additional complex light detection equipment and reducing system costs; it uses through-beam infrared photocells to collect occlusion pulse signals generated by traffic, enabling streetlights to provide on-demand lighting based on actual traffic flow, reducing ineffective high-brightness operation during low-traffic periods at night.

[0031] Furthermore, this invention collects and updates historical traffic flow data for different time periods according to a 15-minute statistical cycle, predicts traffic flow for the next statistical cycle based on the historical data, and generates a pre-adjusted PWM duty cycle, so that the LED street light load can reach a suitable basic brightness in advance before traffic flow changes, reducing the response lag caused by pure real-time trigger control.

[0032] Meanwhile, the present invention updates the real-time ambient light intensity and real-time traffic flow according to a 1-second sampling period in each statistical cycle, and generates PWM duty cycle fine-tuning through fuzzy PID control, so that the final PWM duty cycle can change continuously with light and traffic conditions, avoiding brightness abrupt changes, glare and driver visual discomfort caused by traditional segmented threshold dimming.

[0033] The present invention also switches to real-time dimming mode when the deviation between real-time traffic flow and predicted traffic flow meets the abnormal deviation judgment conditions, thereby improving the response capability to abnormal traffic conditions such as sudden congestion, temporary events, and road closures.

[0034] By uploading street light operation data to an Android display terminal using a serial-to-Wi-Fi module based on RT5350, this invention can also visualize road traffic status and lighting operation status, providing data support for end-point road traffic perception, street light operation and maintenance scheduling, and energy-saving management. Attached Figure Description

[0035] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation

[0036] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0037] This invention provides an embodiment 1

[0038] A smart street light system based on an Arduino main control circuit includes a street light body.

[0039] A control box is installed on the street light body, and a control circuit board is installed inside the control box. The control circuit board adopts an Arduino main control circuit with ATmega328 as the core.

[0040] A solar panel is installed at the light-receiving position of the street lamp body. The solar panel is connected to the analog signal acquisition interface of the ATmega328 microcontroller and is used to output a voltage analog signal representing the ambient light intensity to the ATmega328 microcontroller.

[0041] The street light body is equipped with through-beam infrared photocells along the traffic path. Each through-beam infrared photocell includes an infrared transmitter and an infrared receiver arranged opposite to each other. The signal output of the through-beam infrared photocell is connected to the digital acquisition terminal of the ATmega328 microcontroller and is used to output a blocking pulse signal representing traffic flow to the ATmega328 microcontroller.

[0042] The street light body is equipped with an LED street light load, and the control box is equipped with an LED driver circuit. The LED driver circuit is connected between the PWM output terminal of the ATmega328 microcontroller and the LED street light load, and is used to adjust the brightness of the LED street light load according to the PWM duty cycle.

[0043] The control box is also equipped with a serial-to-Wi-Fi module based on RT5350. The serial port of the serial-to-Wi-Fi module is connected to the ATmega328 microcontroller, and the Wi-Fi communication port is connected to the Android display terminal to upload the street light operation data to the Android display terminal.

[0044] The ATmega328 microcontroller is programmed with an intelligent dimming control program. This program is used to collect and store historical traffic flow data for different time periods according to a set time period. Based on the historical traffic flow data, it predicts the traffic flow for the next statistical period and generates a pre-adjusted PWM duty cycle. Within the 15-minute statistical period, it performs fuzzy PID control based on the real-time ambient light intensity and real-time traffic flow according to the sampling period to generate a PWM duty cycle fine-tuning amount. This enables the LED driver circuit to drive the LED street light load according to the final PWM duty cycle formed by the pre-adjusted PWM duty cycle and the PWM duty cycle fine-tuning amount. When the deviation between the real-time traffic flow and the predicted traffic flow meets the abnormal deviation condition, it switches to real-time dimming mode. Through the collaboration of solar panels, infrared photodiodes, PWM drive, and Wi-Fi upload, the street light has the capabilities of light sensing, traffic sensing, predictive dimming, and remote display.

[0045] The intelligent dimming control program is used to obtain the light intensity deviation based on the real-time ambient light intensity and the reference light demand parameters, and to obtain the traffic flow deviation based on the real-time traffic flow and the reference traffic flow parameters. The light intensity deviation, traffic flow deviation and their changes are used as inputs for fuzzy PID control to dynamically correct the PID parameters and generate the PWM duty cycle fine-tuning amount. By having the light intensity deviation and traffic flow deviation participate in the fuzzy PID control, the PID parameters can be dynamically corrected, making the brightness adjustment smoother and reducing threshold jump interference.

[0046] The intelligent dimming control program is used to predict historical traffic flow data for different time periods based on a sliding window time series model, which includes the ARIMA time series model. When the deviation between real-time traffic flow and predicted traffic flow exceeds a preset ratio, the ATmega328 microcontroller switches to real-time dimming mode and records abnormal traffic flow data. It predicts traffic flow through the sliding window time series model and switches to real-time dimming when the deviation is abnormal, thus taking into account both advance adjustment and emergency traffic response capabilities.

[0047] A method for creating a smart street light based on an Arduino main control circuit includes the following steps:

[0048] S1. Initialization and Data Establishment: The ATmega328 microcontroller, with ATmega328 as its hardware core, establishes a data channel between the solar panel, through-beam infrared photocell sensor, LED driver circuit, serial-to-Wi-Fi module, and Android display terminal. It also establishes a control output channel for driving the LED street light load via the LED driver circuit, and loads initial PID parameters, baseline illumination demand parameters, baseline traffic flow parameters, initial PWM output value, abnormal deviation judgment conditions, and time-segmented historical traffic flow data.

[0049] S2. Environmental and Traffic Data Acquisition: The ATmega328 microcontroller acquires the light detection signal output from the solar panel and the traffic detection signal output from the through-beam infrared photocell sensor, processes them to obtain real-time ambient light intensity and real-time traffic flow, and uses the real-time ambient light intensity and real-time traffic flow as input data for subsequent real-time fine-tuning.

[0050] S3. Predictive and Pre-adjustment: The ATmega328 microcontroller calculates and updates the historical traffic flow data for each time period based on real-time traffic flow in a 15-minute statistical cycle. The ATmega328 microcontroller then predicts the traffic flow for the next statistical cycle based on the historical traffic flow data for each time period and generates a pre-adjusted PWM duty cycle in combination with the baseline illumination demand parameters.

[0051] S4. Real-time fine-tuning: Within a 15-minute statistical period, the ATmega328 microcontroller updates the real-time ambient light intensity and real-time traffic flow according to a 1-second sampling period, and performs fuzzy PID control based on the updated real-time ambient light intensity and real-time traffic flow to generate a PWM duty cycle fine-tuning amount for correcting the pre-adjusted PWM duty cycle.

[0052] S5. Driving and Feedback: The ATmega328 microcontroller superimposes the pre-adjusted PWM duty cycle and the PWM duty cycle fine-tuning amount to form the final PWM duty cycle, and outputs it to the LED driver circuit to drive the LED street light load. When the deviation between the real-time traffic flow and the predicted traffic flow meets the abnormal deviation judgment condition, the ATmega328 microcontroller switches to real-time dimming mode. At the same time, the ATmega328 microcontroller uploads street light operation data to the Android display terminal through the serial-to-Wi-Fi module. Through the continuous steps of initialization and filing, environmental acquisition, prediction and pre-adjustment, real-time fine-tuning and drive feedback, the street light brightness is adjusted on demand and the operation data is feedback in a closed loop.

[0053] In S1, the initial PID parameters include the initial proportional coefficient, the initial integral coefficient, and the initial derivative coefficient. The reference illumination demand parameter is determined based on sunrise and sunset times, seasonal variations, road grade, and lighting safety requirements. The reference traffic flow parameter is determined based on the traffic flow reference value under the corresponding time period and road type. The determination basis of the initial PID parameters, the reference illumination demand, and the reference traffic flow is clearly defined, so that subsequent prediction, pre-adjustment, and fuzzy control have a stable parameter basis.

[0054] In step S2, the ATmega328 microcontroller acquires the illumination detection signal output by the solar panel through the analog acquisition terminal, and obtains the real-time ambient light intensity based on the relationship between the solar panel output voltage and the field calibration. The ATmega328 microcontroller acquires the traffic detection signal output by the through-beam infrared phototransistor sensor through the digital acquisition terminal, and obtains the real-time traffic flow based on the number of occlusion pulses. This refines the acquisition and processing methods of the illumination detection signal and the traffic detection signal, enabling the detection data from the solar panel and the infrared phototransistor to be accurately converted into control inputs.

[0055] In step S3, the ATmega328 microcontroller uses a sliding window time series model to predict historical traffic flow data for different time periods. The sliding window time series model includes the ARIMA time series model. The ATmega328 microcontroller trains and updates the parameters of the ARIMA time series model during periods of low traffic flow. By predicting traffic flow for different time periods through the ARIMA time series model and training and updating the parameters during periods of low traffic flow, the accuracy and adaptability of the prediction and pre-lighting are improved.

[0056] When the ATmega328 microcontroller uses the ARIMA time series model for prediction, it takes the historical traffic flow data of the most recent several days in different time periods as training data and validation data. When the validation error is greater than the preset error condition, the order of the ARIMA time series model is adjusted. By adjusting the order of the ARIMA model through training data, validation data and error judgment, the prediction model can be updated with changes in traffic patterns, thereby reducing prediction bias.

[0057] In step S4, the ATmega328 microcontroller obtains the light intensity deviation based on the real-time ambient light intensity and the reference light demand parameters, and obtains the traffic flow deviation based on the real-time traffic flow and the reference traffic flow parameters. The light intensity deviation, traffic flow deviation, and the corresponding deviation changes are used as inputs for fuzzy PID control to dynamically correct the PID parameters and generate PWM duty cycle fine-tuning. By using the light intensity deviation, traffic flow deviation, and their changes as inputs for fuzzy PID, smooth fine-tuning control based on the fusion of light intensity and traffic flow parameters can be achieved.

[0058] In S5, the ATmega328 microcontroller limits the final PWM duty cycle to the range of 0% to 100%, and uploads real-time ambient light intensity, real-time traffic flow, predicted traffic flow, pre-adjusted PWM duty cycle, PWM duty cycle fine-tuning amount, final PWM duty cycle, system operating mode, and abnormal status flags to the Android display terminal through a serial-to-Wi-Fi module. Limiting the final PWM duty cycle range and uploading multiple types of operating data can prevent abnormal brightness output and improve the monitoring and maintenance assistance capabilities of the Android display terminal.

[0059] Application examples

[0060] This embodiment provides a smart street light method based on an Arduino main control circuit, which is implemented based on a smart street light system. The smart street light system includes a street light body, a control box mounted on the street light body, a control circuit board inside the control box, and an ATmega328 microcontroller with an ATmega328 as its hardware core mounted on the control circuit board. A solar panel is installed at the light-receiving position of the street light body, and the solar panel is connected to the analog signal acquisition terminal of the ATmega328 microcontroller to output a voltage analog signal representing the ambient light intensity to the ATmega328 microcontroller. Through-beam infrared sensors are deployed along the traffic path around the street light body. Each through-beam infrared sensor includes an infrared transmitter and an infrared receiver positioned opposite each other. The signal output terminal of the through-beam infrared sensor is connected to the digital signal acquisition terminal of the ATmega328 microcontroller to output an obstruction pulse signal representing traffic flow to the ATmega328 microcontroller. The streetlight body is equipped with an LED streetlight load, and the control box contains an LED driver circuit. This LED driver circuit is connected between the PWM output of the ATmega328 microcontroller and the LED streetlight load, used to adjust the brightness of the LED streetlight load according to the PWM duty cycle. The control box also contains an RT5350-based serial-to-Wi-Fi module. The serial port of this module is connected to the ATmega328 microcontroller, and the Wi-Fi communication port is connected to an Android display terminal, used to upload streetlight operation data to the Android display terminal.

[0061] In this embodiment,

[0062] The solar panels are not used as the primary energy storage device, but are reused as a light detection unit to convert the intensity of external ambient light into a voltage analog signal.

[0063] Through-beam infrared photocells are used to detect occlusion pulses generated when vehicles, pedestrians, and other traffic objects pass through the detection area. The ATmega328 microcontroller obtains traffic flow by counting the occlusion pulses.

[0064] The traffic flow can include vehicle traffic flow and pedestrian traffic flow. The ATmega328 microcontroller has an intelligent dimming control program written in it. This program can be written in C language and is used to implement control processes such as initialization and data collection, environmental and traffic data acquisition, predictive adjustment, real-time fine-tuning, drive feedback, and abnormal switching.

[0065] S1. Initial File Creation

[0066] After the system is powered on, the ATmega328 microcontroller, with the ATmega328 as its hardware core, establishes a channel for sensor acquisition, brightness driving, and communication uploading.

[0067] Specifically, the ATmega328 microcontroller establishes an analog signal acquisition channel with the solar panel to read the light detection signal output by the solar panel; establishes a digital signal acquisition channel with the through-beam infrared phototransistor sensor to read the shading pulse signal generated by traffic; establishes a PWM control output channel with the LED driver circuit to control the brightness of the LED street light load through the LED driver circuit; and establishes a serial communication channel with the RT5350-based serial-to-Wi-Fi module to upload the street light operation data to the Android display terminal.

[0068] The ATmega328 microcontroller loads initial PID parameters, baseline illumination requirements, baseline traffic flow parameters, initial PWM output values, abnormal deviation judgment conditions, and historical traffic flow data for different time periods.

[0069] The initial PID parameters include the initial proportional coefficient, the initial integral coefficient, and the initial derivative coefficient. For example, the initial proportional coefficient, the initial integral coefficient, and the initial derivative coefficient can be set to 2.5, 0.8, and 0.3, respectively, or they can be calibrated and adjusted according to different road types.

[0070] The reference illumination requirement parameter is used to represent the reference illumination level required for current road lighting safety, and can be determined based on sunrise and sunset times, seasonal changes, road grade, and lighting safety requirements.

[0071] The baseline traffic flow parameter is used to represent the reference value of traffic flow for the corresponding time period or road type.

[0072] The initial value of the PWM output is used to provide the initial brightness output before the system enters normal control.

[0073] The abnormal deviation judgment criteria are used to determine whether the real-time traffic flow deviates significantly from the predicted traffic flow.

[0074] The historical traffic flow data for different time periods is stored according to a preset statistical period, preferably 15 minutes.

[0075] To facilitate subsequent calculations, a day is divided into multiple statistical time periods. When the statistical period is 15 minutes, a day can be divided into 96 statistical time periods. The ATmega328 microcontroller can store the historical traffic flow data for the most recent several days in its internal EEPROM or external memory.

[0076] Considering the limited capacity of the ATmega328's internal EEPROM, when it is necessary to save raw time-segmented data for a long period of time, methods such as cyclic overwriting, compressed encoding, reducing data bit width, saving only key statistics, or external memory expansion can be used for storage, thereby ensuring that the historical data required for prediction and pre-adjustment can be retrieved.

[0077] S2, Environmental and Traffic Data Collection

[0078] During system operation, the ATmega328 microcontroller acquires the light detection signal output from the solar panel and the traffic detection signal output from the through-beam infrared phototransistor sensor, and processes them to obtain the real-time ambient light intensity and real-time traffic flow. The real-time ambient light intensity and real-time traffic flow are then used as input data for subsequent real-time fine-tuning.

[0079] Specifically, the solar panel outputs a corresponding analog voltage signal as the ambient light intensity changes. This analog voltage signal is then processed by current limiting, voltage division, or filtering before being input to the analog signal acquisition terminal of the ATmega328 microcontroller. Based on the relationship between the solar panel's output voltage and the field calibration, the ATmega328 microcontroller converts the analog voltage signal into a real-time ambient light intensity characterization value.

[0080] A through-beam infrared sensor consists of an infrared transmitter and an infrared receiver, which are positioned opposite each other on both sides of a traffic path. When a vehicle or pedestrian passes through the detection area between the infrared transmitter and the infrared receiver, the infrared light path is blocked, and the infrared receiver generates a blocking pulse signal.

[0081] The ATmega328 microcontroller counts the number of valid occlusion pulses within the sampling window and calculates the real-time traffic flow based on this count. To reduce the impact of false triggering, the ATmega328 microcontroller allows setting debounce time and minimum valid occlusion time to filter out continuous jitter signals and short-term interference signals.

[0082] S3, Predictive Adjustment

[0083] The ATmega328 microcontroller collects and updates historical traffic flow data for different time periods based on real-time traffic flow in a 15-minute statistical cycle. The ATmega328 microcontroller then predicts the traffic flow for the next statistical cycle based on the historical traffic flow data for different time periods and generates a pre-adjusted PWM duty cycle by combining the reference illumination demand parameters.

[0084] Specifically, within each 15-minute statistical period, the ATmega328 microcontroller accumulates or averages the real-time traffic flow to obtain the time-segmented traffic flow for that statistical period, and writes this time-segmented traffic flow into the time-segmented traffic flow historical data. The ATmega328 microcontroller uses a cyclic overwrite or rolling update method to retain data from the most recent few days, enabling the prediction model to call upon continuous historical traffic flow sequences.

[0085] To eliminate the lag in pure real-time control in advance, the ATmega328 microcontroller predicts traffic flow for the next statistical period based on a sliding window time series model.

[0086] Preferably, the ARIMA time series model is used for prediction. Taking ARIMA(1,1,1) as an example, the ATmega328 microcontroller first performs differential processing on the traffic flow of adjacent statistical periods, then combines the autoregressive parameters, moving average parameters, and prediction residuals to predict the traffic flow change in the next statistical period. Finally, the predicted traffic flow change is superimposed on the traffic flow of the current statistical period to obtain the predicted traffic flow for the next statistical period.

[0087] During model training, the ATmega328 microcontroller can perform model training and parameter updates during periods of low traffic volume, preferably at 2:00 AM daily. The microcontroller can retrieve historical traffic flow data for the past 7 days, using the data from the first 6 days as the training set and the data from the 7th day as the validation set, and uses the least squares method to fit the model parameters.

[0088] The accuracy of the model is evaluated by verifying the mean absolute error between the actual traffic flow and the predicted traffic flow. When the mean absolute error is greater than the preset error condition, such as greater than 5%, the model order is adjusted, for example, by trying ARIMA(2,1,1) or ARIMA(1,1,2), and the model parameters with smaller errors are selected for subsequent predictions.

[0089] After obtaining the predicted traffic flow for the next statistical period, the ATmega328 microcontroller generates a pre-adjusted PWM duty cycle based on the baseline illumination demand parameters. This pre-adjusted PWM duty cycle represents the basic lighting brightness that the LED streetlight load should achieve at the start of the next statistical period. The pre-adjusted PWM duty cycle can be determined through table lookup, linear mapping, or a piecewise continuous function. Its determination process considers both the predicted traffic flow and the baseline illumination demand parameters, avoiding sudden brightness changes caused by traditional piecewise threshold control.

[0090] Once the system enters the next 15-minute statistical cycle, the generated pre-adjusted PWM duty cycle is used as the base PWM duty cycle for that statistical cycle and output to the LED driver circuit, causing the LED street light load to reach the basic lighting brightness in advance. Through the above predictive pre-adjustment steps, the system can adjust the basic brightness of the street lights in advance before vehicles or pedestrians arrive in concentrated numbers.

[0091] S4, Real-time Fine-tuning

[0092] Within a 15-minute statistical period, the ATmega328 microcontroller updates the real-time ambient light intensity and real-time traffic flow according to a 1-second sampling period. Based on the updated real-time ambient light intensity and real-time traffic flow, it performs fuzzy PID control to generate a PWM duty cycle fine-tuning amount for correcting the pre-adjusted PWM duty cycle.

[0093] Specifically, the ATmega328 microcontroller uses real-time ambient light intensity and real-time traffic flow as inputs for fuzzy PID control. Let the... The real-time ambient light intensity for each 1-second sampling period is The baseline illumination requirement parameters are: Real-time traffic flow is The baseline traffic flow parameters are .

[0094] First, the ATmega328 microcontroller calculates the light intensity deviation based on the real-time ambient light intensity and the reference light requirement parameters:

[0095]

[0096] in, For the first Light intensity deviation per sampling period; For the first Real-time ambient light intensity for each sampling period; For the first Reference illumination requirements parameters for each sampling period.

[0097] Then, the ATmega328 microcontroller calculates the traffic flow deviation based on the real-time traffic flow and the baseline traffic flow parameters:

[0098]

[0099] in, For the first Traffic flow deviation for each sampling period; For the first Real-time traffic flow for each sampling period; For the first The baseline traffic flow parameters for each sampling period.

[0100] The ATmega328 microcontroller can also obtain the corresponding deviation changes based on the light intensity deviation and traffic flow deviation within adjacent sampling periods, and use the light intensity deviation, traffic flow deviation and their changes together as inputs for fuzzy PID control.

[0101] Preferably, each input quantity is divided into seven fuzzy subsets: negative large (NB), negative medium (NM), negative small (NS), zero (ZO), positive small (PS), positive medium (PM), and positive large (PB). A triangular membership function is then used to map the actual collected values ​​to... The domain of discourse.

[0102] For example, the output voltage of a solar panel can be normalized and mapped to a range of 0 to 5V. Traffic flow per unit time can be normalized and mapped to a value within the range of 0 to 60. To adapt to fuzzy reasoning input.

[0103] Within the fuzzy rule base, the ATmega328 microcontroller dynamically adjusts the PID parameters based on the degree of insufficient lighting, traffic flow volume, and their changing trends. The fuzzy rule base can include 49 basic rules. For example, when lighting is severely insufficient and traffic flow is high, the proportional control action is increased to rapidly increase streetlight brightness, while the integral action is appropriately suppressed to avoid overshoot; when lighting is moderate and traffic flow is slightly low, small parameter adjustments are made to slowly reduce brightness and maintain stability; when lighting is sufficient and traffic flow is very low, the PWM duty cycle is gradually reduced to improve energy efficiency.

[0104] The ATmega328 microcontroller employs the Mamdani max-min inference method to reason about fuzzy rules, and then uses the centroid method to defuzzify the inference results, obtaining the proportional, integral, and derivative parameter adjustments. Subsequently, the ATmega328 microcontroller superimposes these proportional, integral, and derivative parameter adjustments onto the initial PID parameters to obtain the real-time PID parameters for the current sampling period. Through this method, the system can dynamically adjust the PID parameters based on real-time illumination and traffic flow, rather than using fixed weights or fixed thresholds for brightness control.

[0105] To integrate lighting and traffic flow factors into brightness fine-tuning control, the ATmega328 microcontroller is used to construct a comprehensive brightness control deviation mechanism.

[0106]

[0107] in, For the first The overall brightness control deviation for each sampling period; Traffic flow weighting; For the first Traffic flow deviation for each sampling period; Light weight; For the first Light intensity deviation per sampling period. Due to A negative value indicates insufficient light, therefore... This increases the brightness adjustment requirement when there is insufficient lighting. The traffic flow weight and lighting weight can be dynamically adjusted according to road type, time period, traffic conditions, and lighting safety requirements.

[0108] The ATmega328 microcontroller inputs the overall brightness control deviation into the discrete PID control formula to obtain the PWM duty cycle fine-tuning amount:

[0109]

[0110] in, For the first The PWM duty cycle fine-tuning amount per sampling period; , , The first Real-time scaling factor, real-time integral factor, and real-time derivative factor for each sampling period; For the first The overall brightness control deviation for each sampling period; For cumulative summation index; From the initial sampling period to the 1st The cumulative value of the overall brightness control deviation for each sampling period; This represents the overall brightness control deviation change between adjacent sampling periods. Through the aforementioned fuzzy PID control process, the load brightness of LED streetlights can be smoothly and steplessly adjusted according to changes in ambient light and traffic flow, thereby avoiding the sudden brightness changes caused by traditional segmented threshold control.

[0111] S5, Drive and Feedback

[0112] The ATmega328 microcontroller combines the pre-adjusted PWM duty cycle with the PWM duty cycle fine-tuning to form the final PWM duty cycle, which is then output to the LED driver circuit to drive the LED street light load. When the deviation between the real-time traffic flow and the predicted traffic flow meets the abnormal deviation judgment condition, the ATmega328 microcontroller switches to real-time dimming mode. At the same time, the ATmega328 microcontroller uploads the street light operation data to the Android display terminal through the serial-to-Wi-Fi module.

[0113] Specifically, the final PWM duty cycle It can be represented as:

[0114]

[0115] in, For the first The final PWM duty cycle is output to the LED driver circuit for each sampling cycle; This refers to the pre-adjusted PWM duty cycle corresponding to the current 15-minute statistical period. For the first The PWM duty cycle fine-tuning amount per sampling period. To ensure smooth brightness adjustment, The preferred value range is no more than of Meanwhile, the final PWM duty cycle is limited to the range of 0% to 100%.

[0116] The ATmega328 microcontroller outputs the final PWM duty cycle to the LED driver circuit, which then adjusts the average drive current of the LED street light load based on this final PWM duty cycle, thereby changing the brightness of the LED street light load.

[0117] When ambient light is insufficient and traffic flow is high, the PWM duty cycle increases, and the brightness of the LED street light load increases.

[0118] When ambient light is insufficient but traffic flow is low, the PWM duty cycle is reduced, and the LED street light load maintains basic lighting brightness.

[0119] When there is sufficient ambient light, the ATmega328 microcontroller can reduce the final PWM duty cycle, causing the LED street light load to enter a low-power state or a shutdown state.

[0120] The abnormal deviation judgment condition is used to determine whether the predicted and pre-adjusted results need to be replaced by real-time control. When the deviation between real-time traffic flow and predicted traffic flow exceeds a preset ratio, such as exceeding 20%, the abnormal deviation judgment condition is met, and the ATmega328 microcontroller switches to real-time dimming mode. In real-time dimming mode, the ATmega328 microcontroller reduces the impact of the predicted and pre-adjusted PWM duty cycle on brightness control, directly performing fuzzy PID control based on real-time ambient light intensity and real-time traffic flow, and records abnormal traffic flow data to the storage unit for subsequent time series model parameter correction. In this way, the system can both utilize historical traffic patterns for advance pre-adjustment and respond promptly to real-time traffic changes in situations such as sudden congestion, temporary events, road closures, or abnormally low traffic flow.

[0121] During data upload, the ATmega328 microcontroller assembles a streetlight operation data packet from real-time ambient light intensity, real-time traffic flow, predicted traffic flow, pre-adjusted PWM duty cycle, PWM duty cycle fine-tuning, final PWM duty cycle, system operating mode, and abnormal status flags. This packet is then sent via serial port to a serial-to-Wi-Fi module based on the RT5350. The serial-to-Wi-Fi module then transmits the streetlight operation data to an Android display terminal via Wi-Fi. The Android display terminal receives and displays road traffic flow, streetlight brightness, prediction results, and abnormal status information, thereby enabling road status visualization and auxiliary operation and maintenance management.

[0122] This embodiment establishes a two-tiered intelligent control architecture of "predictive pre-adjustment + real-time fine-tuning" through the aforementioned steps. A 15-minute statistical cycle is used to predict the traffic state for the next statistical cycle based on historical traffic flow data and to generate a pre-adjusted PWM duty cycle in advance. A 1-second sampling cycle is used for fuzzy PID fine-tuning based on real-time ambient light intensity and real-time traffic flow. Thus, the system forms a daytime low-power mode, a nighttime basic lighting mode, a peak traffic enhanced lighting mode, a predictive pre-adjustment mode, and a real-time dimming mode. This method can achieve smooth adjustment of street light brightness while ensuring road lighting safety, reducing brightness abrupt changes and response lag caused by traditional threshold control. Simultaneously, it utilizes the wide distribution and dense coverage of streetlights to supplement peripheral road traffic perception data, making it suitable for road lighting scenarios such as urban main roads, secondary roads, community roads, park roads, and industrial park roads.

[0123] In summary, this invention integrates an ATmega328 microcontroller with ATmega328 as its hardware core, a solar panel, a through-beam infrared photocell sensor, an LED driver circuit, an LED street light load, a serial-to-Wi-Fi module, and an Android display terminal onto the street light body, enabling the street light system to simultaneously possess the capabilities of ambient light perception, traffic flow perception, adaptive brightness adjustment, and operational data feedback.

[0124] Compared with traditional manual control, clock control, and simple threshold control methods, this invention uses solar panels to convert external ambient light into voltage analog signals, avoiding the need for additional complex light detection equipment and reducing system costs; it uses through-beam infrared photocells to collect occlusion pulse signals generated by traffic, enabling streetlights to provide on-demand lighting based on actual traffic flow, reducing ineffective high-brightness operation during low-traffic periods at night.

[0125] Furthermore, this invention collects and updates historical traffic flow data for different time periods according to a 15-minute statistical cycle, predicts traffic flow for the next statistical cycle based on the historical data, and generates a pre-adjusted PWM duty cycle, so that the LED street light load can reach a suitable basic brightness in advance before traffic flow changes, reducing the response lag caused by pure real-time trigger control.

[0126] Meanwhile, the present invention updates the real-time ambient light intensity and real-time traffic flow according to a 1-second sampling period in each statistical cycle, and generates PWM duty cycle fine-tuning through fuzzy PID control, so that the final PWM duty cycle can change continuously with light and traffic conditions, avoiding brightness abrupt changes, glare and driver visual discomfort caused by traditional segmented threshold dimming.

[0127] The present invention also switches to real-time dimming mode when the deviation between real-time traffic flow and predicted traffic flow meets the abnormal deviation judgment conditions, thereby improving the response capability to abnormal traffic conditions such as sudden congestion, temporary events, and road closures.

[0128] By uploading street light operation data to an Android display terminal using a serial-to-Wi-Fi module based on RT5350, this invention can also visualize road traffic status and lighting operation status, providing data support for end-point road traffic perception, street light operation and maintenance scheduling, and energy-saving management.

[0129] The above description is merely a preferred embodiment of the present invention; however, the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and its improved concepts, should be covered within the scope of protection of the present invention.

Claims

1. A smart street light system based on an Arduino main control circuit, comprising a street light body, characterized in that: A control box is installed on the street light body, and a control circuit board is installed inside the control box. The control circuit board adopts an Arduino main control circuit with ATmega328 as the core. A solar panel is installed at the light-receiving position of the street lamp body. The solar panel is connected to the analog signal acquisition interface of the ATmega328 microcontroller and is used to output a voltage analog signal representing the ambient light intensity to the ATmega328 microcontroller. The street light body is equipped with through-beam infrared photocells along the traffic path. Each through-beam infrared photocell includes an infrared transmitter and an infrared receiver arranged opposite to each other. The signal output of the through-beam infrared photocell is connected to the digital acquisition terminal of the ATmega328 microcontroller and is used to output a blocking pulse signal representing traffic flow to the ATmega328 microcontroller. The street light body is equipped with an LED street light load, and the control box is equipped with an LED driver circuit. The LED driver circuit is connected between the PWM output terminal of the ATmega328 microcontroller and the LED street light load, and is used to adjust the brightness of the LED street light load according to the PWM duty cycle. The control box is also equipped with a serial-to-Wi-Fi module based on RT5350. The serial port of the serial-to-Wi-Fi module is connected to the ATmega328 microcontroller, and the Wi-Fi communication port is connected to the Android display terminal to upload the street light operation data to the Android display terminal. The ATmega328 microcontroller is programmed with an intelligent dimming control program. This program is used to collect and store historical traffic flow data for different time periods according to a set time period. Based on the historical traffic flow data, it predicts the traffic flow for the next statistical period and generates a pre-adjusted PWM duty cycle. Within the 15-minute statistical period, it performs fuzzy PID control based on the real-time ambient light intensity and real-time traffic flow according to the sampling period to generate a PWM duty cycle fine-tuning amount. This enables the LED driver circuit to drive the LED street light load according to the final PWM duty cycle formed by the pre-adjusted PWM duty cycle and the PWM duty cycle fine-tuning amount. When the deviation between the real-time traffic flow and the predicted traffic flow meets the abnormal deviation condition, it switches to real-time dimming mode.

2. The intelligent street light system based on the Arduino main control circuit according to claim 1, characterized in that: The intelligent dimming control program is used to obtain the light intensity deviation based on the real-time ambient light intensity and the reference light demand parameters, and to obtain the traffic flow deviation based on the real-time traffic flow and the reference traffic flow parameters. The light intensity deviation, traffic flow deviation and their changes are used as fuzzy PID control inputs to dynamically correct the PID parameters and generate the PWM duty cycle fine-tuning amount.

3. The Arduino master circuit based intelligent street light system as claimed in claim 1, wherein: The intelligent dimming control program is used to predict historical traffic flow data for different time periods based on a sliding window time series model, which includes the ARIMA time series model. When the deviation between the real-time traffic flow and the predicted traffic flow exceeds a preset ratio, the ATmega328 microcontroller switches to real-time dimming mode and records the abnormal traffic flow data.

4. A method for intelligent street light based on Arduino master circuit, characterized in that, Includes the following steps: S1. Initialization and Data Establishment: The ATmega328 microcontroller, with ATmega328 as its hardware core, establishes a data channel between the solar panel, through-beam infrared photocell sensor, LED driver circuit, serial-to-Wi-Fi module, and Android display terminal. It also establishes a control output channel for driving the LED street light load via the LED driver circuit, and loads initial PID parameters, baseline illumination demand parameters, baseline traffic flow parameters, initial PWM output value, abnormal deviation judgment conditions, and time-segmented historical traffic flow data. S2. Environmental and Traffic Data Acquisition: The ATmega328 microcontroller acquires the light detection signal output from the solar panel and the traffic detection signal output from the through-beam infrared photocell sensor, processes them to obtain real-time ambient light intensity and real-time traffic flow, and uses the real-time ambient light intensity and real-time traffic flow as input data for subsequent real-time fine-tuning. S3. Predictive and Pre-adjustment: The ATmega328 microcontroller calculates and updates the historical traffic flow data for each time period based on real-time traffic flow in a 15-minute statistical cycle. The ATmega328 microcontroller then predicts the traffic flow for the next statistical cycle based on the historical traffic flow data for each time period and generates a pre-adjusted PWM duty cycle in combination with the baseline illumination demand parameters. S4. Real-time fine-tuning: Within a 15-minute statistical period, the ATmega328 microcontroller updates the real-time ambient light intensity and real-time traffic flow according to a 1-second sampling period, and performs fuzzy PID control based on the updated real-time ambient light intensity and real-time traffic flow to generate a PWM duty cycle fine-tuning amount for correcting the pre-adjusted PWM duty cycle. S5. Driving and Feedback: The ATmega328 microcontroller superimposes the pre-adjusted PWM duty cycle and the PWM duty cycle fine-tuning amount to form the final PWM duty cycle, and outputs it to the LED driver circuit to drive the LED street light load. When the deviation between the real-time traffic flow and the predicted traffic flow meets the abnormal deviation judgment condition, the ATmega328 microcontroller switches to real-time dimming mode. At the same time, the ATmega328 microcontroller uploads the street light operation data to the Android display terminal through the serial-to-Wi-Fi module.

5. The Arduino master circuit based smart street light method as claimed in claim 1 wherein, In S1, the initial PID parameters include the initial proportional coefficient, the initial integral coefficient, and the initial derivative coefficient. The baseline illumination demand parameters are determined based on sunrise and sunset times, seasonal variations, road grades, and lighting safety requirements. The baseline traffic flow parameters are determined based on traffic flow reference values ​​for the corresponding time period and road type.

6. The Arduino master circuit based smart street light method according to claim 1, wherein, In step S2, the ATmega328 microcontroller acquires the light detection signal output by the solar panel through the analog acquisition terminal, and obtains the real-time ambient light intensity based on the relationship between the output voltage of the solar panel and the on-site calibration; the ATmega328 microcontroller acquires the traffic detection signal output by the through-beam infrared phototransistor through the digital acquisition terminal, and obtains the real-time traffic flow based on the number of occlusion pulses.

7. The Arduino master circuit based smart street light method as claimed in claim 1 wherein, In S3, the ATmega328 microcontroller uses a sliding window time series model to predict historical traffic flow data in different time periods. The sliding window time series model includes the ARIMA time series model, and the ATmega328 microcontroller trains and updates the parameters of the ARIMA time series model during periods of low traffic flow.

8. The Arduino master circuit based smart street light method as claimed in claim 4 wherein, When the ATmega328 microcontroller uses the ARIMA time series model for prediction, it takes the historical traffic flow data of the most recent several days in different time periods as training data and validation data, and adjusts the order of the ARIMA time series model when the validation error is greater than the preset error condition.

9. The Arduino master circuit based smart street light method as claimed in claim 1 wherein, In step S4, the ATmega328 microcontroller obtains the light intensity deviation based on the real-time ambient light intensity and the reference light demand parameters, and obtains the traffic flow deviation based on the real-time traffic flow and the reference traffic flow parameters. The light intensity deviation, traffic flow deviation, and the corresponding deviation changes are used as inputs for fuzzy PID control to dynamically correct the PID parameters and generate PWM duty cycle fine-tuning.

10. The intelligent street light method based on Arduino main control circuit according to claim 1, characterized in that, In S5, the ATmega328 microcontroller limits the final PWM duty cycle to the range of 0% to 100%, and uploads real-time ambient light intensity, real-time traffic flow, predicted traffic flow, pre-adjusted PWM duty cycle, PWM duty cycle fine-tuning amount, final PWM duty cycle, system operating mode, and abnormal status flags to the Android display terminal through a serial-to-Wi-Fi module.