# Light & Dark Detecting Circuit Using Arduino UNO

5,044

48

2

In this instructable, i will show how to make a Light and Dark Detecting circuit using Arduino UNO with a single circuit just by changing simple sketch or program

### 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: Video

You can watch the video to see how it works or continue reading to try it yourself

You Can Subscribe To My YouTube Channel Here : https://goo.gl/ctc8l9

## Step 2: Things Required

1. Arduino UNO

2. LDR

3. 470 Ohm Resistor

4. 1k Resistor

6. Jumper Wires

-------------------------------------------------------------------------------------------------------------------------------------------------

If you interested in making this product you can use my affiliate buying links :
Amazon US:

Arduino UNO : http://amzn.to/29TsMvE

Resistors : http://amzn.to/2a2CzU8

Bread Board & Jumper Wires : http://amzn.to/2a5VCw5

Amazon India:

Arduino UNO : http://amzn.to/2ae6tn7

Resistors : http://amzn.to/29GbUwT

Jumper Wires : http://amzn.to/2a5zh2p

## Step 4: Construction

Connect the circuit according to the circuit diagram as shown in the previous step

## Step 5: Sketch or Program

How LDR works ?

The resistance of a photo resistor or LDR decreases with increasing incident light intensity. Which means as the light intensity increases the resistance decreases & vice versa.

So this logic is considered in the sketch

In the sketch we compare the default set value which is defined as BRIGHTNESS in the sketch and compare it to the output of the LDR

DARK DETECTION
To detect the dark we compare the default value to the LDR value. IF the value of the LDR is less then the default value, the GREEN LED glows which means its dark

LIGHT DETECTION

To detect the dark we compare the default value to the LDR value. IF the value of the LDR is greater then the default value, the GREEN LED glows which means its day/light

## Step 6: Dark Detection

In the pictures you can see how the circuit works.

DARK DETECTION
To detect the dark we compare the default value to the LDR value. IF the value of the LDR is less then the default value, the GREEN LED glows which means its dark.

Testing begins @ 1:56

## Step 7: Changing the Code From Dark to Light Detecting Circuit

Above circuit shows the change in the circuit to be made to convert it to Light detecting from the dark detecting circuit

## Step 8: Light Detection

In the pictures you can see how the circuit works.

LIGHT DETECTION

To detect the dark we compare the default value to the LDR value. IF the value of the LDR is greater then the default value, the GREEN LED glows which means its day/light

Testing begins @ 3:06

------------------------------------------------------------------------------------------------------------------------------------------------

Arduino Software : www.arduino.cc

------------------------------------------------------------------------------------------------------------------------------------------------

If you interested in making this product you can use my affiliate buying links :

Do you want to support my videos?
If Yes, Please browse and buy things from my Amazon Store. This way I get a small commission which will help me produce more videos. Please use the link to visit my store : http://goo.gl/gKjns4

You can also contribute to me on Patreon using the link : https://goo.gl/JHoagv

Amazon US:

Arduino UNO : http://amzn.to/29TsMvE

Resistors : http://amzn.to/2a2CzU8

Bread Board & Jumper Wires : http://amzn.to/2a5VCw5

Amazon India:

Arduino UNO : http://amzn.to/2ae6tn7

Resistors : http://amzn.to/29GbUwT

Jumper Wires : http://amzn.to/2a5zh2p

--------------------------------------------------------------------------------------------------------------------------------------------

You Tube : https://goo.gl/ctc8l9

Instagram : https://www.instagram.com/makestuff_ms/

## Recommendations

• ### Internet of Things Class

22,703 Enrolled

## 2 Discussions

Well written instructable. Good clean code.

Cool project bro...

as I needed

I'll try to link the code with my another project..

Thanks...