The Internet of Things is one of the most important and promising technological topics today. Some market researchers estimate that there are more than 20 billion connected devices and counting. Around us, there are smartphones, wearables, and other devices, all of which use sensors. Nowadays, sensors play an important role in our everyday life and in IoT. Sensors monitor our health status (e.g. a heartbeat), air quality, home security, and are widely used in the Industrial Internet of Things (IIoT) to monitor production processes. For these reasons, it is important to know how they work and how we can use them to acquire information.
What Is a Sensor?
Generally speaking, a sensor is a device that is able to detect changes in an environment. By itself, a sensor is useless, but when we use it in an electronic system, it plays a key role. A sensor is able to measure a physical phenomenon (like temperature, pressure, and so on) and transform it into an electric signal. These three features should be at the base of a good sensor:
- It should be sensitive to the phenomenon that it measures
- It should not be sensitive to other physical phenomena
- It should not modify the measured phenomenon during the measurement process
There is a wide range of sensors we can exploit to measure almost all the physical properties around us. A few common sensors that are widely adopted in everyday life include thermometers, pressure sensors, light sensors, accelerometers, gyroscopes, motion sensors, gas sensors and many more. A sensor can be described using several properties, the most important being:
- Range: The maximum and minimum values of the phenomenon that the sensor can measure.
- Sensitivity: The minimum change of the measured parameter that causes a detectable change in output signal.
- Resolution: The minimum change in the phenomenon that the sensor can detect.
Sensors can be grouped using several criteria:
- Passive or Active. Passive sensors do not require an external power source to monitor an environment, while Active sensors require such a source in order to work.
- Another classification is based on the method used to detect and measure the property (mechanical, chemical, etc.).
- Analog and Digital. Analog sensors produce an analog, or continuous, signal while digital sensors produce a discrete signal.
There are other ways and methods to group sensors but the classifications shown above are the easiest.
How to Use Sensors in IoT [IoT Sensors]
The development of prototyping boards and the low price of sensors allow us easily use them in IoT projects. There are several prototyping boards on the market, suited for different projects depending on features and specifications. In this context, we will consider the two most popular boards: the Arduino Uno and Raspberry Pi 2.
This article will explore how to connect different sensors to these boards and how to interact with them.
Before diving into the details on how to use sensors with these boards, it is important to note that every sensor has its own operating voltage range. This parameter is very important because the voltage supplied by the board must not be higher than the maximum voltage allowed by the sensor. Therefore, it is important to read the sensor data sheet carefully before connecting it to the board to avoid damage. The same principle is valid for the output signal, which must be lower than the maximum voltage that the board can tolerate.