0% found this document useful (0 votes)
48 views4 pages

Laporan Progres Project Embedded System

The group is working on a "Solar Tracker Data Acquisition System" project using an Arduino. The system will use LDR sensors, servos, and a solar cell to track the sun's movement and adjust the solar cell's position accordingly. They are currently developing the Arduino code to read sensor values, calculate differences between top/bottom and left/right sensors, and adjust the servos within tolerance thresholds to keep the solar cell positioned on the sun.

Uploaded by

Yosua cris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views4 pages

Laporan Progres Project Embedded System

The group is working on a "Solar Tracker Data Acquisition System" project using an Arduino. The system will use LDR sensors, servos, and a solar cell to track the sun's movement and adjust the solar cell's position accordingly. They are currently developing the Arduino code to read sensor values, calculate differences between top/bottom and left/right sensors, and adjust the servos within tolerance thresholds to keep the solar cell positioned on the sun.

Uploaded by

Yosua cris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

LAPORAN PROGRES PROJECT EMBEDDED SYSTEM

NAMA KELOMPOK:
1. YOSUA CHRISTMAS (10311810003020)
2. GAYUH SODAQTA (1031180000000040)
3. Muhammad Fauzi Alwi(10311800000021)

Disini kami ingin membuat “Sistem Akuisisi Data Monitoring Pelacak Matahari (Solar
Tracker)

Dimana alat yang dibutuhkan meliputi:


-Arduino
- Resistor 330 Ohm 3 buah
- Motor Servo
- LDR
- Solar Cell
Kami sedang membuat / Mencari program Arduino
#include <Servo.h> // include Servo library
// 180 horizontal MAX
Servo horizontal; // horizontal servo
int servoh = 180; // 90; // stand horizontal servo
int servohLimitHigh = 175;
int servohLimitLow = 5;
// 65 degrees MAX
Servo vertical; // vertical servo
int servov = 45; // 90; // stand vertical servo
int servovLimitHigh = 60;
int servovLimitLow = 1;
// LDR pin connections
// name = analogpin;
int ldrlt = 0; //LDR top left - BOTTOM LEFT <--- BDG
int ldrrt = 1; //LDR top rigt - BOTTOM RIGHT
int ldrld = 2; //LDR down left - TOP LEFT
int ldrrd = 3; //ldr down rigt - TOP RIGHT
void setup(){
Serial.begin(9600);
horizontal.attach(8);
vertical.attach(9);
horizontal.write(180);
vertical.write(45);
delay(3000);
}
void loop() {
int lt = analogRead(ldrlt); // top left
int rt = analogRead(ldrrt); // top right
int ld = analogRead(ldrld); // down left
int rd = analogRead(ldrrd); // down right
int dtime = 10; int tol = 90; // dtime=diffirence time,
tol=toleransi
int avt = (lt + rt) / 2; // average value top
int avd = (ld + rd) / 2; // average value down
int avl = (lt + ld) / 2; // average value left
int avr = (rt + rd) / 2; // average value right
int dvert = avt - avd; // check the diffirence of up and down
int dhoriz = avl - avr;// check the diffirence og left and rigt
Serial.print(avt);
Serial.print(" ");
Serial.print(avd);
Serial.print(" ");
Serial.print(avl);
Serial.print(" ");
Serial.print(avr);
Serial.print(" ");
Serial.print(dtime);
Serial.print(" ");
Serial.print(tol);
Serial.println(" ");
if (-1*tol > dvert || dvert > tol) // check if the diffirence is in
the
tolerance else change vertical angle
{
if (avt > avd)
{
servov = ++servov;
if (servov > servovLimitHigh)
{
servov = servovLimitHigh;
}
}
else if (avt < avd)
{
servov= --servov;
if (servov < servovLimitLow)
{
servov = servovLimitLow;
}
}
vertical.write(servov);
}
if (-1*tol > dhoriz || dhoriz > tol) // check if the diffirence is
in the
tolerance else change horizontal angle
{
if (avl > avr)
{
servoh = --servoh;
if (servoh < servohLimitLow)
{
servoh = servohLimitLow;
}
}
else if (avl < avr)
{
servoh = ++servoh;
if (servoh > servohLimitHigh)
{
servoh = servohLimitHigh;
}
}
else if (avl = avr)
{
delay(5000);
}
horizontal.write(servoh);
}
Serial.print(" ");
Serial.print(servoh);
Serial.print(" ");
Serial.print(servov);
Serial.print(" ");
delay(dtime);
}

You might also like