Light Input: Linkit ONE

Introduction: Light Input: Linkit ONE

About: My name is Zach Sousa and I'm a Canadian highschool student that has a passion for making.

In this instructable, I will show you how to use light as an input to control devices. First we will make a circuit that turns on an LED when it gets dark, then, a circuit that automatically turns lamps on and off.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Parts and Tools

Here are the parts and tools required to make this project:



Linkit ONE board


10k resistor

jumper wire

2n2222 transistor (optional)

relay (optional)


Computer with latest version of the Arduino IDE and linkit ONE drivers

Step 2: Wiring for LED

Wire the LDR to the board as shown in the second picture, with one exception; pin A0. Instead of wiring to pin A0, wire it to A1. A0 doesn't seem to work as an analog input on the linkit ONE.

Now, wire the positive lead of the LED to pin 13, and the negative pin to GND on the board.

Step 3: Upload Code

Here is the code:

Download it then double click to open it, then plug the board into your computer, then press upload.

Step 4: Wiring for Relay

For the relay wiring, view this instructable for a detailed (yet messy...) diagram:

Keep the LDR plugged in as it is.

Step 5: How to Use (Relay Version)

To use the relay version, plug the relay cord into the wall. Then, Plug a lamp into the output of the relay circuit. make sure that the LDR isn't near the lamp, or it can go into a loop that makes the lamp blink. This is caused by the room originally being dark, so it turns on the lamp, then the room is bright so it turns the lamp off and so on.

Step 6: Done!

Thanks for viewing this instructable! If the project works, an led will turn on when it gets dark in a room, or if you went a step further, controls a lamp.

Be the First to Share


    • Magnets Challenge

      Magnets Challenge
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest