Adhyoksh Jyoti
Published

Solar panel rotator

A simple project that helps a solar panel to receive the maximum intensity of sunlight.

IntermediateProtip1 hour2,101
Solar panel rotator

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
L293d motor shield
×1
DC Motor, 12 V
DC Motor, 12 V
×1
LDR, 5 Mohm
LDR, 5 Mohm
×2
Resistor 330 ohm
Resistor 330 ohm
×2
Breadboard (generic)
Breadboard (generic)
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×10
9V battery (generic)
9V battery (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver

Story

Read more

Schematics

Circuit schematic

Code

Arduino code

Arduino
#include <AFMotor.h>
AF_DCMotor m1(2);

int left,right;

int convert2binary(int a)
{
  if(a>10)
    return(1);
  else
    return(0);
}

void setup() 
{
  m1.setSpeed(200);
  pinMode(A0,INPUT);
  pinMode(A5,INPUT);
  Serial.begin(9600);
}

void loop() 
{
  left=analogRead(A0);
  right=analogRead(A5);
  left=convert2binary(left);
  right=convert2binary(right);
  if(left>right)
    m1.run(FORWARD);
  else if(right>left)
    m1.run(BACKWARD);
  else
    m1.run(RELEASE);
}

Credits

Adhyoksh Jyoti
11 projects • 9 followers
Electronics and Communication Engineering B.Tech graduate from NIT Srinagar, J&K.
Contact

Comments

Please log in or sign up to comment.