As a practical and fashionable way of human-computer interaction, capacitive touch technology has been widely used in various electronic products, ranging from light switch to tablet computer and touch table. What follows is a test of how product designers play their wisdom. While designing the user interface of products conveniently and concisely, they can also present the gorgeous appearance of products, so as to bring good user experience. LED display has been widely used in capacitive touch product design because of its friendly interface, which can reflect the position information of touch in real time. This design is the use of a large number of led to achieve breathing lights, track lights effects, such as lighting, volume, temperature and other products with adjustment function to provide design reference.
Principle of capacitive touch
MSP430 supports a variety of capacitive touch detection methods according to different models, including RC oscillator, comparator and pin ro. This design uses pin relaxation oscillator The principle is shown in Figure 1. The internal detection circuit of the chip pin is composed of a Schmidt trigger, a reverser and a resistor. The oscillation signal is converted into a pulse signal through the Schmidt trigger, and then fed back to the RC circuit through the reverser, and transmitted through the timer_ A counts the output of the Schmidt trigger, and then obtains the counting result by setting the measurement window gate. When the finger touches the electrode, the C on the electrode changes, resulting in the change of oscillation frequency. In this way, different counting results can be obtained in the fixed length measurement window. Once the difference exceeds the threshold, combined with certain filtering algorithm, the touch event can be triggered.
Figure 1 pin ro schematic diagram
Implementation of LED PWM drive scheme
To achieve the effect of LED breathing, PWM dimming is required for LED, and to achieve the effect of track light, each LED must be an independent PWM control. Due to the use of 24 LED lights, this application needs 24 channels of PWM output control. Msp430g2955 has 32 IO ports. Through the IO port and timer, it can support 24 channels of software PWM output. In this case, Texas Instruments msp430g2955 is used to complete capacitive touch detection through 6 IOS, 24 IOS drive 24 LEDs, and communication port is reserved. The design example is shown in Figure 4
Figure 4 example illustration
The schematic design is shown in Figure 4. MCU supplies power to VCC through a 5V to 3.3V LDO. The purpose of using LDO is to ensure the stability of the power supply, so that the touch circuit will not produce excessive signal deviation due to the noise of the power supply when detecting the signal. As ESD protection device, the resistance in series on the electrode can be omitted if the product structure design is reasonable. UART port is reserved in the circuit to communicate with the main control system.
Figure 5 MCU circuit
The circuit of LED driving part is shown in Figure 5. Because the current of each LED is about 10mA, if 24 LEDs are on at the same time, there will be 240mA, which cannot be directly driven through MCU IO port. A triode and current limiting resistor are added to each led to realize the control of 24 LEDs.
Figure 6 LED drive circuit
This paper introduces the use of msp430g series single chip to achieve capacitive touch wheel and 24 independent PWM output LED control scheme, in some low-cost product design, but also for a variety of LED special effect control occasions, has great use value. MSP430 Series MCU is famous for its low power consumption and rich peripheral modules. For capacitive touch applications, MSP430’s pin ro capacitive touch detection mode supports IO port directly connected to the detection electrode without any peripheral devices, which greatly simplifies the circuit design. Msp430g2xx5 used in this design document supports up to 32 IO ports and can drive more than 24 LEDs Lamp, to achieve the ideal display effect. MSP430 capacitive touch runner scheme completes the capacitance detection of four channels through four IO ports. With special electrode graphics, the runner can be designed.