Dark Sensor -Arduino for Beginners

2,909

34

5

Published

Introduction: Dark Sensor -Arduino for Beginners

Hi Guys,

This is my first instructable. It's something anyone can do and is a great first project.Please tell me how I could improve by commenting in the comments section. If you have any doubts Email me(Email ID:greatassassin123@gmail.com).
Please vote if you liked it.

Step 1: Materials Required

i)1*Arduino UNO

ii)1*USB A to B(Normally comes with Arduino board)

iii)1*Photoresistor(LDR)

iv)1*LED (Any Color)

v)1*1K ohm resistor

vi)1*Breadboard

vii)3*Male to Male Jumper wires or standard wires with both ends stripped

(Everything is available on amazon)

viii)A computer running Arduino IDE

Step 2: Building the Circuit

Lets get started for real!

1)Connect a resistor anywhere on one of the middle rows.

2)Connect the photoresistor in such a way that its one leg is in the same column as that of the resistor.

3)Connect a wire in the column of the lone resistor leg and put the loose end into the 'GND' port of the arduino board.

4)Connect a wire in the column which is common to both, the photoresistor and the 1K resistor and put the loose end into the analogue port 'A0'.

5)Connect another wire in the column of the lone photoresistor leg and put the loose end into the '5V' port.

6)Put the longer leg of the LED into the '13' digital port and the short leg into the 'GND' port besides it.

Step 3: Code

i)Connect the arduino board to your computer.

ii)Open Arduino IDE

iii)Choose the right port

iv)Copy and paste the contents of .txt file in the IDE.

Step 4: Done!!!

Share

    Recommendations

    • Planter Challenge

      Planter Challenge
    • Make it Move Contest

      Make it Move Contest
    • Oil Contest

      Oil Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    5 Comments

    I know that i need a 220 ohm resistor but the led would still work.It is just for learning

    Yes the led will still work, but that's not the point: with no resistor to limit the current to about 20-30mA, the Arduino i/o pin is in peril.