Solar Tracker
February 2019
I spent two weeks working in UCT’s Control Lab under the supervision of Mr Dominic De Maar. I attempted to design and build a Solar Tracker, a small robot that would locate the position of the sun, and constantly orient itself to point towards it. The project required work in a variety of fields such as 3D CAD design, 3D printing, laser cutting, metalwork, woodwork, electrical design and computer programming.
I used a Raspberry Pi 3B microcontroller to handle all of the computation and control and built a sensor using light-dependent resistors (LDR’s) enclosed in a specially-designed housing that would help it determine the position of the sun. The sensor sends readings to an analogue-to-digital converter (ADC), which can then be read by the Raspberry Pi. Based on these readings, the Raspberry Pi calculates the necessary control action to orient the sensor. A two degree of freedom (DOF) arm, actuated by two DC motors (controlled by an H-Bridge) moves the arm to line the sensor up with the sun.

Sensor Design
A custom sensor was built to locate the position of the sun. This consisted of 4 LDR's, forming two pairs opposite one another. Because of the design of the enclosure, if the sun is not aligned with the sensor on a particular axis, it will cast a shadow on one of the LDR's. By reading the voltages of the LDR's, a difference in light levels can be detected, meaning the sensor is misaligned on that axis. This information is supplied to the Raspberry Pi, which then computes a control action to correct the difference.
CAD and 3D Printing
Computer-Aided Design (CAD) was used to design several components of the Solar Tracker, such as the case for the Raspberry Pi, endcaps for the arms, the sensor enclosure, and a perspex box to enclose all the circuitry. The 3D printed components are shown below.
Metalwork
Quite a bit of metal machining was required. Metal brackets were made to attach the motors to the box and to the vertical arm. To attach the rotating platform and upper arm to the motor shafts, special shaft connectors were made. Large bolts were cut and filed to leave only the hexagonal top. A hole was drilled through the centre to insert the shaft. A hole was drilled and tapped in the side of the connector so that a small bolt could be inserted and tightened to hold onto the motor shaft. Two additional holes were drilled into the front of the connector so that the rotating platform or upper arm could be securely attached to the connector. The brackets and connectors are shown below.
Circuitry
Two circuits were designed and built on veroboard. A complex network of cables connected each of the components.
Other Work
A box to enclose the circuitry, the rotating platform, and the upper arm were carefully designed in SolidWorks and laser cut from a sheet of perspex. A channel was carved into the wooden platform using a Dremel to provide a secure footing for the perspex box.
Conclusion
The entire assembly very neat and mechanically sound. Unfortunately, the motors used could not produce enough torque to rotate the vertical and horizontal arms. The system was partially successful, as it did show a response to the location of the sun and moved slowly if it was given a “helping hand” to overcome friction and the weight of the arms. The system could work really well with some minor improvements. This vacation work experience was very beneficial as I learnt and practiced several skills that will prove very useful in the engineering profession.
Improvements
More powerful motors should be used. Stepper motors should be used to precisely control the position of the shaft and thus the rotation of the arms. This would require alterations to the code. The contact between the rotating platform and the box produced quite a lot of friction. Bearings or some other mechanism should be used to reduce the friction, which would reduce the torque required from the motors.
Shortly after working on this project, I studied "Mechatronics II" under Associate Professor Amir Patel, where I studied topics including Lagrangian mechanics, 3D kinematics and dynamics, and complex digital control techniques such as Linear Quadratic Regulator controllers. With this knowledge, more complex and accurate modelling of the Solar Tracker could be done, and better control techniques could be implemented to develop the system further.