Introduction: Light Controlled Servo Using LinkitONE

Picture of Light Controlled Servo Using LinkitONE

Hello,

Here i'll show you how you can control your servo motor using light!

More light, more the speed of servo motor

Step 1: Parts

Picture of Parts

You will need-

1 x LDR

1 x LinkitONE

1 x Mini Servo

Step 2: Attach Servo Motor

Picture of Attach Servo Motor

Now we will build the servo motor. After that we will attach it.

We will using PIN 9 to attach the servo.

Step 3: Connect Light Sensor

Picture of Connect Light Sensor

Connect your LDR. Connect it into A0 pin and ground pin one.

Step 4: Connect USB

Picture of Connect USB

Now connect your USB cable with laptop and board so we can power the board.

Step 5: Write Code

Burn this code to your board.

#include'servo.h'

Servo myservo;

int val;

void setup() { myservo.attach(9);

}

void loop() {

val = analogRead(A0);

val = map(val, 0, 1023, 0, 179);

myservo.write(val);

delay(15);

}

Step 6: Test the Servo

Picture of Test the Servo

Now test your servo!

more light, more speed!

Comments

chuqingsheng (author)2017-10-03

My SG90 doesn't work correctly with LinkIt ONE. Why?

Nice...

What volt is your servo. My tower pro SG90 servo not run correctly in mediatek board.

About This Instructable

78views

1favorite

License:

More by kritisethi:LinkitONE SMS powered LEDLinkitONE Music Player Lights On/off on Clap With LinkitONE
Add instructable to: