Various CdS Photocells

Using a CdS Photoresistor

by Lewis Loflin

A cadmium-sulfide (CdS) photo resistor (or photo cell) is a device that changes resistance depending on light intensity. It's sensitive, fast, and has been around for decades. It's often used in street lights and as an "electric eye." Note the resistance decreases from millions of ohms in darkness to as little as a few hundred ohms in bright light. A simple test is use an ohm meter and watch the resistance vary with light intensity.

In the above circuit (Fig. A) R1 is a CdS photocell in series with a 1000-ohm resistor. The 5 volts form Vcc divides across R1 and R2 in proportion to their resistance. For example, if R1 = R2, one would read 2.5 volts across each component. Using a DC voltmeter (black lead on ground, red lead at V) one will read 2.5 volts. (Or whatever value depending on the particular CdS cell and light intensity.) Connecting the voltmeter across the CdS cell (black lead to V and red at Vcc) one will read 2.5 volts. If the meter leads are reversed, say red to ground and black to V, the voltage reading will be negative 2.5 volts with a digital meter.

Note: the voltage across R1 plus the voltage across R2 when added together will equal Vcc. This is a property of series circuits where each component have the same current flow through them, but voltage divides based on resistance.

As we increase the light intensity to R1 the voltage across R2 will increase while the voltage across R1 decreases. This is because the resistance of R1 decreases with light intensity while the resistance of R2 is fixed. Voltage divides based on resistance where the higher resistance gets more of the voltage drop. As in the previous case, the voltage across R1 plus the voltage across R2 will still add back to Vcc. In figure B above we have the opposite voltage reading because the parts are reversed. The voltage from ground to V will decrease as light intensity increases.

The output at V can be used with an analog to digital converter of a microcomputer to measure light intensity. Let's look at more another application.

Quick navigation:


Using a Comparator with a CdS

Pictured above is the LM339 quad comparator operating a relay. When the voltage at the "-" input (pin 5) exceeds the voltage at the "+" input (pin 6) the output (internal) open-collector transistor at pin 2 switches on to ground, activating the relay K1. (D4 is used to protect the LM339 from voltage spikes generated by K1 when deactivated.

As light intensity increases the resistance of R5 decreases the voltage will rise across R7 until the voltage at TP2 exceeds the voltage set by R4, activating the relay. If we use R6 and R8, the relay when activate as it gets dark. For more on comparators click here. For the same circuit as above using a uA741 OP-AMP click here.

The above opto-coupler can be used to replace K1. Delete Q1 and connect pin 2 to pin 2 of the LM339. Change Rin to 680 ohms for 12 volts.

Top of Page



Basic Relay Operation

In Fig. 3 above the CdS cell is used in series with a 120 VAC relay. During the day the resistance of the CdS cell is low activating the relay and breaking the connection to the lamp. At night increased resistance deactivates the relay. The diagram shows the state of the circuit at night.

In Fig. 4 as the resistance of the CdS drops current is supplied to the gate of the triac turning on the lamp. See my triacs page.

Top of Page



Thermistors I purchased off Ebay

Thermistor

A thermistor is a type of resistor with resistance varying according to its temperature. The word is a combination of thermal and resistor. Samuel Ruben invented the thermistor in 1930. This differs from a mechanical thermostat that uses metals expansion/contraction to break a contact. If the resistance increases, we say it has a positive coefficient. If decreases, a negative coefficient. They are not used alone, but with other electronics. Thermistors can be used in the same circuits as CdS cells. A thermistor is not to be confused with a thermocouple or thermostat.


Thermistor symbol

A thermistor circuit.

Top of Page


[ My Homepage ] [ Electronics Mainpage ]

Added February 2009: Using a CdS Photo resistor. How to use photocells and touches on comparators, thermistors, relays, etc. Includes circuits to build and test.


Arduino demos April 30, 2009:
Using the ATMEGA168/Arduino with a 24LC08 Serial EEPROM
Using the ATMEGA168/Arduino with a DS1307 Real Time Clock
More to come. this will include using the MCP23016 I2C I/O Expander and several simple demo projects for robotics and power control.

Atmega168/Arduino features:
14k flash program storage
1k RAM for program memory
6 PWM outputs
6 A/D inputs
UART and SPI interfaces
2 Hardware interrupts
20 general purpose I/O pins (shared with PWM and Analog pins)
16 MHz RISC microcontroller
Open-source hardware, IDE, bootloader
Easy upgrade to more powerful hardware (Wiring)
Easy to use and learn.

Visitors since
March 2002