Home All Projects
Intermediate

A Simple Light Follower

This lesson aims to show how to make a simple light follower made of cardboard using a microservo.

A Simple Light Follower
20,148 views
10 likes

Components, Tools and Machines

1x 10 jumper wires 200mm male
🛒 Buy Now
1x 10 10k 1/4w resistor
-
1x 4mm cardboard
-
1x mini breadboard - mixed colours
🛒 Buy Now
1x Arduino UNO
🛒 Buy Now
1x Analog 180° Micro Servo
🛒 Buy Now

Apps and platforms

1x Arduino IDE
Official Site

Project description

1. How does it Work?

The choice to go up or down in order to follow the light is done in a very simple way. There are four LDR two up and two down. Arduino reads the analog value of all LDR, if the average of the two upper values is greater than the two lower the light is up so the angle of the microservo is incremented otherwise decremented.

2. A Little Clarification

Since the average is not a fixed number, as you can see in the code, a threshold is used. In this way the angle is changed if and only if the two averages are widely different.

const int threshold = 50;
[.....]
down_average = (A0_val + A1_val)/2;
up_average = (A2_val + A3_val)/2;
diff = abs(up_average-down_average);
if ((up_average > down_average) && (diff > threshold))
{
if (val < 180) //if different from max val
{
val++;
myservo.write(val);
}
}
if((down_average > up_average) && (diff > threshold))
{
if (val > 0) //if different from min val
{
val--;
myservo.write(val);
}
}

3. The Circuit

Make the circuit below!

4. Print & Cut

 Download the attached file, print it, glue it on the cardboard and cut all the pieces for yours light follower. You should obtain something like this.

5. Mount the Base

Mount the breadboard base in this way. Glue it if necessary.

6. Mount the Servo

Mount the servo like below. Screw it for more stability.

7. Mount the Bracket

Mount the bracket in this way.

8. Mount the Servo Gear

Mount the servo gear. Screw it in this way.

9. Put all Together

Put all together. You should obtain something like this

10. Glue the Breadboard on the Base

Glue the breadboard on the base. You can use the biadhesive tape of the breadboard.

11. Screw Arduino

Screw Arduino on the back of the base.

12. Well Done

Well done. Now you have all the necessary. Download the code on your Arduino and enjoy with your light follower!

Code

🔒 Unlock Code

Support to get the Source Code for this project

Project Reference Code: a-simple-light-follower-aa74b1-en
1120 THB
PromptPay QR Code

Project estimate

Want something like this project? Open the estimate page.

The long estimate form has moved to a separate page so this project page stays clean.

รีวิวจากคนใช้งานจริง

รีวิวจากลูกค้าและคนที่เคยใช้งาน

ถ้าเคยสั่งงาน เคยอ่านหน้านี้แล้วได้ประโยชน์ หรือมีข้อเสนอแนะ ฝากรีวิวไว้ได้เลย

กำลังโหลดรีวิว...