How to make a simple automatic solar tracking system using an Arduino Nano board

How to make a simple automatic solar tracking system using an Arduino Nano board

Hello and welcome back! In this project, we will learn how to make a simple automatic solar tracking system using an Arduino Nano board. This system helps the solar panel follow the sun to capture more sunlight and generate more energy. I used two photoresistors (LDRs) to detect light and an SG90 servo motor to move the mini solar panel. This is a single-axis system, which means it moves horizontally. If you want to make a dual-axis system, you can add two more servo motors and two additional photoresistors. This setup allows the panel to track the sun both horizontally and vertically. I have designed a PCB for this project, making it easy to assemble the components. You can also paste the mini solar panel onto this PCB. This is a basic structure that you can use for your school or university projects.

  • How to make a solar tracking system with Arduino UNO – Click on me
  • How to use the Photoresistor with Arduino – Click on me

Ok, let’s do this project step by step. The required components are given below.

Step 1

Firstly, identify these components.

Step 2

Secondly, let’s order PCBs for this project.

  • First, go to the JLCPCB official website and log in to your account.
  • If you are a new member to JLCPCB, please sign up using this link. Then you can get an $80 new user coupon.
  • Register to get $80 Coupons — Click on me

  • Now, click the instant quote button and upload the Gerber file. You can download it using the link below.
  • Gerber file — Download
  • I ordered five PCBs in purple. You can change the color as you wish. Then, select the build time and shipping options. Finally, click the “Save to Cart” button.

Step 3

Thirdly, let’s unbox the PCB package.

Step 4

Now, solder the components onto the PCB one by one.

Step 5

Next, cut a piece of rigifrom board for the PCB base. You can use any suitable material. Then mark the center points of this rigifrom piece and glue the PCB on this piece.

Step 6

Then, cut the rigiform pieces using the following sizes to mount the system and PCB.

Step 7

Then, mark the center point on these pieces and glue the small pieces on the base piece.

Step 8

Now, set your servo motor at 90 degrees and attach the servo horn. Use the images below for that. Then, install the Arduino Nano board on the PCB.

Step 9

Next, connect the stick to the PCB attached rigiform piece. I used a BBQ stick for this. Then, glue the piece of plastic straw to the base structure.

Step 10

Now, glue the servo motor in place and install the completed part onto the base structure. Then, connect the servo motor cable to the PCB.

Step 11

Next, connect the Arduino board to the computer. Then, copy and paste the following code into the Arduino IDE.

/*Solar tracking system
   
Home Page
*/ //Include the servo motor library #include <Servo.h> //Define the LDR sensor pins #define LDR1 A0 #define LDR2 A1 //Define the LED pins #define LED1 2 #define LED2 3 //Define the error value. You can change it as you like #define error 10 //Starting point of the servo motor int Spoint = 90; //Create an object for the servo motor Servo servo; void setup() { //Include servo motor PWM pin servo.attach(11); //Set the starting point of the servo servo.write(Spoint); delay(1000); pinMode(LED1, OUTPUT); pinMode(LED2, OUTPUT); } void loop() { //Get the LDR sensor value int ldr1 = analogRead(LDR1); //Get the LDR sensor value int ldr2 = analogRead(LDR2); //Get the difference of these values int value1 = abs(ldr1 - ldr2); int value2 = abs(ldr2 - ldr1); //Check these values using a IF condition if ((value1 <= error) || (value2 <= error)) { } else { if (ldr1 > ldr2) { Spoint = --Spoint; digitalWrite(LED1, HIGH); digitalWrite(LED2, LOW); } if (ldr1 < ldr2) { Spoint = ++Spoint; digitalWrite(LED1, LOW); digitalWrite(LED2, HIGH); } } //Write values on the servo motor servo.write(Spoint); delay(80); }
  • Now, select the board and port. After, click the upload button.

Step 12

Afterward, install the mini solar panel on the PCB using a piece of double tape. Then, connect the 5V DC power supply to the system.

Now you can test this project using a light source. I used a torch light. Enjoy the project! The full video guide is provided below. We hope to see you in the next project.

How to make a simple automatic solar tracking system using an Arduino Nano board

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *