Mini Photocell

This is a very small light sensor. A photocell changes (also called a photodetector, photo resistor, CdS or photoconductive cell) resistance depending on the amount of light it is exposed to. These little sensors make great ambient light triggers (when light in the room turns on, do something).

  • Light resistance : ~1k Ohm
  • Dark resistance : ~10k Ohm
  • Max voltage : 150V
  • Max power: 100mW* 2 x 4 x 5mm
  • 4mm between pins
  • 31mm lead length

Mini Photocell Product Help and Resources

SparkPunk Hookup Guide

June 12, 2014

How to assemble and modify the SparkPunk Sound Generator kit.

Photon Remote Water Level Sensor

June 2, 2016

Learn how to build a remote water level sensor for a water storage tank and how to automate a pump based off the readings!

Photocell Hookup Guide

May 5, 2016

Hook a light-sensing photocell up to an Arduino to create an ambient light monitor.

Blynk Board Project Guide

March 25, 2016

A series of Blynk projects you can set up on the Blynk Board without ever re-programming it.

Experiment Guide for the Johnny-Five Inventor's Kit

June 28, 2016

Use the Tessel 2 and the Johnny Five Inventors kit to explore the world of JavaScript enabled hardware through 14 awesome experiments!

SparkFun Inventor's Kit Experiment Guide - v4.0

November 15, 2017

The SparkFun Inventor's Kit (SIK) Experiment Guide contains all of the information needed to build all five projects, encompassing 16 circuits, in the latest version of the kit, v4.0a.

Light-Seeking Robot

November 28, 2017

We use parts from the SparkFun Inventor's Kit v4.0 to create a light-seeking robot that mimics the behavior of single-celled organisms.

SparkFun Inventor's Kit Experiment Guide - v4.1

August 8, 2019

The SparkFun Inventor's Kit (SIK) Experiment Guide contains all of the information needed to build all five projects, encompassing 16 circuits, in the latest version of the kit, v4.1.2 and v4.1.

Beginner Parts Kit Identification Guide

March 22, 2019

The essential parts for beginning (or even experienced) hobbyists that gives you all of the basic through-hole components you will need to get started playing with embedded projects. We'll identify a few parts in the kit and provide a few basic circuits to get started!

Python Programming Tutorial: Getting Started with the Raspberry Pi

June 27, 2018

This guide will show you how to write programs on your Raspberry Pi using Python to control hardware.

Core Skill: Electrical Prototyping

If it requires power, you need to know how much, what all the pins do, and how to hook it up. You may need to reference datasheets, schematics, and know the ins and outs of electronics.

1 Electrical Prototyping

Skill Level: Noob - You don't need to reference a datasheet, but you will need to know basic power requirements.
See all skill levels


Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • Member #1254346 / about 5 years ago / 1


    Is it possible to increase R2 to save power. I need to consume a few micro amps. Do you think it is possible ?



  • Member #809976 / about 8 years ago / 1

    How many Mini Photocell I'll get for 1.50$ ???

  • Here's a tutorial on using this sensor with the Arduino.

  • jenesaisdiq / about 14 years ago / 3

    Remember that the response time on these is very long, somewhere in the 50-100ms range, so it's difficult to use them for transient events (like, say, laser triplines).

    • joe57005 / about 10 years ago / 2

      I've used one in my youth to make a light based sound transmitter using only an LED conncted to a radio's headphone jack and a CDs cell connected to an earphone and battery. it worked just fine.

    • Mark Fickett / about 10 years ago * / 1

      I think the response is shorter (< 10ms). I drove a laser with tone() and pointed it at a photoresistor*, and (via ascii-art graph from analogRead()) can clearly see a 200Hz signal, implying < 2.5ms until a detectable response. Note however that at 32Hz the rise and falloff are much more visible; clearly at 200Hz the photoresistor (or some part of the system) doesn't fully stabilize. However at 32Hz, that's still ~15ms response time.

      *I actually got impatient and picked up RadioShack's bagged assortment of 5, and am testing with one of the larger ones. I assume SparkFun's are similar.

    • EvanAlmighty / about 10 years ago / 1

      It depends on what the trip wire is connected to. If all you want is a siren to go off a 100ms delay isn't bad given the simplicity of a photocell; If you're making a trap door or some other time sensitive device then yeah every millisecond counts!

    • Noobulus / about 13 years ago / 1

      I'm not so sure- I'm using these for a laser tag project, and they work excellently for transient lasers.

  • Tinkerish / about 15 years ago / 3

    I use these on several projects and they are lots of fun. Of course, just started selling them so I couldn't get them here yet. I'm glad to see them available.
    I first used them for an automatic blinds project to detect when morning comes. I've also used them to detect lines on a line following robot. I know that the combo IR emitter detectors work better but at this price it is worth paying for just to see if it will work for your purposes. I was able to simply connect this with a 10k resistor as a resistor divider to an ADC pin. I then was able to reliably use it to detect a 1/2" solid black line pretty reliably.

    • Hey Tinkerish, I was checking out your blog and would love to see the documentation for that blinds project if you get a chance.

  • Member #252515 / about 11 years ago / 2

    Hi! I was going to measure my mechanical camera's shutter speed with this and a laser and a 555 timer. I was wondering how practical that is. The response time and the decay time are within 10 ms of each other (not sure how accurate and how repeatable that is) according to a random web datasheet for the GL5528. If I subtract 10 ms from all my results, I should be fine, I guess?

    • Member #550756 / about 10 years ago / 1

      You might just want to do the standard thing for removing scientific error... Do it fifty times and average! Or do it like ten times and you'll be good.

  • saccade / about 15 years ago / 2

    I used a bunch of these (20K ohm, I think) to measure boxes; see

  • Boblehai / about 10 years ago / 1

    Hi. I use this sensor to determine if the lights are on or off in a small storage. If the values get below a certain point, it means the lights are off. And vice versa. When lights are turned on/off during the night, a mail is sent. Sometimes the value from the sensors drops even thou the lights are the same. Triggering a mail alert. This happens about every minute or so. Typically when the lights are on, the value should be 110-115. Dark is below 15. I started to log the values, and I get this: 114-113-115-9-114-113..... Why is the value dropping every now and then?

  • Hi. I was wanting to make an IR LED light source that will turn on at night when it gets dark and turn off during the day when its light. Would that be possible with just this sensor? Or would I need a microcontroller or something similar to program it as well? Thanks.

  • SQLDiablo / about 10 years ago / 1

    Hi guys, quick question. In picture 3 for this component, there's a wiring diagram that shows R2 with a value of 10K. I used this on a circuit where VCC was 5V and it worked great. Now I want to use it in a 3.3V circuit. Do I need to change the value of R2, or can it stay at 10K? If it needs to change, is there a formula I can use to calculate what that value should be?

  • Member #525120 / about 10 years ago / 1

    I made a little calculator that works out the minimum and maximum voltage range for an LDR plus resistor voltage divider circuit. Useful in case you don't have the exact value calculated by squareroot(Rmin * Rmax). You can just fill in the various values of resistors you have.

    You can find the calculator here:

    I suppose it would work for any kind of variable resistor used as a sensor.

  • Member #503125 / about 10 years ago / 1

    What would be the lightest microcontroller to control this? I want some night time light activation. Need super light weight.

    • Brian T. / about 10 years ago / 1

      If you're willing to go AVR, attiny85 might fit your bill. I remember it having an ADC/ADMUX, but always check the datasheet.

  • Member #494048 / about 11 years ago / 1

    Are they polarity sensitive?

  • Member #377364 / about 12 years ago / 1

    I just used one to automatically adjust the backlight on an LCD module connected to an Arduino. Made a voltage divider, connected the center to an analog input, scaled the value based on empirical observations, and used a PWM output pin connected to the LCD backlight. Cheap, easy, works like a charm. When ambient light is bright, the backlight is full-on, and in the dark, the backlight is (almost) full-off.

  • Member #1736 / about 12 years ago / 1

    FYI: The resistance values posted above do not reflect the values of the device I received. On my photocell Light ~ 9.76K Ohms and Dark ~ 64.2K Ohms. Other than that it works like a champ.

  • mathwizard44 / about 12 years ago / 1

    Is this the same photocell used in the Terror-Min?

  • Member #343403 / about 12 years ago / 1

    Hi! Is it possible to "invert" the sensor: as in when there is little light, something turns on, and while there is light, nothing happens. I want to use the sensor to turn on LEDs when it starts to get dark outside.

    • You could implement that easily in the code for your microcontroller. The light sensor itself can't be 'inverted', but you could simply code it so as the amount of light sensed decreases, the number of LEDs turned on increases.

      • Member #343403 / about 12 years ago / 1

        Thanks for the reply Toni. As I want to utilize the photocell in a garment, can the photocell be washed? And will the photocell's detection of light/lack of light be affected by being covered in a transparent or bright material? As I am a newbeginner, the specifications in the datasheet do not lead my to any conclusion on those matters. Thanks.

        • If you are looking to use this in a garment, I would recommend you check out the Lilypad Light Sensor. These boards are designed specifically for e-textile applications. Covering the sensor will affect the detection of light, though if you are using a transparent material, it shouldn't affect it too strongly.

  • war_spigot / about 12 years ago * / 1

    For anyone wondering how low these can go, I put one right on the light in my desk(it's super bright) and it went down to ~120 ohms

    Also, I put one in my mouth(only place I could think of where I'm positive there no light being produced, I hope these are RoHS compliant) and it got up to ~1.7 MOhms

    • PalmTreesandPICs / about 12 years ago / 1

      For your next test, use a better testing area like... where the sun.. err... does not shine?..... I bet theres not light there either.

      Only then we will know how low you can go.... (Pun? ... yeah, 100%)

      (sorry... it was to easy to let it go)

  • Klone38 / about 13 years ago / 1

    Works perfectly for black on white line sensing. on the one i got the light resistance was about 1K and the dark was about 40K. i had a idea for these awhile back, if you take three of these and cover them in color filters so one only senses either red, blue, or green, you could make a real cheap analog color sensor. What does everyone think of this idea?

    • It sounds pretty darn cool, mon! Do it! Worth the money even if it doesn't work, 'cause you'll learn something either way. It wouldn't be very accurate, but you could write some code that would print "Red" or "Yellow" to a serial monitor.

    • I just had a brilliant idea that would let me dump all the AVRs and stuff out of my line-following robot!!
      So I would have two motors for moving, right? Then I could use 2 power transistors such as TIP20s with a pair of these, and when the bot veered right enough that the left CdS detected black, the transistor would limit the current to the left motor and the bot would turn left back onto the line!
      Whaddaya think?

      • I really wanna know if this would work! Thanks!

        • MikeGrusin / about 13 years ago / 1

          If you look at the datasheet, the peak sensitivity is in the green region (540nm), so I don't think these are well suited for RGB. However you can actually get colored LEDs to respond to light input, that might be worth a shot.

          • I meant, would my idea work. Thanks for tossing out an answer though, because other people probably want to know.

            • MikeGrusin / about 13 years ago / 1

              Since you were responding to Klone38's RGB idea, that's what I was responding to as well. But in response to your idea, sure, people were making robots long before computers with these kind of sensor-feedback systems. You might need to throw an op-amp or two in there to tune the photocell response to what your transistors want to see, but yes it can be done. Google Mark Tilden for lots of clever ideas.

              • Thanks! Awesome!

                • Member #313592 / about 12 years ago / 1

                  I did that as a high school project a while back and it did work but was a a bit sluggish when the difference in light levels were comparable. I didn't use any op-amps and it seemed to work fine but in retrospect they seem to a good idea.

    • Lasers pew pew / about 13 years ago / 1

      These things aren't too good at detecting blue light, but its worth a shot.

  • teeemags / about 14 years ago / 1

    Anyone know the solderability of this component?

  • dmcp / about 14 years ago / 1

    Could someone please comment on the time delay? How repeatable//stable/linear is the resistance?

Customer Reviews

4.9 out of 5

Based on 7 ratings:

Currently viewing all customer reviews.

1 of 1 found this helpful:

Works Great

Works as expected, no problems.

3 of 3 found this helpful:

Works well

Used with a 10K fixed resistor in a voltage divider and it provides a very good dynamic range through a normal room lighting range.

1 of 1 found this helpful:

Excellent little photocell!

Using it with an arduino uno for measuring ambient light level. Works great.

1 of 1 found this helpful:

Who Turned out the light?

I have used many of these because I often want to adjust what happens when the lights are on vs. off. I have checked several and they seem to be fairly consistant.

1 of 1 found this helpful:


Cheap way to make light activated things...ok, sounded quite dumb, but that's it, polarity doesn't matter.

Nice Product

I used this product on my object avoiding robot car to keep it from running under couches and getting stuck or other low ledges that would knock off components. Worked great!