Monday, March 13, 2017

Video!

Here is a short video of the solar tracker finding the sun!

 

Sunday, March 12, 2017

Troubleshooting the motor

For the last two weeks, the motor hasn't been doing exactly what it should be doing. The black wheel would turn for a couple degrees but then it seemed to get stuck and just bounce back a forth. We first went through the code printing the position of the motor and everything seemed to be working correctly on the serial monitor. When it would get stuck, it seemed like it usually happened at 180 degrees which is the maximum value the motor can reach.

After looking at the code, we decided to look at the motor itself. When the wheel began to wobble, applying the slightest pressure to the bottom of the outside of the wheel seemed to stop the wobbling and allowed the wheel to turn in either direction. After troubleshooting, it was discovered that the wheel was slightly off balance and when it turned just right, it began to wobble back and forth. (RESONANCE!)

To further test this issue, we put a pipe cleaner that was spiraled enough to sit on the wood and to reach the wheel so that it could apply slight pressure as the wheel turned. This seemed to work and proved that the wheel is slightly off-balance and may need supports to work properly.

Solar Tracker Apparatus

 
The apparatus, shown in the picture below, automatically rotates the photovoltaic cell (PV) to track the sun.
 
 
 The PV cell is placed on this padding in the picture below, which is a close-up of the upper right corner in the photo above. This is also where the photo-resistor sensors are located. At the bottom of this platform, there are two photoresistors that look like two small circles separated by a wooden wall. The purpose of this wall is to ensure that the PV cell is facing directly at the sun. If it is not, then it casts a shadow on one of the sensors. As I explained in a previous blog post, the sensors have different resistance values depending on how much light they are exposed to. This idea is the basis for the C++ code. If one resistor value is smaller than the other, than the Arduino outputs to the motor to turn one direction. If the other resistor value is smaller, than the Arduino outputs to the motor to turn in the opposite direction. This process will continue to take place until both sensors are receiving the same amount of light and no shadows are cast on them.
 
The last main piece to the apparatus is the servo motor. The motor is connected to the bottom of the black wheel shown below. On either side of the wheel is a track that allows the wheel to move left and right. This allows the wheel to be pushed up against the lazy susan (which is barely shown on the right hand side of the picture). As the motor turns, the black wheel turns and when it is pushed up against the lazy susan, that turns as well. This is what rotates the PV cell in the phi direction.
 

Wednesday, March 1, 2017

How to calculate the values of the sensors


As I mentioned in a previous post, this is the output that is printing on the serial monitor of the Arduino IDE when I have four photoresistors set up in a voltage divider with four 10k ohm resistors. (The schematic diagram and an image of the actual circuit can be found on 2/7/17.)

The values that are printing for each of the four sensors are actually the voltages outputted from the voltage divider as a 10 bit number.
 
analogRead() returns a value, in bits, and automatically defaults to 10 bits (returns values between 0-1023) (https://www.arduino.cc/en/Reference/AnalogReadResolution). I am using 5v as power. This is the maximum voltage which maps over to the maximum value in bits, 1023. 

The values printed as the sensor values can be calculated using a proportion. The equation will be the output voltage from the voltage divider over the maximum voltage (5v) which is equal to the value printed on the serial monitor over the maximum voltage in bits (1023).

For example, if the photoresistor, at a particular moment, had a value that was equal to the other resistor in the voltage divider, which in this case is 10,000 ohms, then the voltage divider will output exactly half of the initial power, which is 5v. This means that the output will be 2.5v so the value that will print on the serial monitor will be that number in bits which is calculated below:

2.5v  =    x   
 5v        1023

So the value of x is about 512.