Introduction: Solar Tracker Device

By following these steps, you will be able to create and implement a solar panel that adjusts its positioning to follow the sun. This allows for the maximum amount of energy captured throughout the day. The device is able to sense the strength of light that it is receiving using two photo-resistors, and it uses this information to decide what direction it should be facing.

Learning Objectives

  • Learn about wiring a breadboard
  • Learn how to conduct basic functions (upload/initialize code) on Arduino
  • Learn about different electrical components
  • Learn about how alternative energy production can be enhanced

As this is a project for class, we are looking to address some of the Standards for Technological Literacy (STL) by ITEEA. What we want students to learn from this project is:

Standard 16: Energy and Power Technologies

It is the responsibility of all citizens to conserve energy resources to ensure that future generations will have access to these natural resources. To decide what energy resources should be further developed, people must critically evaluate the positive and negative impacts of the use of various energy resources on the environment.

Grades 6-8 Power systems are used to drive and provide propulsion to other technological systems Much of the energy used in our environment is not used efficiently.

Grades 9-12 Energy can be grouped into major forms: thermal, radiant, electrical, mechanical, chemical, nuclear, and others Energy resources can be renewable or nonrenewable Power systems must have a source of energy, a process, and loads

Cost Estimation is for Solar Panel Kit ($50), Arduino Kit ($40), and Assorted Lego Parts ($25) for a total of $115 for all parts, brand new.

Step 1: Support Base

Grab four of these 1x16 (15 holes) lego bricks and put them together as in the second picture

Step 2: Swivel Mount

Two of these components will be made, so double the components needed and reverse them for the other side.

Grab one of these gray pieces, one black "H" connector, and a single connecting peg with a plus peg on one side and a round peg on the other.

Build the component as shown in the second picture and build the second one in a reversed manner for the opposite side.

Step 3: Combine Steps 1 & 2

Assemble the base and the previous attachments as shown in the picture

Step 4: Solar Panel Base

Duplicate these quantities and reverse construction for the opposite side.

Grab one 11x1 connector rod, two angled pieces, and 8 all round connecting pieces.

Assemble as shown in the second picture.

Step 5: Solar Panel Slot

Duplicate construction.

Use four 90 degree connectors, two 15x1 connecting rods, and two 9x1 connecting rods and assemble as shown in the second picture

Step 6: Stability Connectors

Duplicate construction.

Take two 90 degree connectors, and a 13x1 connector rod and snap them together as shown in the second picture.

Step 7: Solar Panel Holding Assembly

Take the previously built parts and assemble.

Step 8: Solar Panel Arms

Attach the H connector and the L connector as shown in the second picture.

Step 9: Solar Panel Arms Cont.

Using a different L connector and two single pegs, attach them as shown.

Step 10: Solar Panel Arms Cont.

Next, you should grab another L connector, one with a shorter base, and two more pegs, and connect them as well.

Step 11: Solar Panel Arms Cont.

Now you will add a straight piece and two more pegs to the assembly as shown.

Step 12: Solar Panel Arms Cont.

For the final step in assembling the arm, add a final L piece as shown. This piece will face up to help hold the solar panel.

Step 13: Add Part to Assembly

Connect the part that you just created to the assembly as shown in the images. Then, create another one exactly like it and add it to the other side.

Step 14: The Base

Using the pieces shown in the pictures, you will assemble to alike pieces that will serve as a base for the solar tracker. Once assembled, attach them as shown.

Step 15: Rotating the Assembly

To allow the assembly to rotate, we need to attach another piece to the bottom that will do this. Build the square using 4 pieces as shown earlier in the instructable, and attach the connectors as shown.

Step 16: Inserting the Solar Panel

To insert the solar panel, you may need to remove one of the arms. Simply take one off, slide in the panel, and reattach it.

Step 17: Attaching the Servo Motor

Using the pieces laid out, build the assembly as shown.

Step 18:

You should attach this next piece using a wire or something similar to secure it.

Step 19:

Attach the newly formed assembly to the overall assembly as shown. This will help with the placement of the servo motor.

Step 20: Connect Photo-resistors to Wires

Connect the ends of each photo-resistor to wires as shown.

Step 21: Attach Photo-Resistors to Assembly

Using tape or other adhesive, attach the photo-resistors to each end of the assembly as shown.

Step 22: Gather Electronic Parts

Ensure that you have all the parts displayed, or their equivalent, before you begin the electrical assembly.

-Arduino: Uno R3 Controller Board

-9x Jumper Wires

-4x Female-to-Male Dupont Wires

-1x 9V Battery

-1x Battery Snap-on Connector Clip

-2x 1K Ohm Resistors

-2x Photo-resistor (Photocell)

-1x Servo Motor (SG90)

All components come readily available in the Elegoo Super Starter Kit

Step 23: Attach Servo Motor

Wire the servo motor into the breadboard and Arduino as shown. The brown wire is negative, the red wire is positive, and the yellow wire is the control for the servo.

Step 24: Wire Photo-Resistors

Wire the photo-resistors into the breadboard as shown. Then, place the electrical assembly into the base as shown.

Step 25: Load Code

A PDF copy of the code, as well as the actual Arduino program file have been included for use. The Servo library has been included and will need to be saved on the computer prior to compiling the code.

A text copy of our code is below; it looks nasty because of the lack of formatting when it was pasted, but it should compile.

//Solar Tracker
//NC State University //TDE 331 //Taylor Blankenship, Preston McMillan, Taylor Ussery //December 3, 2018 /* * This program is written to control a simple one-axis solar tracker. * The program measures variable resistance from two photo-resistors, one on either side of the solar panel. * In the real world, the two resistors would determine which way to turn the solar panel, East or West, depending on the sun's position in order to maximize alternative energy production of electricity. */ //You will need to include the attached servo package so the Arduino knows how to control its functions #include // create servo object to control a servo Servo myservo; // variable to store the servo position int pos = 90; // list pins for photocell resistors int east = 0; int west = 1; // photocell values to be compared int eastRead; int westRead; // which way should the solar panel turn? int compass = -1; void setup() { // attaches the servo on pin 9 to the servo object myservo.attach(9); //Initializes the servo to 90 degrees, the middle of its range myservo.write(90); //Allows user to place servo on mount within 5000ms or 5 sec delay(5000);

//Starts Serial monitor for testing purposes Serial.begin(9600); } void loop() { //Determines values from Photocell resistors eastRead = analogRead(east); westRead = analogRead(west); //Does the solar panel need to turn towards the East? if(eastRead > westRead) { Serial.println("East"); //Sets variable to turn servo towards the East compass = 0; } //Does the solar panel need to turn towards the West? if(westRead > eastRead) { Serial.println("West"); //Sets variable to turn servo towards the West compass = 1;

} //Below group of if(compass == 0) { degree tolerance if(5 <= pos && pos <= 175) { //Subtracts 1 from the "pos" variable and overwrites the integer pos -= 1; //Sets the position of the servo myservo.write(pos); } Serial.println(pos); } //Below group of code turns solar panel towards the West if(compass == 1)

code turns solar panel towards the East position is in between 5 and 175 //0 and 180 are the maximum values of the servo and this has a 5

//If the servo

{ //If the servo position is in between 5 and 175 //0 and 180 are the maximum values of the servo and this has a 5 degree tolerance if(5 <= pos && pos <= 175) { //Adds 1 to the "pos" variable and overwrites the integer pos += 1; //Sets the position of the servo myservo.write(pos); } Serial.println(pos); } //Catch to make sure the servo stays within the 5 degree tolerance if(pos < 5) { //Manually sets "pos" variable to the integer of 5 pos = 5; //Sets the position of the servo myservo.write(pos); } //Catch to make sure the servo stays within the 5 degree tolerance if(pos > 175) { //Manually sets "pos" variable to the integer of 175 pos = 175; //Sets the position of the servo myservo.write(pos); } //Allows for 100 milliseconds for the servo to reach its new position delay(100); }