Touch dimmer

A touch of awesomeness!

Since my brother and his girlfriend recently bought a house, I wanted to present them a cool self-made gift. I heard them talk about buying touch dimmers at the hardware store to replace their old switches. As they were so expensive, poorly build and looking like bricks, I thought it would be cool to design my own touch dimmer and present this to them.

The touch dimmer is based on a PIC12F675 which drives a Triac. If you want to make your own touch dimmer then continue reading and discover how as I have shared the schematic and HEX file for the PIC.

Materials used
- PIC12F675
- TIC206D
- 2x 0.1uF 600V capacitors
- 1.8mH 2A coil
- Fuse holder + fuse 2A slow acting
- 2x 1N4148
- 100nF decoupling capacitor
- 5.6V 1,3W Zener diode
- 2x 3.3nF capacitors
- Resistors 3K3, 100, 1M5, 2x 2K, 68, 2M2, 2x 4M7
- 100uF 16V capacitor
- 3×1 wire terminal
- Etched pcb

Design
A neat feature of this touch dimmer is that there is no need for a neutral wire to be present in the wall back-box. It replaces the old switch without any modifications to the electrical wiring.
The AC resistance of C2 together with R3+R4 provide a current limitation in the form of a RC-network. Zener diode D3 rectifies the AC signal; the negative halves of the signal are limited to 5.6V which, through D2, charges the 100uF capacitor C6 up to approximately 5V. The incoming positive halves of the signal are shortened by D3 because in this direction it allows current to flow through it like a normal diode. This way there is no need for a bulky 5V power supply for the PIC microcontroller.
Another feature is the soft turn-on which prolongs the lifetime of the bulb. This means that at turn on it will take 0.5 seconds until the lamp reaches full brightness.

The PIC12F675 microcontroller has an onboard comparator that can be used for capacitive sensing. Capacitive sensing is realised by turning the on board comparator into a relaxation oscillator. The output of the comparator charges and discharges the sensing capacitor, which is formed by a small metal touch plate. The charge rate is determined by the RC time constant, created by an external resistor and the capacitance of the metal touch plate. When an additional capacitance is introduced from a person’s finger to ground, it causes a frequency change. This change is measured by the PIC microcontroller and used to detect a finger touch.

If the lamp is off, it can be switched on by briefly touching the touch sensor. The soft start will be activated and the lamp will turn on within half a second to its maximum brightness. If the touch sensor is held longer at start up, the lamp will not go to full brightness but start at minimum level and slowly increase brightness until the touch sensor is released.
When the lamp is on, a brief touch is needed to switch off the lamp. If the lamp is on and the touch sensor is held longer the dimmer sequence will start. The dimmer sequence is continuously varying from the minimum to maximum level as long as the touch sensor is activated and takes about six seconds.

Building
The pcb was designed to fit into a 71mm (OD) wall back-box. It measures 52mm by 52mm and fits exactly inside the back-box. To make fabricating a little easier the pcb is shaped like an octagon. Personally I find it very important for a component layout to look nice and tidy while also keeping design rules in the back of my head. This is not always easy but I always intend to find a balance between the looks of a circuit board and the design of the tracks.
As there was not enough space on the top of the circuit board, the coil had to be fitted on the bottom. This was not a problem as the back-box is deep enough.

[nggallery id=20]

Downloads
Schematic: Eagle format or picture.
Hex file: touchdimmer

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>