Sensors

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

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.

PIR Sensors are typically used in motion detection systems, such as in security alarmsmotion-activated lighting, and automatic door openers. 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 electromagnetic radiation that is not visible to the human eye but can be sensed as heat. An IR Sensor (Infrared Sensor), as the name suggests, 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 (or Hall effect sensor) is an electronic device that detects the presence and strength of a magnetic field. It works based on the Hall Effect, a principle discovered by physicist Edwin Hall.

The principle states a magnetic field passing perpendicular to a current-carrying conductor, inside the sensor, will generate a small voltage (called Hall voltage). This voltage is measured and converted into a usable output signal.

Hall Sensor

Types of Hall Sensors

Hall Effect sensors comprises 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

An example project is Bicycle Speedometer with Hall Sensor.

7. LDR Sensor

A Light Dependent Resistor (LDR), or Photoresistor, is a semiconductor sensor whose resistance decreases as light intensity increases. Due to its ease of use, affordability and highly sensitive to light levels, LDRs are widely applied in automatic lighting systems and light-sensing circuits.

LDR works on the principle of photoconductivity. When light photons hit the semiconductor material, light energy excites electrons. More free electrons increase conductivity. Then resistance decreases 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 detect combustible gases, smoke, and CO2 by measuring changes in air resistance, commonly used for safety alarms and environmental monitoring.

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 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.