The circuit involves the following four "functional blocks":
- Light level sensor (LDR)
- LED cut-off timer/counter
- Logical NOR gate for light sensor and timer inputs to control LED's
- PWM/Constant current source for powering LED's
The power supply for the circuit is from a 15Ahr battery recharged via a small solar cell/regulator. Therefore, a relatively constant voltage can be expected (at least constant enough for the purposes of this circuit) and a voltage regulator, which would involve consuming additional power, is not included.
Light level sensor (LDR)
The light sensing is performed using a light dependent resistor (LDR) which in bright light (room lights) has a resistance of ~1k and in the 'dark' (covered with a finger) of >10k. The LDR is used as part of a voltage divider formed with RV3 and R5 (the potentiometer RV3 controls the light level that will cause the LED's to be illuminated) which controls the base of NPN transistor Q1. As the light level falls, the resistance of the LDR increases and consequently the voltage at the base of Q1 increases. When the voltage at the base of Q1 is greater than ~0.65V, the transistor conducts and pin 12 of U1 is pulled to ground, enabling the CD4060 to begin timing/counting.
When the light level is high, transistor Q1 does not conduct and consequently pullup resistor R4 holds U1 pin 12 high, which disables the CD4060 from timing/counting.
LED cut-off timer/counter (CD4060)
The CD4060 is a 14-stage binary ripple counter (U1), which advances one count on the negative transition of each clock pulse. The clock pulse to the CD4060 can be from a simple RC network connected to the on-board oscillator stage (see the datasheet in the Bill of Materials Section). There is only a sub-set of the outputs from the binary ripple counter that are available on external pins of the IC package (1).
The first available output of the binary counter is at pin 7 (output 3) which has a frequency of the clock frequency (or oscillator frequency from the RC network) divided by sixteen (16). The frequency at each successive output is then half the preceeding output (and note output 10 is not available externally). This means that the range of possible output pulse frequencies is determined obviously by the input clock (oscillator) frequency and the limited number of outputs actually available at external pins.
In this case, the on-board oscillator is used with the external timing capacitor (C1) and resistor (R6 + RV1). The frequency of the oscillator is calculated using the formula:
where: (note the units)
- f = frequency (kHz) of CD4060 oscillator
- Rt = timing resistor (connected to pin 10) in k ohm
- Ct = timing capacitor (connected to pin 9) in uF
For the values given in the schematic, Ct is capacitor C1 which is nominally 33uF with a target Rt of 40.5 kohm (for the total of R6 and RV1) which gives a frequency of 0.3253Hz. The 'timing resistor' Rt is composed of the potentiometer RV1 (with R6 to provide a minimum resistance if the potentiometer is 'turned full off') to enable calibrating the frequency of the CD4060 oscillator to allow for variation in the actual capacitance value of C1.
Having established a nominal frequency of 0.3253Hz this means the first available output from the CD4060 (pin 7) will have a frequency of 0.3253/16 = 0.0203Hz or a period of 49 seconds. Subsequent outputs on the CD4060 have half the frequency (i.e. twice the period). Therefore, output 12 (pin 2) should have a period of seven (7) hours.
Logical NOR gate for light sensor and timer inputs to control LED's
The desired functionality is that the LED's are illuminated when night time occurs (as set by RV3) and then the LED's remain illuminated for seven hours (or other preset time via RV1). The timing function via the CD4060 is enabled/disabled by holding CD4060 pin 12 low/high respectively. The actual illumination of the LED's is controlled by enabling/disabling the 555 timer (U2) which forms the PWM of the LED constant current supply (U2 pin 4 held high/low respectively). The following table summarises the logical conditions required by these voltage states:
|LDR (light=HIGH ~9V, darkness=LOW ~0.4V)
||CD4060 output pin 2 (timer tripped=HIGH)
||555 timer pin 4 (enabled=HIGH)
|Note: LDR=High/Low also respectively Disables/Enables CD4060|
This equates to a logical NOR function (transistors Q2, Q3 and Q4 with associated resistors).
PWM/Constant current source for powering LED's
The circuit used for the constant current driver for the LED's was sourced from an article by Giorgos Lazaridis (3). This circuit is also used in the strip lighting project except in this situation, pulse width modulation (PWM) of the constant current supply was included to decrease overall power consumption of the LEDs, as battery power is used.
With reference to the details in (3) and the components labelled on the diagram in the Schematic Diagram section, when U2 is enabled (via output from the NOR gate explained above), voltage is applied to the gate of MOSFET Q5 and current flows through the LED's and the sense resistor (formed by the combination of R12 and RV2).
As the current increases through the LED's and the sense resistor, the voltage drop across the sense resistor also increases. When this voltage reaches ~0.7V transistor Q5 starts to conduct, pulling the MOSFET gate to ground, and hence turning off the MOSFET. Therefore, current through the LED chain is regulated by the value of sense resistor.
To calculate the value of the sense resistor use the following formula:
- Vbe = base-emitter voltage transistor Q5 (~0.7V)
- Iled = limiting current through LED (amps from datasheet)
The salvaged LED's used in the project were observed to be sufficiently bright with a current approximately 300mA. Therefore, the sense resistor value is 0.7/0.3 = 2.3 ohm. In the constructed circuit, the sense resistor is composed of the total resistance of R12 plus RV2 . The potentiometer RV2 allows varying the resistance and hence the current and therefore the brightness of the LED's.
A value of 1ohm was selected for R12 (which gives the minimum sense resistance even if the potentiometer is wound to zero resistance) which with RV2 at minimum resistance still gave a measured resistance of ~2.5ohm (due to manufacturing tolerance of RV2).
The value of R11 is selected to enable ~1mA of current to flow to the gate of the MOSFET
The 555 timer (U2) is connected in the astable configuration (4) with a duty cycle of ~50%. The design equation for the 555 astable timer is:
With the nominal values in the schematic diagram (R10 = 10k and C3=1uF) the frequency will be approximately 72Hz, and a duty cycle of ~50%. Therefore, when U2 is enabled, the LED's will be pulsed on/off ~72Hz (quicker than the eye can register, i.e. persistence of vision POV etc) consequently saving approximately half the current.