In this tutorial, we will see how we can interface TTP223B touch sensor module to Aries v2 board. Touch sensor also known as tactile sensor is used in detecting and recording physical touch. It is commonly used in robots for enabling basic movement and the ability to detect touch in its surroundings, smartphones, automotive, industrial applications.
Touch Sensor
Touch sensor is a small and low-cost sensor made to replace old mechanical switches seen in the past. It works like a switch, where when there’s contact, touch, or pressure on the surface of a touch sensor, it opens up an electrical circuit and allows currents to flow through it.
Circuit Diagram
There are 3 pins in the touch sensor module – VCC, GND and Signal (SIG). VCC pin provides supply power to the the sensor and GND pin is its ground connection. Signal pin is Active high pin in which it goes high when the sensor is touched.(Refer Touch Sensor datasheet)
Connect VCC and GND of the sensor module to +3.3V and GND respectively of ARIES v2 board. Then connect the Signal Pin of the touch sensor to the GPIO0 of Aries v2 board.
Now, for powering up the ARIES v2 board via USB port of a Laptop/Desktop/PC and burning the code into the ARIES v2 board, we have to use a micro USB type B to USB type A cable. The cable should be connected to UART0 port of the ARIES v2 board, and the Laptop/Desktop/PC should be preinstalled with VEGA SDK and Toolchain.
Touch Sensor | ARIES V2 board |
VCC | 3.3V |
SIG | GPIO0 |
GND | GND |
Procedure
After setting up the toolchain and SDK path environments, clean the executable using make clean command.
cd examples/gpio/touch_sensor_pgm
make clean
Build the example program for Touch sensor by using make command
make
Before transferring the built program to board, ensure that you have connected the UART0 connector of the board to the PC.
Open a new terminal, execute the following command
sudo minicom aries
Now you can see the minicom terminal opened and the board UART terminal is ready.
Use CTRL+A S to enter file sending menu and select xmodem by pressing Enter.
In the next window, with Space bar select the touch_sensor_pgm.bin file to be transferred. By pressing Enter, transfer process starts.
Wait until the process is completed. The screen should display how much data has been transferred.
After completing transfer the Program will start to execute.
The status “Touched /Untouched” is displayed in minicom UART terminal when sensor is touched/untouched as follows: