Sensors

How to Choose the Perfect Sensor for Your Arduino Project (9 Sensors with Project Examples)

In this post, we will be exploring nine different kinds of sensors and their speciality. Along with a description on how it works, each sensor will also have an example project attached to it to show how they can be potentially utilized.

1. PIR Sensor

PIR Sensor is an electronic device designed to detect motion by measuring changes in infrared radiation (heat) in the environment. PIR stands for “Passive Infrared”. This means PIR sensors don’t emit any radiation or signals of their own. They only detect changes in infrared radiation from objects in their surroundings.

The PIR sensor is typically used in motion detection devices. Motion detection systems are common in alarm systems, motion lights, automatic doors, etc. The HC-SR501 PIR Sensor is widely used in Arduino projects. For more information, visit Introduction to PIR Sensor: What Is It and How Does It Work?

PIR Sensor

Arduino Projects

For a project using this sensor, visit Automated Light System with PIR Sensor.

2. IR Sensor

The ‘IR’ in the name stands for Infrared Radiation, a form of invisible electromagnetic radiation that is sensed as heat emitted from objects. As such, an IR Sensor detects infrared radiation emitted by objects as heat. The effective detection range is 2cm to 30cm.

The Infrared Obstacle Avoidance IR Sensor is widely used in robotics and automation applications to enable obstacle detection and navigation for robots or automated systems. For more information, visit Easy Understanding IR Sensor: What Is It and How Does It Work?

Arduino Projects

For a project using this sensor, visit Door Security System with IR Sensor.

Door Security System with IR Sensor

3. Ultrasonic Sensor

An ultrasonic sensor is a device that uses high-frequency sound waves (ultrasound) to detect objects, measure distances, or detect changes in the environment. Unlike the previous two sensors, this sensor emits sound waves and measures the time taken to bounce off an object and return to the sensor.

The HC-SR04 is a popular ultrasonic sensor due to its simplicity, low cost, and ease of integration with microcontrollers. It can detect distances ranging from 2 cm to 4 meters, making it useful for various applications, including obstacle navigation for robots and distance measurement. For more information, visit Exploring the Power of Ultrasonic Sensors: A Brief Introduction.

IR Sensor vs Ultrasonic Sensor

  • Range: Ultrasonic sensors have a better detection range compared to IR sensors.
  • Accuracy: Ultrasonic sensors offer higher accuracy compared to IR sensors.
  • Response time: The response time of ultrasonic sensors is slower than IR sensors.
  • Environmental Factors: IR sensors are heavily affected by ambient light and surface color (white/black). Ultrasonic sensors are unaffected by light or color but can be affected by noise.
  • Usage: Ultrasonic sensors are ideal for applications requiring high accuracy, whereas IR sensors are more suitable for rapid detection.

Arduino Projects

For projects using this sensor, visit Smart Blind Stick with Ultrasonic Sensor and Touch Free Automatic Hand Sanitizer.

Smart Blind Stick - Connect Ultrasonic Sensor
Automatic Hand Sanitizer

4. Soil Moisture Sensor

The capacitive soil moisture sensor is widely used for measuring the volumetric water content of soil. Unlike traditional resistive sensors, which rely on electrical resistance and are prone to corrosion over time, the capacitive sensor operates on the principle of capacitance, offering better durability, stability, and accuracy in long-term soil monitoring applications.

Arduino Projects

For a project using this sensor, visit Automatic Plant Watering System.

5. Temperature and Humidity Sensor

The DHT11 is a low-cost temperature and humidity sensor. It contains two parts – a thermistor and a capacitive humidity sensor. There is a chip inside converting the analog signals to a calibrated digital output. The digital signal is easy to read and implement by using a microcontroller like Arduino.

As previously stated, the DHT11 contains two main components: humidity sensing component and NTC thermistor.

  • Humidity sensing component – Uses a moisture-holding substrate between two electrodes. The resistance changes based on humidity.
  • NTC thermistor – Measures temperature based on resistance variation with temperature.

Pros

  • Low cost
  • Easy digital interface
  • Low power consumption

Cons

  • Limited accuracy
  • Slow sampling rate
  • Limited temperature range

Arduino Projects

For a project using this sensor, visit Temperature Based Fan Speed Controller.

6. Hall Sensor

A Hall sensor/Hall effect sensor is an electronic device that senses the existence and intensity of a magnetic field. The device operates using the Hall Effect principle which was discovered by the physicist Edwin Hall. The Hall Effect principle holds that a magnetic field passing through a conductor at right angles within the device produces a small voltage known as the Hall voltage. This voltage is measured and converted into a usable output signal.

Hall Sensor

Types of Hall Sensors

Hall Effect sensors comprise two primary types: digital hall sensor and analog hall sensor. They look pretty identical, so double check the data sheets to make sure you use the correct sensor.

Digital Hall Sensor

  • Output: HIGH or LOW
  • Detects presence/absence of magnet
  • Example: A3144
  • Used in: Door open/close detection, speed detection

Analog Hall Sensor

  • Output: Variable voltage
  • Measures magnetic field strength
  • Example: A1302
  • Used in: Position sensing, current sensing

Arduino Projects

For a project using this sensor, visit Arduino Project – Bicycle Speedometer with Hall Sensor.

7. LDR Sensor

A Light Dependent Resistor (LDR), or Photoresistor is a semiconductor sensor which is sensitive to light intensity and exhibits decreasing resistance with increasing light intensity. LDRs have been extensively used in automatic lighting systems due to their ease of use, affordability and high sensitivity to light intensities.

LDR uses the phenomenon of photoconductivity. In LDR when light photons fall on the semiconductor material, light energy generates excited electrons. Increase in the number of free electrons results in increased conductivity. Consequently, the resistance is decreased due to this.

Pros

  • Simple and inexpensive
  • Low power consumption

Cons

  • Slow response time
  • Less accurate compared to photodiodes
  • Performance affected by temperature

Arduino Projects

For a project using this sensor, visit Automatic Night Lamp.

8. Gas Sensor

MQ Gas Sensors monitor the presence of combustible gas, smoke, and CO2 through air resistance measurements and is widely used for alarm and environmental sensing purposes.

Common MQ Gas Sensors

  • MQ-2: LPG, Propane, Methane, Smoke
  • MQ-3: Alcohol, Ethanol
  • MQ-135: Air quality (NH3, NOx, Alcohol, Benzene, Smoke, CO2)
  • MQ-7: Carbon Monoxide (CO)

Arduino Projects

For a project using this sensor, visit Detect Chemical Components in the Air.

9. Color Sensor

A Color sensor is a photoelectric device that detects and identifies colors. Color sensors are widely used in automation, sorting, and quality control. The most popular and widely available color sensor for Arduino projects is the TCS3200.

Color sensors use an array of photodiodes with red, green, and blue filters to analyze the intensity of light reflected by an object and determine its color based on RGB (Red, Green, Blue) values.

  • Light Emission: the sensor shines white LED light onto an object.
  • Light Reflection: the object reflects light depending on its color.
  • Filtering: the sensor separates the reflected light into red, green, and blue components.
  • Detection & Processing: photodiodes measure intensity levels and convert them into electrical signals.
  • Color Identification: the system processes the RGB values to determine the object’s color. 

Arduino Projects

For a project using this sensor, visit TCS3200 Color Sensor with Arduino.