Learning Electronics

Learning Electronics

Learn to build electronic circuits

Intelligent Presence Simulator

However effective a domestic alarm system may be, it’s invariably better if it never goes off, and the best way to ensure this is to make potential burglars think the premises are occupied. Indeed, unless you own old masters or objects of great value likely to attract ‘professional’ burglars, it has to be acknowledged that the majority of burglaries are committed by ‘petty’ thieves who are going to be looking more than anything else for simplicity and will prefer to break into homes whose occupants are away.

Rather than simply not going on holiday – which is also one solution to the problem (!) – we’re going to suggest building this intelligent presence simulator which ought to put potential burglars off, even if your home is subjected to close scrutiny. Like all its counterparts, the proposed circuit turns one or more lights on and off when the ambient light falls, but while many devices are content to generate fixed timings, this one works using randomly variable durations.

Circuit diagram:
Intelligent Presence Simulator Circuit Schematic
Intelligent Presence Simulator Circuit Diagram

So while other devices are very soon caught out simply by daily observation (often from a car) because of their too-perfect regularity, this one is much more credible due to the fact that its operating times are irregular. The circuit is very simple, as we have employed a microcontroller – a ‘little’ 12C508 from Microchip, which is more than adequate for such an application. It is mains powered and uses rudimentary voltage regulation by a zener diode.

A relay is used to control the light(s); though this is less elegant than a triac solution, it does avoid any interference from the mains reaching the microcontroller, for example, during thunderstorms. We mustn’t forget this project needs to work very reliably during our absence, whatever happens. The ambient light level is measured by a conventional LDR (light dependent resistor), and the lighting switching threshold is adjustable via P1 to suit the characteristics and positioning of the LDR.

Note that input GP4 of the PIC12C508 is not analogue, but its logic switching threshold is very suitable for this kind of use. The LED connected to GP1 indicates the circuit’s operating mode, selected by grounding or not of GP2 or GP3 via override switch S1. So there are three possible states: permanently off, permanently on, and automatic mode, which is the one normally used. Given the software programmed into the 12C508 (‘firmware’) and the need to generate very long delays so as to arrive at lighting times or an hour or more, it has been necessary to make the MCU operate at a vastly reduced clock frequency.

PCB Layout:
PCB Layout Of Intelligent Presence Simulator
PCB Layout Of Intelligent Presence Simulator

In that case, a crystal-controlled clock is no longer suitable, so the R-C network R5/C3 is used instead. For sure, such a clock source is less stable than a crystal, but then in an application like this, that may well be what we’re after as a degree of randomness is a design target instead of a disadvantage. Our suggested PCB shown here takes all the components for this project except of course for S1, S2, and the LDR, which will need to be positioned on the front panel of the case in order to sense the ambient light intensity.

The PCB has been designed for a Finder relay capable of switching 10 A, which ought to prove adequate for lighting your home, unless you live in a replica of the Palace of Versailles. The program to be loaded into the 12C508 is available for free download from the Elektor website as file number 080231-11.zip or from the author’s own website: www.tavernier-c.com. On completion of the solder work the circuit should work immediately and can be checked by switching to manual mode.

The relay should be released in the ‘off’ position and energized in the ‘on’ position. Then all that remains is to adjust the day/night threshold by adjusting potentiometer P1. To do this, you can either use a lot of patience, or else use a voltmeter – digital or analogue, but the latter will need to be electronic so as to be high impedance – connected between GP4 and ground. When the light level below which you want the lighting to be allowed to come on is reached, adjust P1 to read approximately 1.4 V on the voltmeter.

If this value cannot be achieved, owing to the characteristics of your LDR, reduce or increase R8 if necessary to achieve it (LDRs are known to have rather wide production tolerances). Equipped with this inexpensive accessory, your home of course hasn’t become an impregnable fortress, but at least it ought to appear less attractive to burglars than houses that are plunged into darkness for long periods of time, especially in the middle of summer. (www.tavernier-c.com)

R1 = 1k 500mW
R2 = 4k7
R3 = 560R
R4,R6 = 10k
R5 = 7k5
R 7 = LDR
R8 = 470k to 1 M
P1 = 470k potentiometer
C1 = 470µF 25V
C2 = 10µF 25V
C3 = 1nF5
C4 = 10nF
D1,D2 = 1N4004
D3 = diode zener 4V7 400 mW
LED1 = LED, red
D4 = 1N4148
T1 = BC547
IC1 = PIC12C508, programmed, see Downloads
RE1 = relay, 10A contact
S1 = 1-pole 3-way rotary switch
F1 = fuse 100 mA
TR1 = Mains transformer 2x9 V, 1.2 -3 VA
4 PCB terminal blocks, 5 mm lead pitch
5 solder pins


The PCB layout can be downloaded free from our website www.elektor.com; file # 080231-1.
The source code and .hex files for this project are available free on www.elektor.com; file # 080231-11.zip.