Skip to content

Solar reflecter

Project Idea

A solar reflector system, also known as a solar concentrator, is a device that concentrates sunlight onto a specified target or region using reflecting surfaces. The solar reflector system is intended to increase the intensity of sunlight on a receiver, such as a solar panel. A solar reflector system’s principal function is to maximize solar energy use by focusing sunlight into a smaller surface area. This concentration of sunlight improves energy conversion efficiency and allows the device to create more electricity or heat.

Components

Circuit design for LDRs

Starting week 2 with the coding and designing circuit part, I began to build the circuit by using Arduino MKR 1010 because it is the easiest point of entry to basic IoT and pico-network application designs. I used the 4 LDRs that we need and 2 servo motors with some extra components as shown in the picture below.

First try

Prototype

The circuit is working but there are some issues we have to fix like which design we will use for the system so we can organize the circuit components on the system

In this picture, it is shown clearly the idea, the two stands with motors and a small box to contain the electronics components.

In the above picture we worked on this first prototype for our system by using cartoons to imagine how it will works, and how we can fix it.

3d design

Here we tried to test our design that was done by INVENTOR software, with the help of FABLAB supervisor we printed the design by the 3D printer

And this was the result after 7 hrs:

Issues:

1- After printing we noticed that we forgot to add a key for the rotating system, so we fixed that by drilling and adjusting the model, and this is the final result.

The current issues we faced:

_Adjusting the motor for up and down motion(we need small screw for the motor).

_Adjusting the motor for right and left motion without overloading the motor.

_How to set the 4 LDRs with minimum components

_api for the sun physical tracker


2 LDRs

I started the programming part for the vertical motion with 2 LDRs first.

This shows how the motion was, when the light is closer to the system it moves and when I remove the light it returns back to its position.

All LDRs

And now, here I advanced myself by connecting the 4 LDRs together and started testing the code with it. There is one disadvantage with the system components which is the number of jumber wires I have to use.

It is shown how it tracks the light from 0 degree to approximately 120 degree.


Second design

We tried another design for the motors with the help from the internet we chose this design:

-And this is the result after editing it by Ali Alsaegh:

-I tried sweep code to check if the motion is smooth or not:

I checked if the Arduino MKR1010 can voltage [5 volt] and current, I used the power supply with the help of the technical supervisor, we saw that the max peak the current reaches is 0.8A, so the MKR1010 can manage the load of the four servo motors, because MKR DC Current per I/O pin is 7 mA.

Soldering

-We solder all the LDRs and resistors in a vero board and here are the steps:

1- The soldering tool.

2- Mark the LDRs positions.

3- Soldering the LDRs.

4- Final result.

This is the final touch for the LDR holder with the partitions:

After that, we noticed that the holder is heavier than the servo motor so it can’t moves well, due to that we edited the design and printed again by using Prusa 3D printer

click here. to see how we fixed the problems of the design

Project Code

#include <Servo.h>

// Servo objects
Servo servoX;
Servo servoY;
Servo servoMirrorX;
Servo servoMirrorY;

// LDR pins
const int ldr3Pin = A0;
const int ldr2Pin = A1;
const int ldr1Pin = A2;
const int ldr4Pin = A3;

// Thresholds for LDR readings
const int threshold1 = 200;
//const int threshold2 = 323;

// Servo angles for light tracking
int servoXAngle = 90;
int servoYAngle = 0;

// Fixed mirror angles for reflecting
const int mirrorXAngle=45;  // Adjust this angle as per your requirement
const int mirrorYAngle=-180;  // Adjust this angle as per your requirement

// Smoothing parameters
//const float smoothingFactor = 0.1;  // Adjust this value (0.0 - 1.0) for smoothing servo movements

void setup() {
  // Attach servo objects to pins
  servoX.attach(9);
  servoY.attach(10);
  servoMirrorX.attach(8);
  servoMirrorY.attach(7);

  // Initialize serial communication
  Serial.begin(9600);
  servoX.write(servoXAngle);
  servoY.write(servoYAngle);
}

void loop() {
  // Read LDR values
  int ldr3Value = analogRead(ldr3Pin);
  int ldr2Value = analogRead(ldr2Pin);
  int ldr1Value = analogRead(ldr1Pin);
  int ldr4Value = analogRead(ldr4Pin);

  // Check if LDR readings are above the threshold
  if (ldr3Value > threshold1 && ldr2Value > threshold1 && ldr1Value > threshold1 && ldr4Value > threshold1) {
    // Print LDR values to the serial monitor
    Serial.print(" LDR1: ");
    Serial.print(ldr3Value);
    Serial.print(" | LDR2: ");
    Serial.print(ldr2Value);
    Serial.print(" | LDR3: ");
    Serial.print(ldr1Value);
    Serial.print(" | LDR4: ");
    Serial.println(ldr4Value);
    Serial.print(" | servoX ");
    Serial.println(servoXAngle);
     Serial.print(" | servoY ");
    Serial.println(servoYAngle);

    // Calculate Diff X and Y positions from LDR values
    int diffY = (ldr1Value - ldr3Value);
    int diffX = (ldr4Value - ldr2Value);

    Serial.print(" |diffX ");
    Serial.println(diffX);
    Serial.print(" |diffy ");
    Serial.println(diffY);
    Serial.print(" |MIRRORANG ");
    Serial.println(servoXAngle);
    Serial.print(" |MIRRORANG ");
    Serial.println(servoYAngle);

    // Smooth the servo movements
    if( diffY > 10 ){
      Serial.print(" diffY > 20 ");
      servoYAngle =  servoYAngle + 1;
       servoYAngle = constrain(servoYAngle,0,180);
      servoY.write(servoYAngle);
      servoMirrorY.write(servoYAngle);
    }
    else if ( diffY < 10){
      Serial.print(" diffY < -20 ");
       servoYAngle =  servoYAngle - 1;
        servoYAngle = constrain(servoYAngle,0,180);
       servoY.write(servoYAngle);
       servoMirrorY.write(servoYAngle);
    }

    if( diffX > 100 ){
      servoXAngle =  servoXAngle - 1;
      servoXAngle = abs(servoXAngle);
      servoXAngle = constrain(servoXAngle,80,130);
      servoX.write(servoXAngle);
      servoMirrorX.write(-45);
    }
    else if ( diffX < -100){
       servoXAngle =  servoXAngle + 1;
        servoXAngle = abs(servoXAngle);
       servoXAngle = constrain(servoXAngle,80,130);
       servoX.write(servoXAngle); 
        servoMirrorX.write(45);
    }    
    } else {
    // Stop the servos if the light source is not detected
    servoX.write(90);
    servoY.write(90);
    servoMirrorX.write(90);
    servoMirrorY.write(90);
  }

  // Delay for stability
  delay(200);
}

Results

This is how the system looks finally

This photo shows the reflection from the mirror to the wanted spot

Click here to see the video of the system working.

Teammate websites

See my teammate website for the theoretical and ideas part: Ali Naser website.

See my teammate website for the 3D design part: Ali Sadiq Alsaegh.


Last update: October 1, 2023