You are on page 1of 4

Night Light

Saver V3.2 (PIC12C508)
Wichit Sirichote,

A Microchip PIC12C508 8-pin CMOS Microcontroller turns a night light on and off
with preset time everyday. Save Energy, No EMI, No Battery, Built-in Lamp Fixture,
and Peak Shaving

It's time for 8-pin microcontroller Microchip PIC12C508, the SAVER V3.2, my latest
design of a device that turns a night light on and off everyday. The circuit uses only a
PIC12C508 8-pin CMOS micontroller and a small triac, MAC97A6. The Saver V3.2 also
demonstrates the use PCW PIC C Compiler.

Circuit Description
The schematic of the SAVER V3.2 is depicted in Figure 1.A transformerless power supply
uses Xc of a 0.22uF capacitor to limit current providing about 10mA current source. The
diodes rectifies ac current to dc current which in turns charged to filtering capacitor,
100uF. A 5.1V zener diode provides dc supply ~5V to the PIC12C508. The
microcontroller circuit runs with low power 32kHz X-tal. GP2 connects a momentary
button for setting time to 8:00. GP1 drives small dot LED that blink every 5 s for normal
running. GP0 directly drives with source current to a small triac MAC97A6.

hex is HEX file suitable for writing the code to the PIC12C508 chip. This file sets time to 8:00 when press S1 once. Time on and off is set to 19:00 to 22:00 everyday. The original source program SAVER. Figure 2 shows the author's concept for building-in a 25W lamp fixture.2 Software Saver.Caution!! High Voltage!! Do not touch any conductive parts of the circuit Figure 1: Schematic of the Saver V3. User may change set time when press S1 and change time on/off. To recompile the source file you need a PCW PIC C Compiler from CCS.H was written in 'C' language. Installation The Saver may be built-in any kind of lamp fixtures.C and SAVER. .

Let try press S1 once. The author suggests to correct AC line connection to L and N of the circuit. power failed should happen. I have been tested with one from National. no problem. So one can modify by putting backup circuit with additional one or two signal diodes. I have installed one at my home and have to repress S1 three times during three months. someone may turn main switch off. 1N914. the lamp will turn on 1 minute only once. Note that every time you press S1. just wait again 8:00 then press S1. The sun will set more early in winter while later in summer. If the LED is not blinked. The Saver assumes the current time is then be 8:00. Very easy. it works!! But I am not guarantee for your energy saving lamp. functioning LED will blink every 1 second. Backing Up with Supercapacitor or Battery My first design as seen in SAVER V5. After finished installation.0 does not provide backup supply if line voltage has failed.1F may provide backup time a couple of hour while battery may provide up to a year. The day after the lamp will then turn on and off at preset time. I shall be grateful if you could test and let me know the result. They mostly use internal high frequency inverter. turn it back on again and wait for 8:00. say. since the chip was programmed time on/off at 19:00/22:00 everyday. Functioning LED will blink at low rate indicating normal operation. If high blink rate is noticed when return home. turn the main switch on. say. The Saver 5 draws much current while PIC12C508 draws as less as 36uA. A supercapacitor 0. the lamp will turn on 1 minute then off. under preparation Figure 2: The author's concept night light fixture with built-in Saver circuit Although the Saver can operate even wrong connection of L and N to the circuit. Changing time on for different seasons Night time for different seasons is of course different in winter or summer. Energy Saving Lamp The Saver was not designed for turning such energy saving lamps on and off. One may ask how can we change time on. GP0 needs external PNP transistor and drives a triac with sink current instead to prevent discharging from backup supply. just .

press S1 to set 8:00 early or later than our clock.C was wriiten by W. Press S1 at our clock Time on Time off Season 8:00 19:00 22:00 preset 7:30 18:30 21:30 winter 8:15 19:15 21:15 summer Night Light Saver V3. Example is shown below.Sirichote Saver.2 was designed by W.Sirichote .