Smart lighting control technology is being used in more and more consumer applications. Restaurants, bars, offices, movie theaters, homes, airplanes, and automobiles are just a few examples of where sophisticated lighting control mechanisms help enhance the overall ambience and user experience. Gone are the days of bulky light control boards with hundreds of buttons. Today’s smarter lighting systems allow control of light intensity, hue, and saturation with the touch of just a button.
In a basic lighting control application (see figure 1), a user interface allows for the selection of predefined lighting options or direct control of light properties. Some systems also have an ambient light sensor which allows automatic control of indoor lights depending on the current environmental light. Based on the user/ambient sensor’s input, the controller transfers the control data to the light controller monitoring the characteristics of LED/Lamps.
The focus of this article is the design of an efficient user interface for a light control application. With the number of competing light control systems on the market, the user interface is often the major difference between systems and determines the success or failure of a consumer product.
The idea is to elevate user controls from bulky designs with a bunch of selection keys and area-occupying potentiometers to sleeker designs with smart capacitive touch sensitive button/slider controls. Using capacitive sensor-enabled interfaces not only provides an attractive front panel but also makes the system more robust, jitter-free, and cost-effective. Moreover, the ability of capacitive sensors to detect objects at programmed proximities introduces a completely new dimension to the interface. Key topics to be covered in this article include, capacitive sensing techniques, user interfaces, radial sliders, backlight LEDs, and proximity sensing.
Every copper trace on the PCB has some finite parasitic capacitance associated with it. Using this property, capacitive sensors are implemented on PCBs in the form of copper pads. There is a layer of insulating overlay covering the sensing pads that protects each sensor from ESD and users from electric shock. When the user touches the overlay over a sensor, the capacitance of the sensor changes. This is because of the capacitance introduced by the finger coming in parallel with the sensor’s capacitance. The technique used to measure or detect this change in sensor capacitance is referred as capacitive sensing. Figure 2 shows a simple implementation of detecting change in sensor capacitance (see figure 2).
This circuit primarily relies on emulating a resistor using switched capacitor technology. As per equation 1, the value of the emulated resistor is:
According to equation 1, an increase in sensor capacitance reduces the emulated resistor’s value. This change in the resistor value varies the current in the sensor. This current is amplified and converted to a voltage signal for further processing. A fast ADC, typically a SAR ADC, can be used to digitize the voltage signal. By keeping track of the digital data associated with this voltage signal in the firmware, we can detect a change in capacitance introduced by finger capacitance.
Figure 2 shows an SOC implementation of a capacitive sensor. Although designs based on SOCs are simple to implement, there are various factors which need consideration when it comes to capacitive touch sensing, including:
- Wide range of capacitance – This can be achieved by using a high-resolution ADC or a precise TIA. Use of high-precision analog components, however, increases system cost.
- Environmental noise – Since the change in capacitance introduced by the finger is very small (typically, < 0.5pf), even low noise present in the environment can introduce parasitic capacitance that leads to false finger detects.
- Change in environment – Capacitance is a function of humidity and temperature. Thus, the circuitry and the firmware should be designed to handle their effects on the end application.
Figure 3 shows an implementation of high-performance capacitive sensors using the capacitive sensing Sigma Delta (CSD) method using the Cypress CY8C21x34 PSoC. Since, the controller’s design is based on a SoC, it can be configured according to the specific requirements of the application. The integrated CSD module can also be used for implementing proximity sensors or gang sensors.
This implementation is similar to the block diagram shown in Figure 2. Additional blocks and components used in this implementation help in addressing the problems listed above.
In this methodology, the modulator capacitor, CMOD will charge through the emulated resistor. When the integrated capacitor voltage crosses the reference potential (VREF), the comparator output switches to HIGH which connects the RB (bleed resistor) to ground. This provides a discharge path to CMOD. When the capacitor voltage goes below VREF, the comparator output switches back to LOW and disconnects the RB switch. This action repeats continuously, and the output of the comparator gives a stream of pulses which enables the counter.
A change in the sensor capacitance will vary the current used to charge CMOD. Because of CMOD’s variable charging rate (REQ*CMOD) and fixed discharging rate (RB*CMOD), the duty cycle of the pulse stream at the comparator output will vary. This change in the duty cycle of the pulse stream can be detected by reading the counter.
A typical user interface for a room lighting control application provides an option to select one of the predefined lighting levels. Some advanced user interfaces allow the user to control individual color components and light intensity. Figure 4 shows one such user interface.
The interface shown in figure 4 has four capacitive buttons which are used to select a particular component of the light. The selected property, such as intensity (if the intensity button is touched) or saturation (if any of the primary color buttons is touched) can be increased or decreased using the radial slider. Apart from this functionality of radial slider, the radial sensor is also used to navigate through predefined lighting levels. The slider’s firmware can be written to sense a touch on the centre of the slider as a different button. This ‘extra’ button is implemented as a “Menu” or “Select” button. Apart from the capacitive sensors, the lighting control interface also has an LCD which is used display the percentage of the intensity, saturation of colors, or the selected lighting option.
LEDs are used to illuminate an active sensor on the user interface. These are commonly called “Backlighting LEDs”. There are holes cut on the PCB in such a way that whenever the user touches a sensor or slider, an LED from the bottom layer glows to illuminate the corresponding sensor or slider, thus giving feedback to the user that the sensor is active.
Radial Slider – In and Out
The design of a radial slider on a PCB is relatively straightforward. It can be considered as an assembly of multiple capacitive sensors arranged in a circular pattern. Apart from the shape, the only difference between a linear slider and a circular slider is that a linear slider has a fixed start point and end point and a circular slider does not because of its circular pattern. From an application point of view, traversing the finger from the left of a linear slider to the extreme right end will increase the resolution from 0% to 100%. With a circular slider, the application must also take into account how many revolutions have to be completed in order to reach 100% resolution.
In order to determine the exact position of finger on the slider, a separate method (i.e., centroid calculation) is required for detection. This is because when a finger is placed on a slider, it touches more than one sensor. Depending upon the area of a particular sensor covered by the finger, the exact position of the finger can be calculated by computing the centroid around the sensor which has the highest response. The centroid calculation method considers the response of the neighboring sensors as well because they are also touched by the finger. For example, if sensor 1 has the maximum response, then the sensors used for the centroid calculation are sensors 0, 1 and 2; likewise, if sensor 0 has the maximum response then only sensors 0 and 1 will be considered. In case of a radial slider, neighboring sensors are not just one sensor up and one sensor down. The following algorithm determines how to identify the neighboring sensors.
1. Scan all the segments in the slider and check whether they are active or not.
For (i=0; i
Scan Sensor (i); //Scan the sensor i
Check Sensor (i); //Check whether sensor is active or not
2. Locate the sensor with maximum responseIf (Any Sensor is active)
Biggest Sensor = 0;
For (i=0; i
If (Sensor Response(i) > Sensor Response(Biggest Sensor)
Biggest Sensor = i;
3. Locate the neighboring sensors and compute the centroid
If (Biggest Sensor
Left Sensor = Last Sensor;
Right Sensor = Biggest Sensor++;
Else if (Biggest Sensor Last Segment in the Slider)
Left Sensor = Biggest Sensor --;
Right Sensor = First Sensor;
Left Sensor = Biggest Sensor--;
Right Sensor = Biggest Sensor++;
Compute Centroid(Biggest Sensor);
Backlight LEDs are used to increase the visibility of the interface even in the dark. They can be a single color LED or a tri-color LED which can be given the exact color combination as the ambient light. For a tri-color LED, depending upon the current requirement, a closed-loop system can be formed to control the color and intensity using a buck/boost configuration.
Gang Proximity Sensing and Backlighting
Instead of using a separate trace for the proximity antenna, all the segments of the slider can be connected together to form a big sensing pad or an antenna which serves the functionality of proximity sensing. This method of implementing proximity sensing using a group of sensors is referred to as gang proximity. Gang proximity and backlighting are value-added features of this design. Together, these features activate the interface backlight whenever a hand approaches the device, thus enabling the user to locate the interface even in the dark. Implementing gang proximity sensing can be simplified by connecting all the segments of a radial slider to an analog mux. With a mixed-signal device like the C?Y8C21x34, an internal Analog Mux Bus can be used to connect the external sensors interfaced on different package pins to the internal CSD block. Connecting or disconnecting the sensors to/from the Analog Mux Bus can be done in firmware:
CSD_EnableSensor (0x02, 0x044); // Connects P2.6 (Port 2 pin 6) and P2.3 (Port 2 Pin 3) to the
// Analog Mux Bus
When the gang sensor’s antenna detects an object like the user’s hand within proximity of the board, firmware lights the backlight LEDs to enable the user to locate the interface. After switching the LEDs to an ON state, the radial slider can be switched back to its normal functionality by disconnecting the sensors from the Analog Mux Bus. Timeout functionality can also be implemented to switch OFF the LEDs if the object/hand moves away from the board for a fixed time.
Appropriate tuning of the gang proximity sensors allows configuration of the antenna strength. This decides the distance at which the proximity antenna successfully detects an object near the user interface board and switches ON the backlight LEDs.
This article described a typical implementation of a user interface for controlling the ambient light using capacitive sensing methodology. Developers can further enhance the model by providing a color gamut which will enable users to select a color of their own choice for light control. Making the light control user interface communicate wirelessly with the controlling unit is yet another way to differentiate the lighting control.