Thingiverse
USING AN LDR SENSOR WITH ARDUINO by tarantula3
by Thingiverse
Last crawled date: 3 years ago
Introduction
Hi Everyone, This is my 1st Arduino's tutorial video. In this video i am going to show you how to use a LDR or Light Dependent resistor to turn on and off another circuit or a LED.
Wouldn’t it be really cool if whenever a room gets dark, a light bulb automatically turns ON and eliminates the darkness? In this very simple project, I am focusing on eliminating darkness. You can even use this as an emergency lighting system.
https://www.youtube.com/watch?v=1rltou-lzyQ
Step 1: Principle
The LDR is a special type of resistor which allows a lower voltage to pass through it (high resistance) whenever its dark and higher voltages to pass (low resistance) whenever there is a high intensity of light.
We are going to use a 10k resistor along with the LDR to create a voltage divider circuit. The varying resistance of the LDR is converted to a varying voltage that the analog pin of the Arduino will then be using in its logic.
Step 2: Hardware Requirement
For this very simple DIY Arduino project we need:
a breadboard
an arduino uno/nano (whatever is handy)
LED (Light Emitting Diode)
LDR (Photoresistor)
A 10K Resistor for creating the voltage divider and a 220ohm resistor for the LED
Few breadboard friendly connecting wires
and a USB cable to upload the code to the Arduino
Step 3: Assembly
Connect the 3.3v output of the Arduino to the positive rail of the breadboard
Connect the ground to the negative rail of the breadboard
Place the LDR on the breadboard
Attach the 10K resistor to one of the legs of the LDR
Connect the A0 pin of the Arduino to the same column where the LDR and resistor is connected (Since the LDR gives out an analog voltage, it is connected to the analog input pin on the Arduino. The Arduino, with its built-in ADC (Analog to Digital Converter), then converts the analog voltage from 0-5V into a digital value in the range of 0-1023). - Now connect the other end of the 10K resistor to the negative rail - And the second (free) leg of the LDR to the positive rail
Pretty much this is what we need for the light sensing. Basic circuits like this can be done without an Arduino aswell. However, if you want to log the values and use it to create charts, run other logics etc. I will recommend an Arduino or ESP8266 or may be a ESP32 for this.
Now, as we want our circuit to do something in the real world other than just displaying the values on the computer screen we will be attaching a LED to the circuit. The LED will turn on when its dark and will go off when its bright. To achieve this we will:
Place the LED on the breadboard
Connect the 220ohm resistor to the long leg (+ve) of the LED
Then we will connect the other leg of the resistor to pin number 13 (digital pin) of the Arduino
and the shorter leg of the LED to the negative rail of the breadboard
Step 4: The Code
const int ledPin = 13;
const int ldrPin = A0;
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(ldrPin, INPUT);
}
void loop() {
int ldrStatus = analogRead(ldrPin);
if (ldrStatus <= 200) {
digitalWrite(ledPin, HIGH);
Serial.print("Its DARK, Turn on the LED : ");
Serial.println(ldrStatus);
} else {
digitalWrite(ledPin, LOW);
Serial.print("Its BRIGHT, Turn off the LED : ");
Serial.println(ldrStatus);
}
}
https://youtu.be/1rltou-lzyQ
Thanks again for watching this video! I hope it helps you. If you want to support me, you can subscribe to my channel and watch my other videos. Thanks, ca again in my next Instructable.
Hi Everyone, This is my 1st Arduino's tutorial video. In this video i am going to show you how to use a LDR or Light Dependent resistor to turn on and off another circuit or a LED.
Wouldn’t it be really cool if whenever a room gets dark, a light bulb automatically turns ON and eliminates the darkness? In this very simple project, I am focusing on eliminating darkness. You can even use this as an emergency lighting system.
https://www.youtube.com/watch?v=1rltou-lzyQ
Step 1: Principle
The LDR is a special type of resistor which allows a lower voltage to pass through it (high resistance) whenever its dark and higher voltages to pass (low resistance) whenever there is a high intensity of light.
We are going to use a 10k resistor along with the LDR to create a voltage divider circuit. The varying resistance of the LDR is converted to a varying voltage that the analog pin of the Arduino will then be using in its logic.
Step 2: Hardware Requirement
For this very simple DIY Arduino project we need:
a breadboard
an arduino uno/nano (whatever is handy)
LED (Light Emitting Diode)
LDR (Photoresistor)
A 10K Resistor for creating the voltage divider and a 220ohm resistor for the LED
Few breadboard friendly connecting wires
and a USB cable to upload the code to the Arduino
Step 3: Assembly
Connect the 3.3v output of the Arduino to the positive rail of the breadboard
Connect the ground to the negative rail of the breadboard
Place the LDR on the breadboard
Attach the 10K resistor to one of the legs of the LDR
Connect the A0 pin of the Arduino to the same column where the LDR and resistor is connected (Since the LDR gives out an analog voltage, it is connected to the analog input pin on the Arduino. The Arduino, with its built-in ADC (Analog to Digital Converter), then converts the analog voltage from 0-5V into a digital value in the range of 0-1023). - Now connect the other end of the 10K resistor to the negative rail - And the second (free) leg of the LDR to the positive rail
Pretty much this is what we need for the light sensing. Basic circuits like this can be done without an Arduino aswell. However, if you want to log the values and use it to create charts, run other logics etc. I will recommend an Arduino or ESP8266 or may be a ESP32 for this.
Now, as we want our circuit to do something in the real world other than just displaying the values on the computer screen we will be attaching a LED to the circuit. The LED will turn on when its dark and will go off when its bright. To achieve this we will:
Place the LED on the breadboard
Connect the 220ohm resistor to the long leg (+ve) of the LED
Then we will connect the other leg of the resistor to pin number 13 (digital pin) of the Arduino
and the shorter leg of the LED to the negative rail of the breadboard
Step 4: The Code
const int ledPin = 13;
const int ldrPin = A0;
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(ldrPin, INPUT);
}
void loop() {
int ldrStatus = analogRead(ldrPin);
if (ldrStatus <= 200) {
digitalWrite(ledPin, HIGH);
Serial.print("Its DARK, Turn on the LED : ");
Serial.println(ldrStatus);
} else {
digitalWrite(ledPin, LOW);
Serial.print("Its BRIGHT, Turn off the LED : ");
Serial.println(ldrStatus);
}
}
https://youtu.be/1rltou-lzyQ
Thanks again for watching this video! I hope it helps you. If you want to support me, you can subscribe to my channel and watch my other videos. Thanks, ca again in my next Instructable.
Similar models
thingiverse
free
MEDIDOR DE ALTERNA by Sergio321
...t;);
lcd.setcursor(11,3);
lcd.print(frequency);//posiciona el cursor y escribe valor
lcd.print("hz ");
delay(500);
}
thingiverse
free
Motion sensing night light by SteveOst
...talwrite(led1,low);
digitalwrite(led2,low);
}
serial.println("motion");
serial.print(motionvalue);
}
else
{
delay(300);
thingiverse
free
Circuit as height - two batteries and four resistors by Toggerson
...nd four resistors by toggerson
thingiverse
a model for the demonstration of the voltage in a circuit using height as an analogy.
thingiverse
free
Arduino Uno Breadboard Stand by blankdesign
...no connects to your breadboard and makes it easier to create and test circuits by holding the arduino at an easier viewing angle.
grabcad
free
Keychain Light
...r-and-a-led/
i used a 12v a23 battery for the power source, increased the number of leds and adjusted the resistors accordingly.
thingiverse
free
ATtiny45/85 ISP adaptor. by dmellis
...e breadboard next to the appropriate legs of the microcontroller, and a 6 pin avr isp header that your programmer can connect to.
thingiverse
free
DIY - ARDUINO BASED CAR PARKING ASSISTANT by tarantula3
...lps you. if you want to support me, you can subscribe to my channel and watch my other videos. thanks, ca again in my next video.
thingiverse
free
Glow in the dark Auto-recharge circuit (Photocell not timer) by jpasternack
...000); // how many microseconds to leave light on for. (10000=10seconds)
digitalwrite(ledpin, low);
}
delay(1000);
}
3dwarehouse
free
analog rotary dial for range
...e 1n4007 diodes to each ldr then tie them all together. run to a single analog read pin. the gradient mesh staggers the voltages.
thingiverse
free
DRIVING A RELAY WITH AN ARDUINO by tarantula3
...lps you. if you want to support me, you can subscribe to my channel and watch my other videos. thanks, ca again in my next video.
Tarantula3
thingiverse
free
DRIVING A RELAY WITH AN ARDUINO by tarantula3
...lps you. if you want to support me, you can subscribe to my channel and watch my other videos. thanks, ca again in my next video.
thingiverse
free
DIY - SOLAR BATTERY CHARGER by tarantula3
...lps you. if you want to support me, you can subscribe to my channel and watch my other videos. thanks, ca again in my next video.
thingiverse
free
DIY - ARDUINO BASED CAR PARKING ASSISTANT by tarantula3
...lps you. if you want to support me, you can subscribe to my channel and watch my other videos. thanks, ca again in my next video.
Ldr
3d_ocean
$15
HDRI - City Night
...is a .hdr-file (highres & lowres version) and a .ldr file of the image (as .jpeg). the environment is...
3d_ocean
$15
HDRI - Crossing
...is a .hdr-file (highres & lowres version) and a .ldr file of the image (as .jpeg). the environment is...
3d_ocean
$15
HDRI - Balk
...is a .hdr-file (highres & lowres version) and a .ldr file of the image (as .jpeg). the environment is...
3d_ocean
$15
HDRI - Hill
...is a .hdr-file (highres & lowres version) and a .ldr file of the image (as .jpeg). the environment is...
3d_ocean
$15
HDRI - Street
...is a .hdr-file (highres & lowres version) and a .ldr file of the image (as .jpeg). the environment is...
3d_ocean
$15
HDRI - parking lot
...is a .hdr-file (highres & lowres version) and a .ldr file of the image (as .jpeg). the environment is...
3d_ocean
$15
HDRI - Avenue
...is a .hdr-file (highres & lowres version) and a .ldr file of the image (as .jpeg). the environment is...
3d_ocean
$15
HDRI - snowfield
...is a .hdr-file (highres & lowres version) and a .ldr file of the image (as .jpeg). the environment is...
3d_ocean
$15
HDRI - Bridge
...is a .hdr-file (highres & lowres version) and a .ldr file of the image (as .jpeg). the environment is...
3d_ocean
$15
HDRI - Lake
...is a .hdr-file (highres & lowres version) and a .ldr file of the image (as .jpeg). the environment is...
Arduino
turbosquid
$7
Arduino
...turbosquid
royalty free 3d model arduino for download as max on turbosquid: 3d models for games, architecture, videos. (1197165)
turbosquid
$3
Arduino
...turbosquid
royalty free 3d model arduino for download as c4d on turbosquid: 3d models for games, architecture, videos. (1305484)
3d_export
$5
arduino satellite
...rt
this model is the exact arduino based satellite model with some basic sensors and camera modules and also includes batteries.
turbosquid
$1
Arduino UNO
...alty free 3d model arduino uno for download as , stl, and wrl on turbosquid: 3d models for games, architecture, videos. (1515932)
3d_export
$5
esp8266 box arduino
...esp8266 box arduino
3dexport
box for esp8266 module with wire hole. inside dimensions: 49x26 mm. height 15 mm.
3d_export
$60
Arduino Uno Rev3 Microcontroller 3D Model
...mega328p circuit board spark cable wire 5v 74v 9v 111v
arduino uno rev3 microcontroller 3d model danielgarnier4403 97237 3dexport
3d_export
free
arduino rover kit
...no!!! materials: no!!! rigged: no animated: no uv mapped: no it is not an exact copy of the original! not subject to 3d printing!
3d_ocean
$7
The housing for the 3d Printer
...the housing for the 3d printer 3docean arduino device housing stl the housing consists of two portions:...
3d_export
$5
arm 4 axis
...uno -4 servo motor 180° -3 joystick (x,y) for arduino -mdf wood -some wires -cnc laser cut...
3d_export
$5
solar tracker
...machine for the frame . list of material : -arduino uno -2 step motor with driver -4 ldr sensor...
Sensor
3d_export
free
parking sensor
...parking sensor
3dexport
car parking sensor
turbosquid
$1
Sensor
... available on turbo squid, the world's leading provider of digital 3d models for visualization, films, television, and games.
3d_export
$5
Smoke sensor
...port
smoke sensor, can be an impressive element for your projects. easy to use, realistic image, low polygon, quality materials.
3d_export
$5
Air Quality Sensor v1
...air quality sensor v1
3dexport
air quality sensor v1
3d_export
$15
float sensor
...e up render. - all parts and materials are logically named. other formats ================= - collada (.dae) - autodesk fbx - obj
turbosquid
$26
Wind sensor C
...free 3d model wind sensor c for download as 3ds, obj, and fbx on turbosquid: 3d models for games, architecture, videos. (1328943)
turbosquid
$26
Wind sensor B
...free 3d model wind sensor b for download as 3ds, obj, and fbx on turbosquid: 3d models for games, architecture, videos. (1328168)
3d_export
$5
ultrasound sensor
...ivers convert ultrasound into electrical signals, and transceivers can both transmit and receive ultrasound. export in: -obj -fbx
3ddd
free
Вытяжка Shindo pallada sensor
... вытяжка
вытяжка shindo pallada sensor. в двух размерах - 600 и 900. текстуры в комплекте.
turbosquid
$52
Wind sensor A B C
...
royalty free 3d model wind sensor a b c for download as fbx on turbosquid: 3d models for games, architecture, videos. (1408406)
Using
3ddd
$1
US flag
...us flag
3ddd
флаг
us flag
3d_export
free
Among us
...among us
3dexport
among us red
3d_export
free
Among Us
...among us
3dexport
this 3d-model of a character from the game "among us". it can be used as a toy or decoration.
3d_export
$6
among us
...among us
3dexport
doll from among us in red
3d_export
$5
amoung us
...amoung us
3dexport
amoung us character. was created by cinema 4d 19
3d_export
$5
Humvee us
...humvee us
3dexport
humvee us 3d model good quality for animation
3d_export
$15
among us
...among us
3dexport
turbosmooth modifier can be used to increase mesh resolution if necessary
3d_export
$25
mailbox us
...mailbox us
3dexport
low poly model mailbox us. modeling in the blender, texturing in substance painter
design_connected
$13
Use Me
...use me
designconnected
sitland use me computer generated 3d model. designed by paolo scagnellato.
3d_export
$5
Among Us
...rt
the among us model comes in a variety of colors that can be customized by anyone, and even works with little in the animation