LDR - Light Controlled Resistor
  • LDR - Light Controlled Resistor

LDR - Light Controlled Resistor

0 Review
€0.49
Tax included
BE15000229

LDRs or Light Dependent Resistors are very useful especially in light/dark sensor circuits. Normally the resistance of an LDR is very high, sometimes as high as 1000 000 ohms, but when they are illuminated with light resistance drops dramatically.

Quantity

  • Política de segurança Política de segurança
  • Política de entrega Política de entrega
  • Política de devolução Política de devolução

Code:

int portaLed = 10; //Port is being used to connect the LED 
int portaLDR = A5; //Analog port used by LDR

void setup()
{
pinMode(portaLed, OUTPUT); //Sets Led door as output
}

void loop()
{
int estado = analogRead(portaLDR); Read the value provided by LDR

// If the value read from the analog port is greater than
// 800, acende o LED
// Set the value below according to your circuit
if (estado > 800)
{
digitalWrite(portaLed, HIGH);
}
else //Otherwise, the LED goes out
{
digitalWrite(portaLed, LOW);
}
}
BE15000229

No customer reviews for the moment.

Add a review

Your email address will not be published.Required fields are marked*

Customers who bought this product also bought:

Related Products