Understanding the different sensors available and their applications is actually one of the most important areas you can focus on as an Arduino hobbyist.
If you’re serious about this, you’re going to come across most of these sensors while doing some basic initial experiments anyway. But it’s good to have an understanding of what exactly they do, and how you can combine them for the best results.
Basic Concepts
An Arduino board by itself is not very useful. You can upload small programs to it and have them perform basic operations, but the hardware is pretty limited for any real computational uses (at least compared to alternative offers on the market, like the cheaper models of Raspberry Pi).
The true power of the platform lies in the various sensors and other modules you can attach to the base board. With just a few jumper wires and some lines of code, you can have a basic setup that tracks a particular property and outputs relevant data through your Arduino.
Sensors come in different shapes and sizes, and some are intended to be combined with others for a full effect. Most can be used on their own, though—and in some cases, you may even be able to connect them in standalone circuits, without even needing an Arduino controller.
Popular Sensors Explained
Let’s have a look at some of the most popular sensors you will come across, and see how they work under the hood.
Light Sensor
A light sensor, as the name implies, can be used to detect changes in the ambient light level. This can be useful for controlling the lighting in various environments. For example, turning off your home’s lights when it gets dark outside, or adjusting the intensity of heating lamps when growing plants.
Most Arduino light sensors are implemented through a basic LDR (Low Dynamic Range) light sensor, which gives them a lower sensitivity compared to more advanced modules like photo diodes and resistors. Still, a basic LDR light sensor should provide enough sensitivity for most hobby projects.
Temperature Sensor
Temperature sensors are typically implemented with either an NTC (Negative Temperature Coefficient) or PCT (Positive Temperature Coefficient) thermistor.
The only difference from a user’s perspective is how you should interpret the output values. Some sensors might feature an internal converter that handles that part for you, attempting to standardize the output of most temperature sensors on the market.
Humidity Sensor
Humidity sensors are often found integrated into temperature sensors, with the two offered as a paired unit. They can be found as standalone devices as well. Most Arduino humidity sensors are capacitive, meaning they measure humidity changes through a thin strip of a material that changes its capacitance relative to surrounding humidity.
Motion Sensor
The name of a motion sensor is somewhat misleading. They don’t actually detect any motion, but rather changes in ambient infrared radiation levels.
Infrared radiation is emitted by practically everything and everyone, and humans are particularly “hot” in this regard due to their higher body temperature relative to the environment. Because of this, when a human walks into the range of a motion sensor, their presence is detected—but the sensor never measured any actual movement in the first place.
Proximity Sensor
Most proximity sensors for Arduino are based on the classic infrared design. The sensor emits beams of infrared light aimed straight ahead, which are then reflected off any surfaces they hit.
The sensor detects returning beams and measures the difference in time between emitting a beam and receiving it back. That way, it can estimate the distance the beams traveled with great accuracy and without consuming a lot of power.
Accelerometer
Accelerometers are used to measure changes in acceleration, which can be used to identify changes in position and velocity. They are usually realized by a small crystal next to an object of a certain mass, connected to a very sensitive lightweight spring.
Any movement of the whole setup causes the mass to shift around, exerting pressure on the crystal. The crystal can then convert changes in pressure to electric signals, indicating how much acceleration is currently being applied to the body.
When Does a More Expensive Version Make Sense?
Some sensors have more expensive counterparts. For a simple DIY project, you should usually be fine with a cheaper version of each sensor you need. This is especially true during the prototyping phase, where you’re usually hacking everything together with jumper wires and don’t really care about optimizing space or power consumption.
But as you move closer to completing your project, you might want to look into more advanced, durable sensors. Some of those might make your device more power-efficient (which can make a huge difference in battery-powered setups), while others can increase the accuracy level of the measurements you’re getting.
One problem you could run into when switching from less to more expensive sensors is that it might invalidate your initial device calibrations. If you did all calibrations on a less precise sensor, you might have to adjust certain things when switching over to more advanced versions. In this case, it might make more sense to start with the more precise sensor in the first place.
Things to Keep in Mind About DIY Projects
Sometimes you can implement your own sensors with the right parts. But you have to remember that a proportion of the price you’re paying for a pre-made one goes towards more than just the basic materials and construction effort.
You’re also investing in something that’s been thoroughly tested and calibrated, and you’ll know that you can rely on the measurements it provides (within a certain range of accuracy). While you might be able to guarantee the same for your own counterparts, it can take a lot more time and effort to bring them to that point.