Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Photocells a.k.a CdS cells, photoresistors, LDR (light dependent resistor)…

Cds Lrg
Ldr
Cdsconstruction
Here’s another MASSIVE tutorial… Photocells a.k.a CdS cells, photoresistors, LDR (light dependent resistor)

What is a photocell?
Photocells are sensors that allow you to detect light. They are small, inexpensive, low-power, easy to use and don’t wear out. For that reason they often appear in toys, gadgets and appliances. Theys are are often refered to a CdS cells (they are made of Cadmium-Sulfide), light-dependent resistors (LDR), and photoresistors.

Photocells are basically a resistor that changes its resistive value (in ohms Ω) depending on how much. They are very low cost, easy to get in many sizes and specifications, but are very innacurate. Each photocell sensor will act a little differently than the other, even if they are from the same batch. The variations can be really large, 50% or higher! For this reason, they shouldn’t be used to try to determine precise light levels in lux or millicandela. Instead, you can expect to only be able to determine basic light changes.

For most light-sentsitive applications like “is it light or dark out”, “is there something in front of the sensor (that would block light)”, “is there something interrupting a laser beam” (break-beam sensors), or “which of multiple sensors has the most light hitting it”, photocells can be a good choice!

Some basic stats
These stats are for the photocell in the Adafruit shop which is very much like the PDV-P8001. Nearly all photocells will have slightly different specifications, although they all pretty much work the same. If there’s a datasheet, you’ll want to refer to it

  • Size: Round, 5mm (0.2″) diameter. (Other photocells can get up to 11mm/0.4″ diameter!)
  • Price: $1.50 at the Adafruit shop
  • Resistance range: 200KΩ (dark) to 10KΩ (10 lux brightness)
  • Sensitivity range: CdS cells respond to light between 400nm (violet) and 600nm (orange) wavelengths, peaking at about 520nm (green).
  • Power supply: pretty much anything up to 100V, uses less than 1mA of current on average (depends on power supply voltage)
  • Datasheet and another Datasheet
  • Two application notes on using and selecting photocells where nearly all of these graphs are taken from

How to measure light using a photocell
As we’ve said, a photocell’s resistance changes as the face is exposed to more light. When its dark, the sensor looks like an large resistor up to 10MΩ, as the light level increases, the resistance goes down. This graph indicates approximately the resistance of the sensor at different light levels. Remember each photocell will be a little different so use this as a guide only!

Graph

Read more of the tutorial here… Photocells a.k.a CdS cells, photoresistors, LDR (light dependent resistor) and pick up some photoresistors at the Adafruit store!


We are angry, frustrated, and in pain because of the violence and murder of Black people by the police because of racism. We are in the fight AGAINST RACISM. George Floyd was murdered, his life stolen. The Adafruit teams have specific actions we’ve done, are doing, and will do together as a company and culture. We are asking the Adafruit community to get involved and share what you are doing. The Adafruit teams will not settle for a hash tag, a Tweet, or an icon change. We will work on real change, and that requires real action and real work together. That is what we will do each day, each month, each year – we will hold ourselves accountable and publish our collective efforts, partnerships, activism, donations, openly and publicly. Our blog and social media platforms will be utilized in actionable ways. Join us and the anti-racist efforts working to end police brutality, reform the criminal justice system, and dismantle the many other forms of systemic racism at work in this country, read more @ adafruit.com/blacklivesmatter

Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.

Join 20,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7pm ET! To join, head over to YouTube and check out the show’s live chat – we’ll post the link there.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Follow Adafruit on Instagram for top secret new products, behinds the scenes and more https://www.instagram.com/adafruit/

CircuitPython – The easiest way to program microcontrollers – CircuitPython.org


Maker Business — To make it through a tough business cycle, layoffs should be a last resort

Wearables — Look beyond buttons

Electronics — The Glitchy Switch

Python for Microcontrollers — Python on Microcontrollers: CircuitPython on Wio Terminal, 6.0.0 Alpha 1 and more! #Python #Adafruit #CircuitPython @circuitpython @micropython @ThePSF

Adafruit IoT Monthly — Repurposed Smart Home Displays, Open-Source 5G Networks, and more!

Microsoft MakeCode — Black Girls Code Virtual Camps

EYE on NPI — Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — New Products 7/1/20 featuring Adafruit H3LIS331 Ultra High Range Triple-Axis Accelerometer – STEMMA QT / Qwiic!

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !



7 Comments

  1. AnonymousEditor

    “its resistive value (in ohms Ω) depending on how much.”
    should maybe read
    “its resistive value (in ohms Ω) depending on how much light is shining on it.”

  2. Sadly I think CdS photocells are soon to be extinct thanks to RoHS. (Many people including myself now make it a point to properly recycle electronics, in order to keep lead and other nasties out of the landfill. Will people do the same once the RoHS directive makes it perfectly safe to toss them all into the trash?)

  3. In the sample sketch, I think you can omit this line:

    photocellReading = 1023 – photocellReading;

    if you rewrite the map line as:

    LEDbrightness = map(photocellReading, 1023, 0, 0, 255);

    That is, map() works with decreasing ranges as well as increasing ones.

    (From http://www.arduino.cc/en/Reference/Map:

    “Note that the “lower bounds” of either range may be larger or smaller than the “upper bounds” so the map() function may be used to reverse a range of numbers, for example

    y = map(x, 1, 50, 50, 1);”)

  4. @joshua they’re rohs exempt

    @finsprings i didnt find map worked but sure, whichever way

  5. Have an autocalibrate routine for LDRs and FSRs. It records maximum and minimum intensity and then gives the full 0-255 PWM output over the input range.

    http://duinolab.blogspot.com/2009/05/autocalibrate-and-analog-sensors.html

  6. I clicked on the datasheet links and got the following errors:

    Not Found
    The requested URL /media/sensors/PDV-P8001.pdf was not found on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    ________________________________________
    Apache/1.3.41 Server at http://www.adafruit.com Port 80

    I’m using FireFox 3.0.10.

    Not Found
    The requested URL /media/sensors/DTS_A9950_A7060_B9060.pdf was not found on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    ________________________________________
    Apache/1.3.41 Server at http://www.adafruit.com Port 80

  7. Just wanted to add that the difference between the links to the datasheets in this blog vs. the links on http://www.ladyada.net/learn/sensors/cds.html page, is the domain name.

Sorry, the comment form is closed at this time.