Note : To design this circuit I used Proteus(ISIS 7 professional) Software tool.
I tested the same circuit in hardware also.
In this simple project, we are going switch ON a LED automatically during night time or when we moved into a dark room. To complete this project we need light dependent resistor (LDR), 10K potentiometer, LED, 150 ohms resistor, BC547 transistor or any general purpose transistor.
A LDR is a device which changes its resistance depend up on the light intensity. Whenever light falls on the LDR, electrons in valence band are excited and move to the conduction band. The movement of free electrons and holes causes the current flow in the LDR with decrease in resistance. This current may be in micro amperes and this is not sufficient to glow an LED. To amplify this low current we use a transistor BC547.
LDR has minimum resistance (~100 ohms) when light falls on it and it shows maximum resistance (~1Mohms) when no light falls on it.
In Fig 1.0 the LDR voltage or current is not sufficient to drive the transistor. Therefore we need to develop a voltage divider network as shown below. RV1 (variable) is used to set the threshold of the light intensity.
RV1 = square root (Rmin*Rmax) = 10Kohms.
Whenever the light falling on LDR1 reaches its threshold, LDR1 shows its minimum resistance (~100ohms) and the voltage drop across the LDR1 is less than VBE of the transistor (Q1). Therefore the transistor Q1 is in off state and at the output side no Ic current will flow through the LED. So, the LED is off.
When there is no light falls on the LDR1, then it shows its maximum resistance and the voltage drop across LDR1 is greater than VBE of the transistor Q1. Now the transistor enters into ON state and at the output side Ic current will flow through the LED. So, the LED is ON.
Calculation of Rc resistance:
Fig 1.1(collector resistance calculation)
When the transistor is on the Ic current will flow through LED. Here the LED is load which requires 10mA-20mA to glow brightly. Here I took load current as 10mA.
From the Fig 1.1,
1) Voltage source = 5V.
2) Led on voltage = 2V.
3) When transistor is full on, Vce(sat) = 0.4VTherefore R = V/I =
= 260 ohms.
Place a resistor in front of the base of the transistor.
When the RV1 is equal to zero, the Rb fixed resistor protects the transistor from excessive base current (which will destroy it).
To calculate this Rb resistor, check out the datasheet of BC547 transistor for max IB current.
Base-Emitter Saturation Voltage VBE(sat) = ( 700 mV)
IB=0.5mA , IC=10mA
VBE (sat) = (900 mV)
If we took load current as 10mA --> VBE = 0.7V.
It is not possible to get exact 1.4Kohms, so we can take 1.5Kohms.
Circuit diagram without voltmeters and ammeter