A method for controlling a two-axis solar tracker using an astronomical algorithm and a microcontroller is proposed. A practical solution is considered to achieve maximum efficiency of solar panels, which is associated with calculating the position of the sun, determining the desired an-gle for the solar tracker, reading the current angle of the tracker and adjusting its position