Design and realization of a tactile switches module with capacitive sensing method implemented with a microcontroller

The aim of this research project is the architecture and the design of an electronic system for controlling domestic tactile switches to be integrated into a home automation system based on the KNX standard. All the steps that led to the fulfillment of the finished prototype are reported, from the study and design of the capacitive tactile sensors and the electronic control board according to the specifications imposed by KNX standard. The touch event detection is reached as a trade-off with the footprint requirements of the switch. Experimental results of the fabricated prototype are presented to demonstrate the feasibility of this device.


I. INTRODUCTION
HE home automation industry is going through a phase of strong growth overall in Europe, mainly thanks to the knowledge gained by users on potential of this technological approach in terms of greater safety, comfort, energy savings and ease of use.Even the building designers show a greater interest in home automation, as an added value of dwelling and contributing factor to the increase in competitiveness of the offer.In parallel with the advancement of home automation solutions in recent years the offer of advanced functionalities and increasing levels of integration is enhanced.To this is added the modern conception of logic in living styles requiring housing with greater flexibility to match the changing needs of users in connection with new technologies.The home automation market manifests a growing interest especially for use in new or renovated houses with particular interest to the issue of security and the energy saving.From the users' side the main requirements for new home automation devices are: -Ease of use: you must ensure easily accessible information preferring intuitive interfaces and the use of touch-screen.
-Solutions based on open standards: that there must be the possibility for the user to replace the entire system or change a service without requiring a redesign of the facilities.
-The reliability of continued operation: can be obtained by providing flexible and easily programmable systems to suit the needs of customization of each user and an efficient maintenance service.
The purpose of this work is to describe the research and development phase of an electronic system for controlling domestic tactile switches to be integrated into a home automation system based on the KNX standard.
The device designed tries to respond to the major needs of end-users of a home automation system, preferring a tactile technology to the control elements and using KNX it is at present the open standard for home automation widespread in Europe.
As for the use of capacitive touch acquisition of control, it should be noted that in recent years, this technology has matured enough to provide greater robustness, reliability and greater user satisfaction compared to traditional switches mechanical.
The main advantages of the proposed solution are: -Greater durability and reliability due to the absence of moving parts, which is due to the mechanical switches of the device wear.Moreover, the absence of openings they make it possible to use in harsh environments where dust and moisture could penetrate the device.
-A sleek design that allows switches to be integrated perfectly into the home.
-The multi-functionality: hardly feasible with mechanical switches, it becomes possible with tactile technology that can implement different functions starting from a single control element.
-Feedback to the user: the apparent lack of tactile switches do not provide the user with clear evidence of the activation, is instead resolved by providing the ability to have different types of feedback as the lighting of a LED, a sound or one of the key vibration and differentiate them according to the function performed.
The work presented in this paper is organized into the following sections: 1.The study of the state of the tactile capacitive acquisition techniques and solutions used in home automation systems; 2. The design of the sensors, the electronic control board and

II. STUDY OF TACTILE CAPACITIVE ACQUISITION TECHNIQUES
A simplified model to understand the principle on which is based the capacitive acquisition considers the electrode as one of the faces of a capacitor, while the second is represented by the environment in which it is located (forming the parasitic capacitance C0) or, in addition, by another conductive object such as a finger (forming a CT capacitance).
The overall capacitance is connected to a measuring circuit that periodically acquires the value of the electrode capacity.This model shown in Figure 1 neglects the detrimental effects due to the interaction of the finger with the scattered fields generated by the coupling between the electrode and the underlying ground plane.
To analyze how occurs the change in capacity from the physical point of view, we make reference to Figure 2.
The coupling between the copper electrode on the upper surface of the printed circuit board (PCB) and the underlying ground plane generates a parasitic capacitance, usually of the order of 10 pF to 300pF.The charge distributions on the two capacitor plates determine an electric field: most of the energy will be concentrated directly between the two conducting surfaces but a part protrudes in the external area and gives rise to the electric field lines denominated "fringing fields".
According to the general characteristics explained above, it is important to indicate the main parameters sizing of the electrodes and the choices done in this project: • Presence of a double interface: the sensors consist of a double interface, the first made by the copper layer on the surface of the touch board and the plastic cover, the second by the plastic cover and the outer cover made of steel.At these will go to addition, in case of touch, the contact surface between the metal cover external and finger.
• Material and thickness of casing: polycarbonate, 1 mm • Geometry: rectangular with rounded corners • Dimensions: ratio of coverage and thickness of the electrode side at least 1: 4 • Distance between the electrodes: ratio between the distance and longer side of electrode 1: 8 and use of adjacent key suppression (AKS) method available for microcontroller implementation.
• Inserting a ground plane: reduces sensitivity.

A. Techniques of capacitive touch sensing
After understanding the physical principle underlying the change in capacity determined by the contact of the electrode fingers, it must explain how this change can be detected and converted into a useful signal.There are numerous methods to detect the capacity increase caused by the proximity or contact of a conductor from: variation of the resonance frequency, frequency modulation or amplitude, the measurement of the charge/discharge, delay measurement time in reaching a threshold or duty cycle [1][2] [3].
Most of these methods require analog circuits inheriting the related problems as crosstalk and sensitivity to noise [4], this may be preferable for a digital approach that guarantees smaller dimensions and lower power consumption than analog solutions.Some of the most commonly used acquisition techniques are described in the following paragraphs, divided on the basis of the expected degree of integration.In fact we can distinguish two main categories of implementation: software-based solutions, using microcontrollers for general use, and specialized controllers for capacitive acquisition.
Of course are also possible other solutions such as custom microcontrollers for interfacing capacitive sensors whose architecture include modules dedicated to scanning arrays of capacitive sensors and are easy to implement.In tactile sensing the recent trend is to prefer the use of custom microcontrollers or otherwise use microcontrollers already tailored for capacitive acquisition.Each class of solutions, however, has its strengths and weaknesses and then depending on the application requirements, the designer must select the best approach.
In this section are compared the two approaches based on dedicated microcontrollers and the other based on the use of a  general purpose microprocessor requiring the programming of software for touch detection.

B. Solutions based on the use of dedicated controllers
Several off the shelf solutions have been analyzed and compared for the design of the final prototype: 1) FUJITSU FMA1127 The FMA1127 is a controller for capacitive sensors, which converts the capacitance generated by the interaction between the human body and the electrode only in digital data without any analog signal processing.
Moreover, this solution increases the flexibility of design, provides good performance in terms of power consumption and stability.In Figure 3 is shown the acquisition scheme adopted for this case.
This scheme has two R-C delay lines: one connected to a reference capacity CR and the other one connected to the "sensing" capacity CM, that is, the electrode, subjected to the same environmental conditions.Both are controlled by the same clock (CLK) signal, which frequency can be programmed up to 20 to ensure fast response times and no negative impact on the system's susceptibility to the EMI.The leading front of the clock increases more slowly because the larger charging time due to increased capacitance in the case of the touch event.In Figure 3 can be observed that CLK2 rises more slowly than CLK1, and then reaches a threshold value considered "high", with a delay.
Therefore the two logic signals In a capacitive sensor, the value of the CM capacity changes depending on whether or not a finger is present on the conductive plate, while the CR capacity has small variations due to environmental conditions (e.g.Temperature changes).During a touch event, CM varies rapidly from a minimum value 2) QTOUCH® IN AT42QT1070 CONTROLLER QTouch® is a technology for the tactile acquisition developed and patented by Atmel that employs both controllers dedicated to this type of detection is the use, for these purposes, the processors of the AT-MEGA family (see Figure 4).
In this work the acquisition technique was initially estimated by the evaluation-board Qtouch Xplained.This card supports four capacitive touch interfaces acquisition: slider, wheel and two touch-buttons and provide the connection to a dedicated card containing the ATxmega128A1 processor.In Figure 4 the two blue circles represent two planar electrodes, each of which is connected to the GPIO pin of the processor by means of a number of capacities and resistances visible in the lower part of the PCB which allow the detection of the capacity variation electrode.In this study the technique was deepened with the AT42QT1070 controller tests and reproducing the operating diagram with discrete components using NXP LPC 1227 processor, as will be detailed below.
The QTouch® technique is based on charge transfer from the electrode capacity of acquisition to a higher value.In the first phase the Cx electrode, having unknown capacitance because its value will be different depending on whether the touch occurred or not, is charged to a known potential.The charge is then transferred to a measurement capacitor Cs (see Figure 5), the latter has a fixed value and greater than about one order of magnitude compared to Cx.We can assume that the sensing electrode capacity is of the order of pF and the design for Cs value is fixed in the range 12-22nF.The charge transfer cycle is repeated until the voltage at the terminals of Cs reaches a threshold voltage of Vih.The level of the signal of interest is given by the number of charge transfer cycles from the capacity Cx to Cs taken to reach this voltage.Placing a finger on the touch surface introduces an external capacity that increases the amount of charge transferred in each cycle (because it increases Cx), thus reducing the total number of cycles necessary for Cs to reach the threshold voltage.When the number of cycles falls below the aforementioned threshold, then the sensor is again placed in the touch detection phase.
Cx and Cs are currently connected with a certain number of resistors Rs in series.Some of these series resistors are inserted in this design to enhance the performance of the system to EMI and ESD, the number and the value of these resistors must be chosen on the basis of the Cx value, a total value of resistance is usually considered appropriate 10kΩ; the presence of additional resistance is due to the resistivity of the tracks that connect the capacitive sensor and to that of the electrode constituent material itself.
The RC time constants that are determined tend to slow down the acquisition process, therefore it is important to measure the settling time relative to the individual pulses of the charge transfer in order to have fronts of the more rectangular as possible while ensuring reliable detection.A simple test may be performed with the oscilloscope by placing the tip of the probe on a coin resting on the surface of the sensor cover.

C. Experimental evaluation of two solutions for capacitive tactile switches
After the general analysis reported in the previous sections, two possible solutions have been evaluated with experimental board and switches prototypes and their descriptions as follow.

1) Microprocessor and custom software programming
This solution was carried out in microprocessor and software configuration, employing at first the electrodes of the evaluation-board Qtouch Xplained Atmel and subsequently two copper electrodes of the same type as the final touch card, realized on the surface of the PCB and having a central hole for the signaling LED, with area1.6 cm x 1.5 cm.The processor is mounted on the NXP LPC1227 Evaluation Board IAR KICKSTART KIT.The software was developed in the environment IAR Embedded Workbench.With this setup have been measured the duration of the charge transfer cycle for the touch and no-touch cases, that are 0,881ms and 1,784 ms respectively.An illustration of the waveforms recorded for the touch case is reported in Figure 6.

2) ATMEL custom microcontroller AT42QT1070
The second solution was based on the AT42QT1070 controller ATMEL, configured Comms Mode and employing six channels of detection.The unused channels can be disabled by setting to zero the Averaging Factor parameter.The schematic of the electronic circuit is shown in Figure 7.The CPU of this LPC1227 IAR Kickstart Kit, communicates with the microcontroller via I2C line.The event of variation of the state of one of the buttons involves the transition of the CHANGE line from logic high to a low level that is signaled to the microprocessor via an interrupt allowing the savings of otherwise necessary resources for the periodic reading of the registers of the controller.With reference to Figure 8; we can observe that the reading of the registers occurs only to the interruption, after which the CHANGE line returns high again.
The CHANGE line (red color) goes from low level to high following the reading of first register, blue and yellow lines are reported respectively for the I2C clock and data lines and show the I2C standard reading protocol.
The outcome of the comparison of these solutions, led to prefer the use of a custom microcontroller for the following reasons: • Simplified management of multiple electrodes, • Touch event capture rate • Increased reliability of detection • Saving microprocessor resources • Fewer GPIO pins and links • Greater flexibility of use

III. ELECTRONIC HARDWARE DESIGN AND IMPLEMENTATION
The system design consists of two main logical sections that correspond to implementation with two PCBs: the touch board realizes the acquisition of the touch (see Figure 9); the control card implements the control section and the interface with the KNX bus and the external expansion.The control board is composed of three main sections: the processing consisting of the microprocessor which communicates with the acquisition section via the I2C line and the mezzanine type connector (see Figure 10).
The system communicates with the KNX bus through NCN5120 transceiver.Besides allowing interfacing with the KNX bus system on twisted pair networks, the device integrates two programmable DC/DC converters that allow to change the input voltage available from the KNX bus line, to the voltage levels needed to power the integrated circuit.The extension section shown in Figure 10 has been introduced to interface the CPU with other external devices, for example temperature sensors.The I2C line buffer is useful to perform a level shift for the communication with devices powered at different voltage levels.

IV. SOFTWARE DESIGN AND IMPLEMENTATION
In this section is briefly reported the software design.System management software covers both the acquisition of the user commands by the touch controller is communicating with the KNX bus.To minimize the software development time has  The prototypes of the control board and the integrated touch board with capacitive touch sensors have been realized also considering the possible problems arising from the possible certifications EMI.After installing the firmware on the control card (see Figure 11) through the UART port of the microprocessor and the PC on which is installed the boards of the programming tool, a series of electrical tests on the prototype were carried out.The complete device was assembled by using a 3D printing for the plastic case of the electronics and sealed connectors and the 4 tactile metal switches (see Figure 12).
In Figure 13 is shown the final set-up with the power supply, the four tactile switches board with LED signaling, the KNX interface and electromechanical actuator (relay).

A. Power consumption analysis.
A preliminary estimation of the power consumption of the prototype was done during the electronic design phase.
The following list reports the estimate of power consumption of the main electronic components of the system: • Microprocessor: 13mW (operating freq.4,9152MHz, Configuration Active mode, peripherals all active) • Touch controller : 3mW (parameter LP mode = 0) • Transceiver: 150 mW (normal operating mode, no load, both DC/DC activated) • 6 LEDs: 79mW Adding up all these value the total is ≈ 245 mW.The measurements on the final prototype results in: • Current = 3.8mA @30V for KNX bus: 114mW • 6 LEDs ON: 79mW The total power consumption for these two components is 193 mW that is in good agreement with the preliminary estimate and it is acceptable for a domotic plant.

VI. PRELIMINARY CERTIFICATION TESTS
In order to submit a product on the European market it is necessary to verify compliance with the applicable EU directives, in our case the RoHS (Restriction of hazardous substances) and EMC (Electro Magnetic Compatibility).Evidence of radiated and conducted emission has been measured at a test laboratory.
The product has passed all tests except EMC immunity to conducted interference, therefore, is necessary to improve the design of the prototype.For carrying out immunity tests it was necessary to study a mechanical equipment that can reproduce the touch: it is proposed a piston controlled via PC actuated by a magnetic coil that was moved at regular intervals for pressing one of the buttons, the plunger tip is aluminum covered and connected to a battery 1.5V to simulate the touch (see Figure 14).
The KNX certification covers both the hardware part of the product software, checking the requirements imposed by the standard; choosing the hardware interface (NCN5120) and the Communication Stack already KNX certified simplifies the procedure by reducing time and costs for the obtaining of the brand.

VII. CONCLUSIONS
The study of the architecture of an integrated system with tactile capacitive switches and a KNX interface is presented with explanation of the design criteria.After the fabrication of a prototype with 4 tactile capacitive switches, a series of tests have been carried out to verify the correct operation of the of capacitive tactile signal acquisition which shown an excellent sensitivity and a good KNX communication reliability.The total power consumption of the device is about 245 mW that is rather low for a domotic plan device.Foreseen the industrialization of the prototype, preliminary tests have been developed according to EMI and ESD standards.This new device is useful for domotic plants to save energy consumption thanks to the versatile use of tactile switches function with limited additional cost for installation due to simple cabled connection of KNX.

Fig. 1 .
Fig. 1.Simplified model of change of capacitance from the value C0 to C0+CT when a finger is touching the dielectric layer top surface.
CLKR and CLKM generated by CLK1 and CLK2 respectively, have two rising edges with different delays with respect to CLK signal.These two rising edges, however, arrive in phase to the flip-flop thanks to the parasitic compensation logic obtained with DR digital values DR[0: N], the digital delay DM [0: N] values are adjusted by a feedback control with an Up/Down counter until CLKR_D and CLKM_D are in phase.The CM of the measured capacitance value can then be derived from the difference between the digital values DR [0: N] and DM [0: N].The CM capacity, as well as the difference between the delays of the two clocks on the lines, will be proportional to the difference DR [0: N] -DM [0: N].

(
CM1 = C0) to greater (CM2 = C0 + CT), and this change must cause a signal variation to reach a threshold.In the reference delay line the value of DR[0: N] is configured during the initialization phase to a value slightly lower than that of DM1[0: N], which indicates the absence of a touch.So the difference DR[0: N] -DM1[0: N] will give a negative delay value.The presence of the finger is detected when the difference (DR[0: N] -DM2[0: N]) becomes positive, in fact DM2[0: N], related to the case CM2 = C0 + CT, will be less than the digital value DR [0: N].

Fig. 3 .
Fig. 3. Diagram of the acquisition technique blocks used for FUJITSU FMA1127 and the timing signals for the touch event detection.

Fig. 5 .
Fig. 5. Illustration of Atmel solution for capacitive acquisition based on the charge transfer.Electrode capacitance is Cx..

Fig. 10 .
Fig. 10.Block scheme of the designed control board

Fig. 8 .
Fig. 8. Signals on lines SDA, SCL and CHANGE in case touch on Key 1

Fig. 12 .
Fig. 12. Final prototype assembly with the plastic cases developed with a 3D printer.On the right the four tactile metal switches.

Fig. 14 .
Fig. 14.Electromagnetic actuation system for mimicking the touch on the metal switch with an aluminum rounded tip connected to a 1.5 V battery for the electrostatic stimulus.The assembly was installed in the anechoic chamber during EMC tests.