Night Light Controller

My Night Light Controller (NLC) basically turns one or more lamps on automatically when occupancy is detected by a 1-Wire PIR and my 1-Wire Twilight sensor thinks it is dark outside. It doesn't use the 1-Wire Network as such but, takes a direct 12v signal from the PIR and the twilight sensor. This means any other PIR sensor or twilight sensor could be used to drive them. This side of it is powered by a separate 12V power supply, which is not dependent on the mains power supply.

Typically a single low-power lamp in a ceiling cluster is driven by the NLC, using a separate security light power feed. The NLC also takes a power feed from a switch or another lighting controller (such as my Simple Light Controller) which basically enables the controlled light to be used as a normal light as well. The diagram below shows a typical application such as an ensuite bathroom. The NLC is used in rooms that require person activated lighting (hall, landing, ensuite bathroom, main bathroom, lounge, etc.) but, not in rooms that require darkness when occupied (e.g. bedrooms).

I wanted the NLC to use the minimum power possible when not active and the use of CMOS logic results in a power consumption that is very low. Maplin 12v reed relay 12V (SPST JH13P) has a coil resistance of 1050ohms, resulting in low power use when in operation.

Inputs

Timer Circuit

This kind of monostable multivibrator is called a one-shot. More specifically, it is a retriggerable one-shot, because the timing begins after the input drops to a low state, meaning that multiple input pulses within the delay period will maintain a continuous high output.

One application for a retriggerable one-shot is that of a single mechanical contact debouncer. As you can see from the above timing diagram, the output will remain high despite "bouncing" of the input signal from a mechanical switch. Of course, in a real-life switch debouncer circuit, you'd probably want to use a time delay of much shorter duration than 10 seconds, as you only need to "debounce" pulses that are in the millisecond range. http://ectinschools.org/page.php?ps=2&p=13

CMOS 4011

If you connect the two gates of a NAND gate together then you get an invertor or NOT gate. A NAND gate followed by a NOT gate gives you an AND gate. http://uk.geocities.com/ronj_1217/cm11.html http://uk.geocities.com/ronj_1217/mini.html http://www.doctronics.co.uk/4011.htm All input should be tied to ground of the supply rail if not used. For those that also form input to the module, I've taken them to ground via a 1M resistor.

Circuit Design

Can I disable relay operation when the 'switch' input is active?

The first two gates act as an AND gate and let the PIR pulses through when the twilight sensor output is high (i.e. it is dark). A high input signal switches on the transistor and causes the capacitor to discharge. During this period, the output signal is forced high by the right-most inverter. Timing begins as soon as the PIR pulses are passed through. The transistor switches off causing the capacitor to charge through the variable resistor. Once the capacitor has charged to about 50%, the inverter will trigger the input into the last AND (NAND + NOT = AND) gate back to low. If the 'switch' input is high, the invertor prior to the AND gate makes sure the output can't go high to switch on the relay.

The maximum length of the delay can be calculated by: Delay time (t) = 0.7 x C where C is the capacitance in mF. So, if C = 100uF, the maximum delay is 0.7 x 100 = 70s. If a longer delay time is needed then a larger capacitor can be used.

The outputs from the CMOS logic ICs can only sink very low currents so a BC337 transistor (Maplin part no. QB68Y) is used to drive the relay coil. http://bp3.blogger.com/_BQac7gcHPK0/RkhZpXbcFkI/AAAAAAAAAU0/eNNRjj-vbTc/s1600-h/12V+DC+Motor+Speed+Controller+by+4011.jpg

Relay

I used a Maplin 12v reed relay 12V (SPST JH13P) has a high coil resistance, resulting in low power use when in operation. This relay can switch 1A which is fine for LED bulbs. It has a diode across teh coil to stop any back EMF.

The output and 'switch' input both connect to the load via diodes, such that either of them can be used to power the load. The diodes introduce a voltage drop but the supply is likely to be a battery bank anyway which is higher than 12V and the LED bulbs used have a built in regulator:

http://www.ultraleds.co.uk/ultimate-mr11-acdc-warm-white-bulb-p-1765.html

In some circumstances a

Wiring

The wiring in each PIR is:

  1. (red) = +12v
  2. (black) = 0v
  3. (yellow) = twilight signal
  4. (blue) = PIR signal
  5. (green) = tamper1
  6. (white) = tamper2

Reference