LED = Light Emitting Diode
Which is intentionally made to emit the light and it uses semiconductor material.
It has been observe that this normal led is not only emitting the light of particular wavelength but the most amazing fact found that the same LED is converting light energy into electrical signal
so this can be used as a light sensor.

IF YOU WILL MEASURE VOLTAGE OF LED IN LIGHT AND IN ABSENCE OF LIGHT YOU WILL GET FAR DIFFERENCE BUT IT IS DIRECTLY PROPORTIONAL TO LIGHT INTENSITY.

YOU CAN USE SERIES AND PARALLEL COMBINATION OF LED TO MAKE A CELL (A LIGHT CELL)

## Step 1: LED AS a LIGHT DETECTOR? YES

You can use any led

By this sensor we can get the direction of light, and its cheaper and easily available.. I used ARDUINO UNO hardware to simplify circuits by micro controller then analog circuit using transistor as a comparator.

1-ARDUINO BOARD ANY VERSION
2-USB CABLE
3- LED 2 PIECE
4-COMPUTER WITH ARDUINO SOFTWERE

In this circuit we connect,

1st LED: to a analog pin 1 of Arduino and ground- anode is to Arduino pin 0 and cathod is connected to ground

2nd LED: is connected to Digital pin 12 or 13 of Arduino and ground- anode to digital pin 12/13 and cathod to ground you can use series resistor for digital pin 12 or 13

## Step 2: HERE WE GO

int sensorLEDPin = 0 ; // LED as sensor +VE connected to analog pin 0 -VE connected to ground of arduino

int auxopPin = 12; // I have used additional external led for demostration as on board pin13 led cant be seen to ALL

int LEDPin = 13 ; // LED connected to digital pin 13

int LEDval = 0 ; //Variable to store the the LED sensor value

int light = 220; //SETS the intensity of light different led have different sensetive

//auxpin is auxilary pin

// you can use serial moniter and check your led value and choose threshold value
// if in light if it stays at 220 then you can use value for threshold around 200 or 210

// if light falls below this then your circuit led will glow

void setup()

{

pinMode(13,OUTPUT);

pinMode(12,OUTPUT);

Serial.begin(9600);

}

void loop()
{

Serial.println(LEDval);

delay(1000);

if (LEDval >= light)

{ // check if light

digitalWrite(LEDPin, LOW); // if light is there outside, turn off led

digitalWrite(auxopPin, LOW);

}

else

{

digitalWrite(LEDPin, HIGH); // if dark, turn on led

digitalWrite(auxopPin, HIGH);

}

}

## Step 3: Some Other Sensor As a Reverse Application

like led as a light sensor
speaker as a microphone

diode as a temperature sensor

piezo disc as a touch or pressure sensor

motor as a generator

you can like my Facebook page and get updates like this project.
you can see amazing video too ..

Thank you

## Step 4:

<p>i even tried it out with a voltage divider, amplifying the voltage a bit........but it doesn't work most of the times...........</p>
<p>just open serial monitor and see what readings are displayed ?</p>
<p>dude i dont why ..............but its not working</p>
<p>JUST OPEN THE SERIAL MONITOR. AND SEE WHAT VALUE YOU RECEIVED?<br>AND JUST CHOOSE THE THRESHOLD VALUE JUST FEW OF TENS LESS THAN YOU RECEIVED THE VALUE FROM SERIAL MONITOR AND SEE WHAT HAPPENS.</p>
<p>okay i will surely try it out</p>
Have you tried? it e<br>works for me...
which input pin are you usi g? use analog input pin A0.