Sensors are the input threshold for the technological device. They allows to the system to know the state of the environment. For instance, detecting the proximity of an user, changes in the temperature of the room, movements of an object close to the device, etc.

Depending on the physical nature of what is going to be measured, sensors can be classified in five (or more) main cathegories, as shown in the following table:

Proximity Optics Field Mechanical Temperature
InfraRed, SONAR, LASER Cams, KINECT, LDR Alcohol, Radiation, Compass, Magnetics Piezoelectric, microphone, pressure, accelerometers, gyros, odometers, switch taps, potentiometer, wind-sensors, flex sensors thermometer, pyrometer

Sensor Features:

  • Power: passive / active. Depending on the necessary of being powered or not, sensors are classified in active or passive, respectively.
  • Signal representation: analog / digital.
  • Nature of magnitude they measure.
  • Range: physic limit inside of whisch the sensor works.
  • Precission: minimum physical variation that is able to detect.

Proximity Sensors

Infrared Telemeter

This active sensor is very directional. It works launching an infrared beam that bounces back and is detected by an infrared receptor. The distance between the sensor and the obstacle is measured by the incident angle, as it is shown in the following figure:


The most common IR sensors are made by SHARP, as shown in the following figure:


The sensor has 3 connections, 2 for powering Vcc,  GND, and the third one gives a voltage that is between Vcc and GND that is a function of the measured distance. This function is not lineal, and is calculated empirically for knowing the distance from the measured voltage. However, the datasheet propose a explicit function that can be used.

Depending on the SHARP model we can measure obstacules from 60 cm up to 80m.


It works similarly to an IR, but insted of a infrared beam it uses a UltraSound signal. The distance is calculated by measuring the signal flight duration.


The most common is made by Parallax.

PIR (Passive InfraRed) 

This sensor just gives a high or low digital output depending if there is any movement inside its perception range.


Optic Sensors

LDR: Light Depeneding Resistor

It is a passive sensors. It is made by a material that changes its electronic resistor depending on the amount of light that lights up the sensor.


In the following figure it is possible to see the variation of the resistor and the light.


As you can see, the variation can involve several orders of magnitud. This fact can be controlled by a voltage divisor circuit, as it is shown below.

Mechanical Sensors


It perceives vibrations and hits. Piezoelectrics can generate big voltages (in the 1000V). It is necessary to put a resistor of MOhms in parallel for avoiding damage the electronics where the sensor is connected to.

In the figure there is an example on how to connect a piezo to an arduino board. You can check the complete example out in here.

Flex Sensors

These type of sensors change their resistor value when their shape changes.

The sensor of the figure is designed for flexing

Accelerometers and Gyroscopes

The accelerometer measures changes in the acceleration. The gyros measures changes in the angles of inclination of the sensor. Both sensors usually comes in an integrated circuit that makes it quite easy to handle.

The sensor measurement is refered to the 3 cartesian axis, X, Y and Z. The accelerometer sensibility is given as a function of Earth gravity (G = 9,8 m/s^2), as 3G, 5G, and so.

Sensor Callibration and Range Configuration

As shown above, there are a lot of sensors that changes their resistor values as a function of some physic magnitude: light (as the LDR), deformation (as flex sensors), or rotation (as a potentiometer). Moreover, this variation could be of several magnitude orders.

Therefore, there is a problem on how to manage this type of sensors of variable resistor and control the measurement. The most common solution is to put the sensor in a voltage divisor circuit, as shown in the following figure:


The output voltage "V0" depends on the resistor R1 as follows:


R1 is the value of the resistor of the sensor we want to callibrate.

That is, V0 is Vcc when R1 is zero, and V0 goes to zero, when R1 is much bigger than R2 (R1»R2). That way, R2 is used to adjust the slope of the curve of above. As a rule of hands you can chose R2 to be half the maximum value of R1.

For example, for one LDR resistor, it is possible to use a R2 value around 10K, as the range of R1 is [0.1 Ohm, 1Mohm]

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License