how to use a photoresistor or light-dependent resistor (LDR)

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
rajbadri
Normal user
Posts: 56
Joined: 21 Dec 2015, 21:38
Location: India

how to use a photoresistor or light-dependent resistor (LDR)

#1 Post by rajbadri » 25 Dec 2015, 04:34

hi
is it possible to use a photoresistor or light-dependent resistor (LDR) in esp easy
[img]
ldr.jpg
ldr.jpg (1.67 KiB) Viewed 7693 times
[/img]

please guide

Thanks

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: how to use a photoresistor or light-dependent resistor (LDR)

#2 Post by costo » 25 Dec 2015, 11:44

rajbadri wrote: is it possible to use a photoresistor or light-dependent resistor (LDR) in esp easy
Yes it is possible to set up a circuit in which a Light Dependant Resistor is used, but it will not give you the resistance in ohms, it will give you a certain voltage on the 'Analog Input' which is more or less dependent by the quantity of light that is at your LDR.
You have to put a resistor in series with the LDR and measure the voltage over the LDR. The value of this resistor depends on the LDR-type and if you are using ESP or NodeMCU. A good value to start experiment with may be 100 kiloohms.

But if you only want to measure the quantity of light it is so much easyer to use a BH1750 Lux module.

jack2222
New user
Posts: 3
Joined: 02 Feb 2020, 09:49

Re: how to use a photoresistor or light-dependent resistor (LDR)

#3 Post by jack2222 » 03 May 2020, 09:21

Hello,
How can I do if I want to capture the signal from 2 (or 4) photoresistor, to compare the strenght between them ? (e.g. for a solar tracker)

Thanks for your kind support! :!:

TD-er
Core team member
Posts: 8846
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: how to use a photoresistor or light-dependent resistor (LDR)

#4 Post by TD-er » 03 May 2020, 10:49

You can use some external ADC chip which has several inputs.
We have support for several in ESPEasy.

User avatar
Ath
Normal user
Posts: 3643
Joined: 10 Jun 2018, 12:06
Location: NL

Re: how to use a photoresistor or light-dependent resistor (LDR)

#5 Post by Ath » 03 May 2020, 11:22

Many moons ago, I experimented with 'aiming for the light' too, and built me this, now disassembled, tiny rig:
IMG_20200503_103330a.jpg
IMG_20200503_103330a.jpg (84.42 KiB) Viewed 4922 times
IMG_20200503_103417a.jpg
IMG_20200503_103417a.jpg (61.34 KiB) Viewed 4922 times
IMG_20200503_103426a.jpg
IMG_20200503_103426a.jpg (60.66 KiB) Viewed 4922 times
IMG_20200503_103512a.jpg
IMG_20200503_103512a.jpg (83.85 KiB) Viewed 4922 times
(Dismantled it for easier storage)

It consists of 3 TSL2561 I2C light sensors (3 only as they can be configured for 3 different addresses), 2 mini stepper motors, a few pieces of cardboard and a couple of (empty) toilet paper rolls. And not to forget, some ducttape :lol:
You will need an ESPEasy release with 'test' in its name as the plugin for the TSL2561 is available in these builds only.

Never got the rules just right, but that was probably also somewhat accountable on the state of ESPEasy in those days (mid 2018 I think), and largely on my lack of knowledge of rules at that time. Eventually I lost interest, but as the hardware works fine, I might try my luck/skills again, somewhere in the near future :roll:
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest