BU Physical Electronics Lab

Tracking the Sun

Jon Barlow - 5/8/2020

 Abstract: This project uses an Arduino microcontroller to track the position of the sun. A tracking arm is crafted, which serves to hold four photo-resistors and collimate the light each recieves. The tracking arm is then mounted to two micro-servos, each rotating in an independent direction, allowing the arm to point on a sphere. Photo-resistors vary their resistance based on the intensity of light detected, giving us the method to determine where the sun is in the sky. The photoresistors are placed in a voltage divider, and the resulting voltage is fed into the Arduino as an analog input. By comparing the inputs of the four petals, we can output signals to drive the two servos, and point the tracking arm at the sun.
 
  Below, from left to right; (a) We have the schematic for the circuit. A0 - A3 are the analog inputs that result from the voltage division of the photo-resistor and 10K resistor. The analog inputs then determine the digital outputs, which are the pulse-width modulated (PWM) signals sent to the vertical and horizontal servos. In (a) above, the PWM outputs are the orange wires, while the analog inputs are the sea-green wires. (b) On the right is a software diagram, depicting how the analog inputs are used to determine the servo rotations.   Above, from left to right; (a) physical circuit, (b) tracking arm with photo-resistor array, (c) servos and photo-resistor hookup. In (c), the bottom servo rotates horizontally, while the top servo rotates vertically. The tracking arm is attached to the top servo. In (b), we see not 4, but 8 photoresistors. The inner 4 were used for solar tracking, because they are more sensitive to changes in the sun's position.  
 


 

Above: (left) A video displaying the tracking capability of the robot. The video is in real time, and displays the servo's 1 deg. precision. (right) Timelapse of robot tracking the sun over ~105 minutes. At the end of the video, you can see the sunlight was cut short by a cloud front. However, we can see that the arm is actually tracking the cloud front as it passes over the sun, always searching for the brightest source. When the sun is entirely blocked out, the arm is stuck in its position due to the even diffusion of light. During this run (with sunlight) the total Δφ was 20 deg. while the total Δθ was 12 deg.

   

Above: (left) polar view of suns path from my location (lat: 42 deg.) (long: -71 deg.). Radial lines are the azimuthal angle φ, while concentric lines are the elevation angle θ. (right) Rectangular view of path. My window faces south-west, and matches the time when I'm first able to see the sun, at about 2:30 PM. I was able to track until about 4:00 PM. For this time-frame, the graphed Δφ is approximately 21 deg, while the graphed Δθ is around 14 deg. These are approximately the Δ's found by my tracker.

 

Take-aways: The utility of a micro-controller such as an Arduino is very impressive. The game is to just find what output you want for your input. With this in mind the allowable variety of designs is almost endless. Even when you've decided what output you want, arranging it all is another skill entirely. Doing this well requires some amount of foresight, or else you'll be doomed to find mistakes and have to start the process over. For instance, I did not estimate beforehand the change in shadow length for a small change in sun position. While my original design worked for general tracking of a bright object, I had to modify my sensor array for more precise sun tracking. Even my positioning of solar sensors was not perfect, due to the materials used to construct the arm. So I learned a combination of getting output for your input, planning ahead, and fixing issues on the fly. Here's a link to the slides used for my open-house talk on this project - 2020 eLab open-house talk