1.4. Sensors in embedded system
1.4. 1. Definition
A sensor is an electronic device that detects or measures a physical condition and converts it into an electrical signal that can be processed by a computer or microcontroller.
A sensor is an input device that detects changes in the environment and converts them into electrical signals.
1.4.2. How a Sensor Works
Every sensor follows three basic steps:
- Detects a physical quantity.
- Converts it into an electrical signal.
- Sends the signal to the controller.
Example:
Temperature → Temperature Sensor → Electrical Signal → Arduino → LCD Display
1.4.3. Classifications of sensors
1.4.3.1. Active and Passive Sensors
Active Sensors: are the type of sensors that produces output signal with help of external excitation supply. The own physical properties of the sensor vary with respect to the applied external effect.
Therefore, it is also called as parametric sensors
Example:
- The carbon microphone
- Strain gauge (device which measures pressure or stress)
- Ultrasonic Sensor
- Gas Sensor
- PIR Motion Sensor
Passive Sensors: are the type of sensors that produces output signal without the help of external excitation supply. They do not need any extra stimulus or voltage. Other name Self Generating Sensors.
Example:
- magnetic microphones
- piezoelectric sensors
- Thermocouple (which generates a voltage value corresponding to the heat, applied. It does not require any external power supply)
- Photovoltaic Cell
1.4.3.2. Analog and digital sensors
Analog Sensors: An analog sensor measures continuously the variable and detects any proportional value between 100% and 0%. For this reason, the measure provided by the analog sensor is more precise than the one provided by the digital sensor.
The analog output generated is proportional to the measured or the input given to the system. Generally, analog voltage in the range of 0 to 5 V or current is produced as the output
Examples for continuous signals: light sensors, temperature sensors(that measures between 0°C and 100°C.)
Example:
- LM35 Temperature Sensor
- LDR
- Pressure Sensor
Digital sensors: A digital sensor only detects two possible status: if it is working at 100% or at 0%. A digital sensor can only measure if it is working over 50°C (displaying 1) or under 50°C (displaying 0).
Example:
- DHT11
- DHT22
- DS18B20
- MPU6050
1.4.3.3. Contact and noncontact sensors
Contact sensor: a sensor that requires physical contact with the stimulus.
Example:
- Strain gauges
- Most temperature sensors
Non-contact sensor: requires no physical contact.
Example:
- Most optical and magnetic sensors
- Infrared
- Thermometers
1.4.4. Common Sensors in Embedded Systems
1.4.4.1. Temperature Sensor
Measures temperature.
Applications
- Air conditioners
- Refrigerators
- Medical equipment
- Weather stations
Examples
- LM35
- DS18B20
- Thermistor
1.4.4.2. Light Sensor
Measures light intensity.
Applications
- Automatic street lights
- Solar tracking systems
- Camera brightness adjustment
Examples
- LDR
- Photodiode
- Phototransistor
1.4.4.3. Ultrasonic Sensor
Measures distance using sound waves.
Working Principle
- Sends ultrasonic waves.
- Waves hit an object.
- Echo returns.
- Distance is calculated.
Applications
- Robot obstacle detection
- Car parking systems
- Water level measurement
Examples
- HC-SR04
- HC-SR05
- JSN-SR04T
- A02YYUW
1.4.4.4. Motion Sensor
Detects movement of people or animals.
Applications
- Security systems
- Automatic lighting
- Smart homes
Examples
- HC-SR501
- HC-SR505
- RCWL-0516
- AM312
- Panasonic EKMB / EKMC
1.4.4.5. Humidity Sensor
Measures moisture in the air.
Applications
- Agriculture
- Weather stations
- Greenhouses
Examples
- DHT11
- DHT22
1.4.4.6. Soil Moisture Sensor
Measures water content in soil.
Applications
- Smart irrigation
- Precision agriculture
Examples
- YL-69
- YL-100
- FC-28
- Capacitive Soil Moisture Sensor v1.2
- SEN0193
- SEN0308
1.4.4.7. Gas Sensor
Detects gases such as:
- LPG
- Methane
- Carbon monoxide
- Smoke
Applications
- Fire alarms
- Gas leakage detection
- Industrial safety
Examples
- MQ-2
- MQ-3
- MQ-135
1.4.6. Characteristics of Sensors
A good sensor should have::
- Accuracy: How close the measurement is to the true value.
- Precision: Ability to produce the same result repeatedly.
- Sensitivity: Ability to detect very small changes.
- Resolution: Smallest detectable change.
- Response Time: Time taken to produce an output after detecting a change..
- Range: Minimum and maximum measurable values.
- Reliability: Ability to operate correctly over a long period.


