Solar energy is known as the most primitive energy, it is clean, renewable, abundant, and widely distributed. However, the low efficiency of solar energy utilization has always hindered the widespread application of solar technology. The design of a solar automatic tracking system provides a new way to solve this problem, greatly improving the efficiency of solar energy utilization. This design utilizes the optoelectronic tracking method, using a stepper motor for dual-axis drive, and feedback signals generated by the optoelectronic sensor in response to changes in incident light intensity to the microcontroller. The microcontroller runs a program to control the tracking mechanism in horizontal and vertical directions, adjusting the angle of the solar panel to track the sun. The solar tracking system implemented by a single-chip microcontroller can effectively improve the photoelectric conversion efficiency of the solar panel and has a wide range of application prospects. Keywords: solar energy; tracking; photodiode; single-chip microcontroller; stepper motor.