
Meet the Sensor will highlight the major points about each of the EV3 sensors (touch, color, ultrasonic, gyro, and infrared). The posts are an introduction to each sensor and are not meant to be exhaustive. Each post will show a picture, discuss what it does, common uses, how it works, building and programming tips and tricks, the author's favorite use, and where to find more information.
What it Does
The touch sensor recognizes three states: when the red end has been pushed in, when it has been let out, and when it has been pushed in and out really quickly (referred to as bumped). It is called "touch" because a very common use is to be touched by the user's finger or thumb. However the three actions can be triggered by almost any object it comes into contact with.
Common Uses
The touch sensor is commonly used to cause a physical action (push the button and a motor attachment turns to thrown an object), register an event (push the button to increase the count on the EV3 brick every time a student walks into the classroom), and to register when a moving robot comes into contact with another object (often used to detect contact on robot vehicles in FIRST LEGO® League).
How it Works
Internally when the sensor is pushed all the way in it causes a circuit to be closed. When this happens a digital signal, a 1 in binary language, is sent to the EV3. When the red button is not depressed, the circuit is open and a 0 is sent. When the bump happens