The system schematic is shown in Figure 3.
Figure 3: System schematic
(Click on image to enlarge)
Selecting the essential components
The mains voltage is transformed to 9VAC(RMS). Only one voltage rail (3.3V) is used in this system, so power conversion is easy and straightforward. The transformer secondary-side voltage is regulated to 3.3V using the MAX16910 LDO. This LDO was chosen because it has built-in short-circuit and thermal protection. Fuse F1 is a 500mA PTC Polyswitch®, used for additional protection.
The system microcontroller is the Microchip® PIC18LF4520 running at a 8MHz clock frequency. The microcontroller’s clock is the MAX7375, a very small (SC-70) silicon oscillator, chosen because it has an excellent temperature coefficient and very little jitter.
The RTC is the DS1340C from Maxim Integrated Products. This clock has a built-in oscillator so it consumes ultra-low power when the supply comes from a backup power source. The DS1340C is interfaced with an I²C bus. It also has a built-in trickle charger. Therefore, if a rechargeable battery or capacitor is used as the backup power source, it is always fully charged by the DS1340C.
The backup power source, BT1, is a 0.47mF memory-storing capacitor. In the event of a power loss, BT1 will feed power to the DS1340C RTC. When this RTC is supplied from a backup source, it consumes only 1µA (max) current. With the 0.47mF capacitor and with a 3.3V capacitor voltage, the RTC will keep timing information for approximately 36 hours. If the backup time needs to be longer than that, the memory-storing capacitor can be replaced with two series-connected AA batteries. This will lengthen the operating time from 36 hours up to several months. Note, however, that now the DS1340C’s built-in trickle charger needs to be disabled by writing 0x00h to the DS1340C’s register 08h.
The user interface is ultra simple: one pushbutton and two 7-segment LED displays. Displays are driven by the MAX6958 LED display driver and interfaced with I²C, as are the ALS and RTC.
The ALS (Figure 4) is not mounted on the controller’s PCB, but inside the luminaire chassis. The sensor is connected to the PCB with a 4-wire cable using connector J1. This ALS is the MAX44009, chosen because it comes in an ultra-small (2mm x 2mm), 6-pin UTDFN package that fits easily inside the luminaire chassis (Figure 5).
Figure 4: Schematic for the MAX44009 ALS
Figure 5: Ambient light sensor PCB (picture on the left) is mounted inside the luminaire chassis (small black dot visible at the bottom of the chassis). Luminaire photo courtesy of Marko Kannisto.