The basic requirement for the circuit is a timing function that powers-on a set of UV lamps for the user input desired period. Ancillary functions include accepting user input denoting the desired time period, providing user feedback as to the remaining time the UV lamps will be illuminated and safety aspects such as ensuring that the UV-lamps are powered down if the illumination compartment lid is removed. The maximum time period that the UV lamps will require illumination is less than 15 minutes (assuming 2 or 3 10W or similar UV lamps are used).
Such functionality is readily applicable to a combination of discrete components and specific function IC's (e.g., the ubiquitous 555 timer with 7-segment LED displays and driver chips such as CD4511 or similar). However, a microcontroller approach was taken, more as a learning opportunity at the outset, but which proved to provide a low chip count, low cost and extensible solution.
A wall-wart power supply was initially favoured rather than constructing a dedicated DC power supply dropping/converting from a AC wall socket. Surplus chargers from laptops are readily available which provide not only a safer option but also a much more economical option (generally zero cost for a surplus charger). However, since the UV light box was expected to draw relatively high current and require AC power for the UV lamps in any case, a AC to DC power supply built around a transformer was included as part of the power supply for the circuit.
A 230VAC to 12VAC (10A) transformer steps down the mains AC and feeds a full bridge rectifier (BR1) to produce 12V DC. The 12V DC is then converted and regulated to 5V for supply of the logic and microcontroller circuitry by a LM7805 linear voltage regulator (U1). Filter capacitors C2 and C3 are as per the datasheet recommendation for the LM7805.
Basic Microcontroller Connection
The minimal circuitry required to operate the typical PIC (PIC16F84A in this case) include 5V regulated supply, oscillator (generally external crystal oscillator), in-circuit serial programming connections and a method to connect to the various I/O ports.
The power supply is discussed previously (LM7805 regulator). The PIC datasheet discusses required type of crystal or ceramic resonator and necessary capacitance, however, a 33pF capacitance is readily available, falls within the middle of the recommended ranges, and in practice does not seem particularly critical.
Resistor R2 provides the necessary connection to 5V for the MCLR pin, and switch SW3 provides a reset function for the microcontroller. Connector J5 is for the in-circuit serial programmer (ICSP) which allows hex code (i.e., the firmware) to be loaded into the PIC flash memory.
The I/O provided via the microcontroller hardware/firmware include 2 x 7-segment LED displays for showing timing information (both setting desired time of UV lamp illumination and once running, time remaining), a piezo-buzzer to provide audio feedback that UV lamp exposure has completed, two switches (SW1 and SW2) for setting timing information and start/stop UV lamp operation and finally, controlling a relay (RL2) via transistor Q2 to energise the UV lamps when required.