Skip to main content

Posts

Featured

Arduino with Photoresistor sensor

A photoresistor or light-dependent resistor (LDR) or photocell is a light-controlled variable resistor. The photoresistor is not to differentiate Anode and Cathode. symbol of photoresistor How do I attach an photoresistor to the board? The following schematic shows the basic circuit. If you pick the resistors correctly, you can make the output of this circuit vary between a little over zero and a little under five volts for your range of light intensity. To pick the resistor, you need to realize that this circuit is just a generalization of the basic building block of analog electronics, the voltage divider. int photoRsPin = 0; int photoRsVal = 0; int minValLight = 100; int LEDPin = 13; int LEDState = 0; void setup(){   pinMode(13, OUTPUT);   Serial.begin(9600); } void loop(){   photoRsVal = analogRead(photoRsPin);   Serial.println(photoRsVal);   if (photoRsVal < minValLight && LEDState == 0){     digitalWrite(LEDPin, H

Latest Posts

Atmel AVR Toolchain 3.4.x for Linux

Arduino - Blinking a LED

Servo motor control using AT89S52

RetroBSD: Unix for microcontrollers

Linux on an 8-bit micro

BeagleBone Black

Using Microcontroller AT89S52 to blink LED and implemented on breadboard

AVR教學

HOW TO USE 8051

Schematic and Input/Output pins explain for Arduino UNO R3