0% found this document useful (0 votes)
15 views34 pages

Sensor Reports

The document discusses various temperature and gas sensors, highlighting their applications and features. It details specific temperature sensors like the Multimeter with thermocouple type K, IR 1651 GM, LM35, and DS18B20, as well as gas sensors including SKU SEN0219, MQ-135, MQ-9, and MQ-2. The document also presents measurement results and calibration methods for the sensors, emphasizing their importance in industrial and environmental monitoring.

Uploaded by

Nacho Crespo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views34 pages

Sensor Reports

The document discusses various temperature and gas sensors, highlighting their applications and features. It details specific temperature sensors like the Multimeter with thermocouple type K, IR 1651 GM, LM35, and DS18B20, as well as gas sensors including SKU SEN0219, MQ-135, MQ-9, and MQ-2. The document also presents measurement results and calibration methods for the sensors, emphasizing their importance in industrial and environmental monitoring.

Uploaded by

Nacho Crespo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 34

Temperature sensors

Temperature sensors are crucial components in a wide range of applications,


from industrial processes to consumer electronics, providing accurate
temperature measurements necessary for monitoring and control systems.
Among the various types of temperature sensors, the Multimeter with
thermocouple type K, IR 1651 GM, LM35, and DS18B20 stand out for their
unique features and applications.
The Multimeter with thermocouple type K is widely used in industrial
settings due to its broad measurement range and robust nature.
Thermocouples, specifically type K, are valued for their durability and ability
to measure high temperatures, making them ideal for environments where
precision and reliability are paramount.
The IR 1651 GM is an infrared thermometer known for its non-contact
measurement capabilities. This sensor is particularly useful in scenarios
where direct contact with the object being measured is impractical or
unsafe, such as in the food industry or when measuring the temperature of
moving parts.
The LM35 temperature sensor offers a high level of accuracy and ease of
integration into electronic systems. Its analog output proportional to
temperature (in degrees Celsius) simplifies the process of data acquisition,
making it a popular choice in consumer electronics and HVAC systems.
Lastly, the DS18B20 digital temperature sensor is renowned for its
precision and digital communication interface. With its one-wire
communication protocol, the DS18B20 allows multiple sensors to be
connected to a single data line, facilitating complex temperature monitoring
systems in smart homes and industrial automation.

Measure station.
We use the SHINKO GCR-23A-A/E temperature controller is a versatile and
reliable device designed to meet the demanding requirements of various
industrial applications. Its high precision, programmable settings, and robust
features make it an essential tool for maintaining optimal temperature
conditions in complex processes. By ensuring accurate temperature control,
it helps enhance process efficiency, product quality, and operational safety.
We have an aluminum block with 4 different walls that allows us to measure
different temperatures. The colors are:
 White
 Black
 Brown
 Bare metal
First, we need to adjust the temperature with a simple display from the
measure station and wait until the temperature it’s in the value that we
want. Sometimes the station doesn’t reach the value that we are introducing
because inside has a PID control.
Measurements
We are going to measure two different temperatures 38ºC and 47ºC. It’s
important to put the sensor close to the measure station to have precise
measurements.
Multimete
IR 1651 LM35 DS18B20
Surface r temp
GM [°C] temp [°C] [°C]
[°C]
Black 46 46,8 47,4 40
White 45 47 46,9 39,1
Brown 45 44,5 47,1 39,4
Bare Metal 46 22 47,4 38,3

Temperature 47 ºC
46 45 45 46 46.84744.5 47.4
46.9 47.4
47.1
4039.1
39.4
38.3

22

Multimeter temp IR 1651 GM [°C] LM35 temp [°C] DS18B20 [°C]


[°C]

Black White Brown Bare Metal

Multimete
IR 1651 LM35 DS18B20
Surface r temp
GM [°C] temp [°C] [°C]
[°C]
Black 38 37,6 39,6 31,5
White 39 37,5 39,5 30,1
Brown 38 36,4 39,3 30,7
Bare Metal 40 20,7 39,6 30,3
Temperature 38 ºC

40 39.639.539.339.6
38 39 38 37.637.536.4
31.530.130.730.3

20.7

Multimeter temp IR 1651 GM [°C] LM35 temp [°C] DS18B20 [°C]


[°C]

Black White Brown Bare Metal


The measurements indicate that the Multimeter with thermocouple type K
and the LM35 sensor used with Arduino provide the most accurate readings.
On the other hand, the DS18B20 sensor produces the least accurate
measurements. This discrepancy may be attributed to the challenges in
positioning the DS18B20 sensor close enough to the surface faces for
precise readings, or it could be due to some internal damage within the
sensor itself.

Analyzing the temperature data across different surfaces, we observe that


the black surface registers the highest temperatures, which aligns with
expectations. This is followed by the brown surface, then the white surface,
and finally, the bare metal surface records the lowest temperatures. This
gradient in temperature readings highlights the varying thermal properties
of the surfaces under study.

Appendix:
Used code for Arduino for both sensors LM35 and DS18B20:
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2// Data wire is plugged into digital pin 2 on
the Arduino

// Setup a oneWire instance to communicate with any OneWire device


OneWire oneWire(ONE_WIRE_BUS);
// Pass oneWire reference to DallasTemperature library
DallasTemperature sensors(&oneWire);
float tempC;
int pinLM35 = 0;

void setup(void)
{
sensors.begin(); // Start up the library
Serial.begin(9600);
}

void loop(void)
{
tempC = analogRead(pinLM35);
tempC = (5.0 * tempC * 100.0)/1024.0;
Serial.print("LM35 "); Serial.print(tempC); Serial.print("\n");
sensors.requestTemperatures(); // Send the command to get
temperatures

Serial.print("ds18b20 Temperature: ");//print the temperature in


Celsius
Serial.print(sensors.getTempCByIndex(0));
Serial.print((char)176; Serial.print("C | "); )//shows degrees
character
//print the temperature in Fahrenheit
Serial.print((sensors.getTempCByIndex(0) * 9.0) / 5.0 + 32.0);
Serial.print((char)176);//shows degrees character
Serial.println("F");

delay(500);
}

Circuits to connect LM35 and DS18B20

Gas sensor
Gas sensors are essential components in a variety of applications, including
environmental monitoring, industrial safety, and home automation,
providing the capability to detect and measure concentrations of gases in
the air. Among the numerous gas sensors available, the SKU SEN0219, MQ-
135, MQ-9, and MQ-2 are notable for their specific features and applications.
The SKU SEN0219 is a versatile sensor designed to detect a range of
gases, including carbon monoxide (CO) and methane (CH4). It is widely used
in safety systems to monitor air quality and detect harmful gas leaks,
ensuring environments remain safe for inhabitants.
The MQ-135 gas sensor is particularly effective in detecting air quality. It is
sensitive to various harmful gases such as ammonia (NH3), sulfur (S),
benzene (C6H6), smoke, and other dangerous gases. This sensor is
commonly used in air quality monitoring systems to ensure that indoor and
outdoor environments remain safe and healthy.
The MQ-9 gas sensor specializes in detecting carbon monoxide (CO) and
combustible gases like methane (CH4) and liquefied petroleum gas (LPG). Its
high sensitivity and fast response time make it suitable for industrial and
domestic safety applications, where quick detection of gas leaks is critical.
The MQ-2 gas sensor is another versatile and widely used sensor, capable
of detecting LPG, i-butane, propane, methane, alcohol, hydrogen, and
smoke. This makes it an excellent choice for gas leak detection systems,
smoke detectors, and various other applications where the presence of
combustible gases needs to be monitored.

SKU SEN0219
This sensor is based on non-dispersive infrared (NDIR) technology and has
good selectivity and oxygen-free dependency. Service life specified is up to
5 years. It integrates temperature compensation and support DAC output.
The current CO2 concentration can be read with only one digital port.
Product is easy to use and is compatible with all types of microcontrollers
and sensors.
Gravity Infrared CO2 Sensor V2.0 is a high-performance sensor that
combines the technology of infrared absorption gas detection with precision
optical circuit design, as well as sophisticated circuit design. It has
characteristics such as high sensitivity, high resolution, low power
consumption, fast response, anti-water vapor interference, no poisoning,
high stability, and long life.
This sensor is directly compatible with the DFRobot Arduino IO expansion
board thanks to its external DFRobot Gravity interface. This simplifies the
use of the sensor as it is plug-and-play and no additional wiring required.
This sensor could be widely used in HVAC, indoor air quality monitoring,
industrial process and security protection monitoring, agriculture, and
animal husbandry production process monitoring, etc.
Specifications
 Gas Detection: Carbon Dioxide (CO2)
 Operating Voltage: 4.5 ~ 5.5V DC
 Average Current: <60mA @ 5V
 Peak Current: 150mA @ 5V
 Output Signal: Analog output (0.4 ~ 2V)
 Measuring Range: 0 ~ 5000ppm
 Accuracy: ± (50ppm + 3% reading)
 Preheating Time: 3min
 Response Time: 120s
 Operating Temperature: 0 ~ 50 Ԩ
 Operating Humidity: 0 ~ 95% RH (no condensation)
Sensor calibration
It’s necessary to calibrate before use it. There are two different methods to
do it.
 Manual zero calibration

Short circuit the HD and GND of the sensor to calibrate it. It always needs
to last for over 7 seconds at a low level. Make sure that the sensor runs
stably for over 20 minutes at a concentration of 400ppm before the
calibration.

 Automatic zero calibration

The automatic calibration function means that the sensor will


intelligently determine the zero point according to the ambient CO2
concentration and automatically calibrate it after a period of continuous
operation. The calibration starts from power-on and is performed once
every 24 hours. The zero point for automatic calibration is 400 ppm. This
calibration is suitable for office and home environment.

/***************************************************
Infrared CO2 Sensor range : 400-4980ppm
* ****************************************************
This example The sensors detect CO2
@author qsjhyy([email protected])
@version V2.0
@date 2021-8-17

GNU Lesser General Public License.


See <http://www.gnu.org/licenses/> for details.
All above must be included in any redistribution
* ****************************************************/
/*
* The Correspondence Table of AVR Series Arduino Interrupt Pins And
Terminal Numbers
*------------
* | | DigitalPin | 2 | 3 | |
* | Uno, Nano, Mini, other 328-based
|--------------------------------------------|
* | | Interrupt No | 0 | 1 | |
*
|-------------------------------------------------------------------
------------------|
* | | Pin | 2 | 3 | 21 | 20 | 19 | 18 |
* | Mega2560 |--------------------------------------------|
* | | Interrupt No | 0 | 1 | 2 | 3 | 4 | 5 |
*
|-------------------------------------------------------------------
------------------|
* | | Pin | 3 | 2 | 0 | 1 | 7 | |
* | Leonardo, other 32u4-based
|--------------------------------------------|
* | | Interrupt No | 0 | 1 | 2 | 3 | 4 | |
*
|-------------------------------------------------------------------
-------------------
*
* This example uses UNO to demonstrate.
* If you want to use other master controls, please configure the
following two lines
*/
#define sensorIn 2 // Sensor PWM interface
#define interruptNumber 0 // interrupt number

unsigned long pwm_high_start_ticks=0, pwm_high_end_ticks=0;


float pwm_high_val=0, pwm_low_val=0;
volatile uint8_t flag=0;

void interrupt_rising()
{
pwm_high_start_ticks = micros(); // store the current micros() value
if(2 == flag){
flag = 4;
pwm_low_val = pwm_high_start_ticks - pwm_high_end_ticks;
}else{
flag = 1;
}

attachInterrupt(interruptNumber, interrupt_falling, FALLING);


}

void interrupt_falling()
{
pwm_high_end_ticks = micros(); // store the current micros() value
if(1 == flag){
flag = 2;
pwm_high_val = pwm_high_end_ticks - pwm_high_start_ticks;
}

attachInterrupt(interruptNumber, interrupt_rising, RISING);


}

void setup() {
Serial.begin(115200);
pinMode(sensorIn, INPUT);
attachInterrupt(interruptNumber, interrupt_rising, RISING);
}

void loop() {
if(flag == 4){
flag = 1;
float pwm_high_val_ms = (pwm_high_val * 1000) / (pwm_low_val +
pwm_high_val);

if (pwm_high_val_ms < 0.01){


Serial.println("Fault");
}
else if (pwm_high_val_ms < 80.00){
Serial.println("preheating");
}
else if (pwm_high_val_ms < 998.00){
float concentration = (pwm_high_val_ms - 2) * 5;
// Print pwm_high_val_ms
Serial.print("pwm_high_val_ms:");
Serial.print(pwm_high_val_ms);
Serial.println("ms");
//Print CO2 concentration
Serial.print(concentration);
Serial.println("ppm");
}else{
Serial.println("Beyond the maximum range :398~4980ppm");
}
Serial.println();
}
}

https://www.arduitronics.com/product/5458/gravity-pwm-infrared-carbon-
dioxide-sensor-400-5000-ppm-%E0%B9%81%E0%B8%97%E0%B9%89-
dfrobot

Measurements:
 Level CO2 in the room.
Name 1 2 3 4 5 6 7 8 9
pwm_high_val 102,3 102,1 102,1 101,9 101, 101, 101, 101, 101,
_ms 9 9 5 5 92 9 88 85 82
503,9 500,9 500,9 499,9 499, 499, 499, 499, 499,
ppm 4 5 2 1 89 87 85 83 81

Level of CO2 in the room


505
504
pwm_high_val_ms

503
502
501
500
499
498
497
101.7 101.8 101.9 102 102.1 102.2 102.3 102.4 102.5
ppm

 Human Breath Measurements


Name 1 2 3 4 5
pwm_high_val 953,9
_ms 979,48 972,91 966,73 960,36 8
4854,5 4791,7 4759,
ppm 4887,4 3 4823,67 8 92
6 7 8 9 10 11
914,5
947,81 941,24 935,67 928,21
922,13 7
4590,5 4557,
4729,05 4696,18 4665,3 4620,47 6 76

Human Breath - C02


5000
4900
pwm_high_val_ms

4800
4700
4600
4500
4400
4300
910 920 930 940 950 960 970 980 990
ppm

MQ135
Sensitive material of MQ135 gas sensor is SnO2, which with lower conductivity in
clean air. When target pollution gas exists, the sensor’s conductivity gets higher
along with the gas concentration rising. Users can convert the change of
conductivity to correspond output signal of gas concentration through a simple
circuit. MQ135 gas sensor has high sensitivity to ammonia gas, sulfide, benzene
series steam, also can monitor smoke and other toxic gases well. It can detect kinds
of toxic gases and is a kind of low-cost sensor for kinds of applications.
Specifications

● Operating Voltage 2.5-5.0V


● Detecting Concentration 10ppm-300ppm for NH3, 10ppm-1000ppm for
Benzene, 10ppm-300ppm for Alcohol
● Load Resistance Adjustable
● Heater Resistance 33Ω ± 5%
● Heater Consumption less than 800mW
● Operating Temperature -10 to 45°C
● Gas detection: NH3, Nox, Alcohol, Benzene, Smoke, CO2 etc.

Calibration

In principle, MQ-135’s internal sensor resistor RS and external load resistor RL forms
a voltage divider. In the datasheet we can see that the sensor resistor has a value of
30KΩ-200KΩ (100ppm NH3). And, as pointed on the log–log plot, RS in fresh air
(under certain temperature and humidity) will be a constant value. The main part of
the calibration is to calculate the RO by sampling and averaging the readings when
the gas sensor is placed in fresh air. Once the RO is derived, Rs value can be
calculated.

Used code.

int sensorValue;
int digitalValue;

void setup()
{
Serial.begin(9600); // sets the serial port to 9600
pinMode(13, OUTPUT);
pinMode(2, INPUT);
}

void loop()
{
sensorValue = analogRead(0); // read analog input pin 0
digitalValue = digitalRead(2);
if (sensorValue > 400)
{
digitalWrite(13, HIGH);
}
else
digitalWrite(13, LOW);
Serial.println(sensorValue, DEC); // prints the value read
Serial.println(digitalValue, DEC);
delay(1000); // wait 100ms for next reading
}

Measurements

We can appreciate 3 different points of measurements.

The first values are associated with alcohol vapors. When the graph goes up it’s
because we started to use gas from a lighter. Finally, the last values are from a fire
also from the lighter.

Numbe
1 2 3 4 5 6 7 8
r
Value 125 123 126 128 123 122 141 223
Numbe
9 10 11 12 13 14 15 16
r
Value 252 304 311 300 279 264 242 230
MQ-135 Measures
350
300

250
PPM Valie

200

150
100
50

0
0 2 4 6 8 10 12 14 16 18

Nº values

MQ-9
The MQ-9 gas sensor is a versatile and reliable sensor designed to detect
carbon monoxide (CO) and combustible gases such as methane (CH4) and
liquefied petroleum gas (LPG). It operates by changing its resistance in the
presence of these gases, providing an analog output that corresponds to the
gas concentration. The MQ-9 is known for its high sensitivity, fast response
time, and durability, making it suitable for various applications, including
industrial safety systems, gas leak detection, and home safety devices. It
can be easily integrated with microcontrollers and other electronic systems,
allowing for the development of custom gas monitoring solutions. The
sensor's robust design ensures accurate and stable performance in diverse
environmental conditions.
Specifications

● Gas Detection: CO, CH4, LPG, C3H6


● Supply Voltage: DC (5.0±0.1)V
● Heater consumption: ≤350 mW
● Preheating Time: 1min
● Response Time: T90 < 120s
● Operating Temperature: -10℃ to +50℃
● Operating Humidity: 0 - 95% RH (no condensation)
● Detecting range:
o 20 ppm-2000 ppm CO
o 500 ppm-10000 ppm CH4
o 500 ppm-10000 ppm LPG
● Resolution: >5 ppm (CO)
● Preheat time: at least 48 h

Calibration

MQ9 sensor needs 24-48 hours of preheating time. Connect the power
supply and leave for the required time until it gets ready. This sensor
measures the gas concentration based on resistance ratio. This ratio
includes R0 (sensor resistance in 1000ppm concentration of LPG) and Rs
(Internal resistance of the sensor which changes by gas concentration). In
clean air, after preheating, turn on the sensor with microcontroller and wait
for about 15 minutes until R0 reaches a fixed value. Measure the sensor
voltage and according to RL restance calculate Rs. Then according to the
table available in the datasheet, R0 can be found.

Used code.

void setup() {
Serial.begin(9600);
}
void loop() {
float sensor_volt;
float RS_air; // Rs in clean air
float R0; // R0 in 1000 ppm LPG
float sensorValue;
//Average
for(int x = 0 ; x < 100 ; x++)
{
sensorValue = sensorValue + analogRead(A0);
}
sensorValue = sensorValue/100.0;
//-----------------------------------------------/
sensor_volt = (sensorValue/1024)*5.0;
RS_air = (5.0-sensor_volt)/sensor_volt; // Depend on RL on yor
module
R0 = RS_air/9.9; // According to MQ9 datasheet table
Serial.print("sensor_volt = ");
Serial.print(sensor_volt);
Serial.println("V");
Serial.print("R0 = ");
Serial.println(R0);
delay(1000);
}

Measurements
We are going to do the same experiment with as the MQ135. The alcohol,
the gas and finally the flame from the lighter.
No. 1 2 3 4 5 6 7 8 9 10
Valu
e 230 234 228 230 228 228 222 228 225 480
11 12 13 14 15 16 17 18 19 20 21
490 423 420 460 511 630 760 818 835 465 352

MQ-9 Measures
900
800
700
600
500
400
300
200
100
0
0 5 10 15 20 25
MQ2
The MQ-2 is a gas sensor module widely used for detecting various types of
gases in the atmosphere. It operates based on the principle of
semiconductor conductivity, where the resistance of its sensing element
changes when it comes in contact with specific gases. This module is
particularly sensitive to gases such as LPG, propane, methane, alcohol,
hydrogen, and smoke. It's commonly employed in gas leakage detection
systems, industrial safety, fire detection, and environmental monitoring
applications. The MQ-2 module typically provides analog output
corresponding to the concentration of the detected gas, making it suitable
for interfacing with microcontrollers and embedded systems for further
processing and decision-making.

Specifications

● Operating voltage 5V
● Load resistance 20 KΩ
● Heater resistance 33Ω ± 5%
● Heating consumption <800mw
● Sensing Resistance 10 KΩ – 60 KΩ
● Concentration Range 200 – 10000ppm
● Preheat Time Over 24 hour
● Detecting gasses: LPG, smoke, alcohol, propane, hydrogen,
methane, carbon monoxide

Calibration

Because the MQ2 is a heater-driven sensor, the calibration of the sensor


may drift if it is left in storage for an extended period of time. When first
used after a long period of storage (a month or more), the sensor must be
fully warmed up for 24-48 hours to ensure maximum accuracy. If the sensor
has recently been used, it will only take 5-10 minutes to fully warm up.
During the warm-up period, the sensor typically reads high and gradually
decreases until it stabilizes.

#define MQ2pin 0
float sensorValue; //variable to store sensor value

void setup() {
Serial.begin(9600); // sets the serial port to 9600
Serial.println("MQ2 warming up!");
delay(20000); // allow the MQ2 to warm up
}

void loop() {
sensorValue = analogRead(MQ2pin); // read analog input pin 0

Serial.print("Sensor Value: ");


Serial.println(sensorValue);

delay(2000); // wait 2s for next reading


}

Measurements
In this case, the sensor reacts with the gas from the lighter.
No. 1 2 3 4 5 6 7 8 9 10
Valu
e 200 203 203 202 435 563 604 599 600 602

MQ2 Measures
700
600
500
400
adc

300
200
100
0
0 2 4 6 8 10 12
measure
Conclusion
There exist several gas sensors available, although they typically require
calibration, which involves a minimum of 48 hours of temperature
preparation in the environment. In this experiment, calibration was not
completed, so the recorded gas concentrations may not be accurate.
However, despite this limitation, these sensors can still serve as effective
detection units, particularly for volatile compounds.
Certain sensors are unable to distinguish between types of gases; instead,
they simply detect the presence of gas or gases. This functionality allows us
to employ them for applications where a threshold-based triggering
mechanism is suitable.

Environmental measurements
Environmental measurement sensors are crucial for monitoring and
assessing various environmental conditions. These sensors help detect and
quantify parameters such as gas concentrations, particulate matter,
temperature, humidity, and pressure. By providing accurate and real-time
data, these sensors play a vital role in ensuring environmental safety,
maintaining air quality, and supporting various applications in industrial,
commercial, and residential settings.
The SKU SEN0219 is a versatile sensor designed to detect a range of
gases, including carbon monoxide (CO) and methane (CH4). It is widely used
in safety systems to monitor air quality and detect harmful gas leaks,
ensuring environments remain safe for inhabitants.
The Nova SDS011 is designed to measure the concentration of PM2.5 and
PM10 particles in the air. It utilizes laser scattering principles to provide
accurate and real-time data on air quality.
The BMP280 is a high-precision sensor used to measure barometric
pressure and temperature. It is known for its low power consumption and
high accuracy, making it suitable for various environmental monitoring
applications.
The SHT31 offers precise measurements of temperature and humidity. It
has high accuracy and a wide measurement range, making it suitable for
various applications, including HVAC systems and environmental monitoring.
The HDC1080 is a low-power, high-accuracy sensor for measuring
temperature and humidity. Its small form factor and reliable data make it
ideal for smart home devices, weather stations, and industrial control.
The AM1011A is designed to provide accurate readings of temperature and
humidity, with a fast response time and stable performance, making it
suitable for environmental monitoring and home automation.
This diaphragm pump is used to create suction and pressure, making it
suitable for use with various sensors that require a controlled airflow. It
supports gas sampling and environmental testing applications.
Optical measurements
Optical measurement sensors play a critical role in detecting and
quantifying light intensity, colors, and other optical properties. These
sensors are utilized in various applications such as ambient light sensing,
color detection, flame detection, and proximity sensing.
The BH1750 sensor is designed to measure ambient light intensity. It
provides accurate lux measurements and operates efficiently in various
lighting conditions.
The APDS-9960 sensor integrates proximity detection, ambient light
sensing, and gesture recognition capabilities. It offers accurate proximity
detection and gesture recognition, making it suitable for touchless user
interfaces and proximity sensing applications.
The GUVA-S12SD sensor is designed to measure UV radiation levels. It
detects ultraviolet light in the UVA spectrum and provides output voltage
proportional to the UV intensity.
The TCS34725 sensor is capable of detecting and measuring colors. It
integrates RGB color filters and photodiodes to accurately determine color
values under various lighting conditions.
The IR 940 nm flame detector sensor is designed to detect the presence
of flames based on infrared radiation emitted by flames. It is commonly
used in fire detection and safety systems.
The IR LED emits infrared light at a wavelength of 940nm. It operates at a
voltage range of 1.2V to 1.4V and is commonly used in applications such as
remote controls, IR communication, and proximity sensors.
The GL5528 photoresistor changes its resistance in response to light
intensity. It is used to detect changes in ambient light levels and is
commonly employed in light-dependent circuits.
The RGB LED features red, green, and blue light emitting diodes in a single
package. It has a common cathode configuration and can produce a wide
range of colors by varying the intensity of each LED.
TCS34725 RGB Color Sensor
The TCS3472 device provides a digital return of red, green, blue (RGB), and
clear light sensing values. An IR blocking filter, integrated on-chip and
localized to the color sensing photodiodes, minimizes the IR spectral
component of the incoming light and allows color measurements to be made
accurately. The high sensitivity, wide dynamic range, and IR blocking filter
make the TCS3472 an ideal color sensor solution for use under varying
lighting conditions and through attenuating materials. The TCS3472 color
sensor has a wide range of applications including RGB LED backlight control,
solid-state lighting, health/fitness products, industrial process controls and
medical diagnostic equipment. In addition, the IR blocking filter enables the
TCS3472 to perform ambient light sensing (ALS). Ambient light sensing is
widely used in display-based products such as cell phones, notebooks, and
TVs to sense the lighting environment and enable automatic display
brightness for optimal viewing and power savings. The TCS3472, itself, can
enter a lower power wait state between light sensing measurements to
further reduce the average power consumption.

Specifications

● Supply Voltage: DC 2.7-3.6 V


● Supply Current: 235-330 μA (wait – 65; sleep 2.5-10)
● Operating Temperature: -30℃ to +70℃
● Operating Humidity: 0 - 95% RH (no condensation)
● Measuring Range: 400 - 5000 ppm
● Resolution: 1ppm
● Accuracy: ±(50ppm+5% reading)
● Dimension: 2x2 mm dual flat

Used code
#include <Wire.h>
#include "Adafruit_TCS34725.h"

// Pick analog outputs, for the UNO these three work well
// use ~560 ohm resistor between Red & Blue, ~1K for green (its
brighter)
#define redpin 3
#define greenpin 5
#define bluepin 6
// for a common anode LED, connect the common pin to +5V
// for common cathode, connect the common to ground

// set to false if using a common cathode LED


#define commonAnode true

// our RGB -> eye-recognized gamma color


byte gammatable[256];

Adafruit_TCS34725 tcs =
Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_4X);

void setup() {
Serial.begin(9600);
//Serial.println("Color View Test!");

if (tcs.begin()) {
//Serial.println("Found sensor");
} else {
Serial.println("No TCS34725 found ... check your connections");
while (1); // halt!
}

// use these three pins to drive an LED

pinMode(redpin, OUTPUT);
pinMode(greenpin, OUTPUT);
pinMode(bluepin, OUTPUT);

// thanks PhilB for this gamma table!


// it helps convert RGB colors to what humans see
for (int i = 0; i < 256; i++) {
float x = i;
x /= 255;
x = pow(x, 2.5);
x *= 255;

if (commonAnode) {
gammatable[i] = 255 - x;
} else {
gammatable[i] = x;
}
//Serial.println(gammatable[i]);
}
}

void loop() {
float red, green, blue;
tcs.setInterrupt(false); // turn on LED
delay(60); // takes 50ms to read
tcs.getRGB(&red, &green, &blue);
tcs.setInterrupt(true); // turn off LED

Serial.print("R:\t"); Serial.print(int(red));
Serial.print("\tG:\t"); Serial.print(int(green));
Serial.print("\tB:\t"); Serial.print(int(blue));

Serial.print("\n");

analogWrite(redpin, gammatable[(int)red]);
analogWrite(greenpin, gammatable[(int)green]);
analogWrite(bluepin, gammatable[(int)blue]);

Measurements
In this case, we will try to measure 4 different objects.
Silver Ball Red Ball
RED GREEN BLUE RED GREEN BLUE
1200 1150 1100 1350 400 380
1185 1135 1085 1365 410 385
1215 1165 1115 1340 395 375
Brown Box Green notebook
RED GREEN BLUE RED GREEN BLUE
800 820 780 150 920 500
790 810 775 155 930 505
805 825 785 145 910 520

Infra-red sensor
Sure, here's a description in English of an Infrared (IR) Sensor Module with
Arduino:
The Infrared (IR) Sensor Module is a versatile component that enables the
detection of infrared radiation emitted by objects. When paired with an
Arduino microcontroller, this module becomes a powerful tool for various
applications, including proximity sensing, object detection, and remote-
control systems.
The module consists of an IR transmitter and an IR receiver, both of which
work together to detect infrared signals. The IR transmitter emits infrared
light, while the IR receiver detects any reflected or emitted infrared
radiation. When an object is within the detection range of the sensor, it
reflects or emits infrared light, which is then captured by the IR receiver.
One of the key features of the IR Sensor Module is its ability to detect
objects without physical contact, making it ideal for applications where non-
intrusive sensing is required. Additionally, it can distinguish between
different materials based on their infrared reflective properties, allowing for
more precise detection.
When interfaced with an Arduino, the IR Sensor Module can be easily
integrated into electronic projects. By reading the analog or digital output
from the sensor, the Arduino can determine the presence or absence of
objects, as well as their distance or position relative to the sensor.
Overall, the Infrared Sensor Module with Arduino offers a simple yet
effective solution for detecting infrared radiation and integrating it into
various electronic projects and systems. Whether used for proximity
sensing, obstacle detection, or remote-control applications, this module
provides reliable performance and versatility.

Used code.

int IRSensor = 9; // connect ir sensor module to Arduino pin 9


int LED = 13; // conect LED to Arduino pin 13

void setup()

Serial.begin(115200); // Init Serila at 115200 Baud


Serial.println("Serial Working"); // Test to check if serial is
working
pinMode(IRSensor, INPUT); // IR Sensor pin INPUT
pinMode(LED, OUTPUT); // LED Pin Output

void loop()

int sensorStatus = digitalRead(IRSensor); // Set the GPIO as Input

if (sensorStatus == 1) // Check if the pin high or not

// if the pin is high turn off the onboard Led

digitalWrite(LED, LOW); // LED LOW

Serial.println("Motion Ended!"); // print Motion Detected!


}
else
{
//else turn on the onboard LED
digitalWrite(LED, HIGH); // LED High
Serial.println("Motion Detected!"); // print Motion Ended!

}
}

BH1750 Ambient Light Sensor


BH1750FVI Is a Digital Light sensor, which is a digital Ambient Light Sensor
IC for I2C bus interface. This IC is the most suitable to obtain the ambient
light data for adjusting LCD and Keypad backlight power of Mobile phone. It
is possible to detect wide range at High resolution. (1 - 65535 lx ).
this sensor has some advantages such like:
1) Illuminance to Digital Converter
2) Wide range and High resolution. (1 - 65535 lx)
3) Low Current by power down function
4) 50Hz / 60Hz Light noise reject-function
5) I2C bus Interface (f / s Mode Support)
6) It is possible to select 2 types of I2C slave-address.
7) It is possible to detect min. 0.11 lx, max. 100000 lx by using this
function.
Used code.
/*
Example of BH1750 library usage. This example initialises the
BH1750 object using the default high resolution continuous mode and
then makes a light level reading every second.
*/

#include <Wire.h>
#include <BH1750.h>

BH1750 lightMeter;

void setup(){
Serial.begin(9600);

// Initialize the I2C bus (BH1750 library doesn't do this


automatically)
Wire.begin();
Wire.begin(D2, D1);
lightMeter.begin();
Serial.println(F("BH1750 Test begin"));
}

void loop() {
float lux = lightMeter.readLightLevel();
Serial.print("Light: ");
Serial.print(lux);
Serial.println(" lx");
delay(1000);
}

Measurement
Ambient Light Phone torch Covered
Number Lux Number Lux Number Lux
1 350 1 1200 1 5
2 340 2 1285 2 4
3 355 3 1210 3 6
4 345 4 1190 4 5

In these experiments, we concluded that optical sensors could be used for


movement detection similar to IR sensors in a wide range of applications. It
is important to calibrate the sensors to achieve the required sensitivity. We
also used universal RG sensors that can detect colors. Not all measured
objects are ideal due to the possibility of light diffraction, as demonstrated
with a glass bottle, so proper data interpretation is essential. The last sensor
used was for detecting ambient light, and again, it is crucial to understand
what to look for in the measurements and to select the appropriate sensor.

Mechanical measurements
Mechanical measurement sensors and modules are essential for monitoring
physical parameters such as pressure, acceleration, and strain. These
sensors play a crucial role in various applications including robotics,
structural health monitoring, and motion detection.
The BMP280 sensor is designed to measure barometric pressure and
temperature with high accuracy. It provides precise pressure readings and is
commonly used in weather monitoring stations and altimeters.
The ADXL345 accelerometer is capable of measuring acceleration along
three axes (X, Y, Z). It offers high resolution and low power consumption,
making it suitable for applications such as tilt sensing, vibration monitoring,
and motion detection.
The GY521 module integrates both a gyroscope and an accelerometer,
allowing for measurement of angular velocity and acceleration. It provides
accurate motion sensing capabilities and is commonly used in UAVs, drones,
and motion control systems.
The SEN0160 strain gauge sensor, combined with a 10N strain gauge, is
used to measure mechanical strain and force. It detects changes in
resistance due to applied force, enabling the measurement of load, stress,
and deformation in structures and materials.

ADXL345 Accelerometer Sensor

The ADXL345 is a small, low-power, 3-axis accelerometer with high-


resolution (13-bit) measurement up to ±16g. It is designed for use in
applications requiring high performance and low power consumption, such
as mobile devices, gaming devices, and fitness equipment.

Advantages of the ADXL345 Sensor:

1. High Resolution
2. Wide Range
3. Low Power Consumption
4. Versatile Communication Interfaces
5. Embedded Functions
6. Flexible Data Rates
7. Compact Size
8. Interrupt Support
Used code

/* *****************************************
* ADXL345_Calibration
* ADXL345 Hook Up Guide Calibration Example
*
* Utilizing Sparkfun's ADXL345 Library
* Bildr ADXL345 source file modified to support
* both I2C and SPI Communication
*
* E.Robert @ SparkFun Electronics
* Created: Jul 13, 2016
* Updated: Sep 13, 2016
*
* Development Environment Specifics:
* Arduino 1.6.11
*
* Hardware Specifications:
* SparkFun ADXL345
* Arduino Uno
* *****************************************/

#include <SparkFun_ADXL345.h>

/*********** COMMUNICATION SELECTION ***********/


/* Comment Out The One You Are Not Using */
//ADXL345 adxl = ADXL345(10); // USE FOR SPI COMMUNICATION,
ADXL345(CS_PIN);
ADXL345 adxl = ADXL345(); // USE FOR I2C COMMUNICATION

/****************** VARIABLES ******************/


/* */
int AccelMinX = 0;
int AccelMaxX = 0;
int AccelMinY = 0;
int AccelMaxY = 0;
int AccelMinZ = 0;
int AccelMaxZ = 0;

int accX = 0;
int accY = 0;
int accZ = 0;

/************** DEFINED VARIABLES **************/


/* */
#define offsetX -123 // OFFSET values
#define offsetY -16
#define offsetZ -10

#define gainX 133 // GAIN factors


#define gainY 261
#define gainZ 248

/******************** SETUP ********************/


/* Configure ADXL345 Settings */
void setup()
{
Serial.begin(9600); // Start the serial terminal
Serial.println("SparkFun ADXL345 Accelerometer Breakout Calibration");
Serial.println();

adxl.powerOn(); // Power on the ADXL345

adxl.setRangeSetting(2); // Give the range settings


// Accepted values are 2g, 4g, 8g or 16g
// Higher Values = Wider Measurement Range
// Lower Values = Greater Sensitivity

adxl.setSpiBit(0); // Configure the device: 4 wire SPI mode = '0'


or 3 wire SPI mode = 1
// Default: Set to 1
// SPI pins on the ATMega328: 11, 12 and 13 as
reference in SPI Library
}

/****************** MAIN CODE ******************/


/* Accelerometer Readings and Min/Max Values */
void loop()
{
Serial.println("Send any character to display values.");
while (!Serial.available()){} // Waiting for character to be sent to
Serial
Serial.println();

// Get the Accelerometer Readings


int x,y,z; // init variables hold results
adxl.readAccel(&x, &y, &z); // Read the accelerometer values and
store in variables x,y,z

if(x < AccelMinX) AccelMinX = x;


if(x > AccelMaxX) AccelMaxX = x;

if(y < AccelMinY) AccelMinY = y;


if(y > AccelMaxY) AccelMaxY = y;

if(z < AccelMinZ) AccelMinZ = z;


if(z > AccelMaxZ) AccelMaxZ = z;

Serial.print("Accel Minimums: "); Serial.print(AccelMinX); Serial.print("


");Serial.print(AccelMinY); Serial.print(" "); Serial.print(AccelMinZ);
Serial.println();
Serial.print("Accel Maximums: "); Serial.print(AccelMaxX); Serial.print("
");Serial.print(AccelMaxY); Serial.print(" "); Serial.print(AccelMaxZ);
Serial.println();
Serial.println();

/* Note: Must perform offset and gain calculations prior to seeing


updated results
/ Refer to SparkFun ADXL345 Hook Up Guide:
https://learn.sparkfun.com/tutorials/adxl345-hookup-guide
/ offsetAxis = 0.5 * (Acel+1g + Accel-1g)
/ gainAxis = 0.5 * ((Acel+1g - Accel-1g)/1g) */

// UNCOMMENT SECTION TO VIEW NEW VALUES


//accX = (x - offsetX)/gainX; // Calculating New Values for X, Y and Z
//accY = (y - offsetY)/gainY;
//accZ = (z - offsetZ)/gainZ;

//Serial.print("New Calibrated Values: "); Serial.print(accX); Serial.print("


"); Serial.print(accY); Serial.print(" "); Serial.print(accZ);
//Serial.println();

while (Serial.available())
{
Serial.read(); // Clear buffer
}
}

Minimu Minimu Minimu Maximu Maximu Maximu


Mode mX mY mZ mX mY mZ
STANDBY 0 -18 0 24 4 300
MOTOR
BOCA
LADO -88 -42 0 128 64 488
MOTOR
BOCA
ARRIBA -150 -174 -468 210 186 511
AMBOS -210 -204 -468 270 192 511

The data collected from the ADXL345 accelerometer under various


operational modes provides insightful information on the range of
accelerations experienced. In STANDBY mode, the sensor shows minimal
movement, with acceleration values close to zero, indicating a stable state.
The MOTOR BOCA LADO mode exhibits moderate movement, with a wider
range of acceleration values, suggesting activity likely involving lateral or
side movements. The MOTOR BOCA ARRIBA mode displays significant
movement, particularly in the Z-axis, indicating substantial vertical or
upward movement. The AMBOS mode demonstrates the widest range of
acceleration values across all axes, indicating a combination of movements
that include both lateral and vertical directions. Overall, the ADXL345 sensor
effectively captures the variations in acceleration across different modes,
highlighting its capability to monitor and distinguish between different types
of motion and activity.

HX711 Load Cell Amplifier

The HX711 is a precision 24-bit analog-to-digital converter (ADC) designed


for weighing scales and industrial control applications to interface directly
with a bridge sensor. It is a popular choice for applications involving load
cells due to its high accuracy and ease of use.

Advantages of the HX711 Sensor:

1. High Resolution
2. Low Noise
3. Built-in Gain Amplifier
4. Simple Interface
5. Low Cost
6. High Stability
7. Wide Operating Voltage Range
8. Power Down Mode

Used code:

#include <DFRobot_HX711.h>

/*!
* @fn DFRobot_HX711
* @brief Constructor
* @param pin_din Analog data pins
* @param pin_slk Analog data pins
*/
DFRobot_HX711 MyScale(A4, A5);

void setup() {
Serial.begin(9600);
}

void loop() {
// Get the weight of the object
Serial.print(MyScale.readWeight(), 1);
Serial.println(" g");
delay(200);
}
Measurements:

Timestamp Weight (g)


19:43:22.768 35.7
19:43:25.116 35.7
19:43:27.427 35.7
19:43:29.733 35.7
19:43:32.038 35.1
19:43:34.365 35.4
19:43:36.816 35.6
19:43:39.018 35.6
19:43:41.343 35.6
19:43:43.655 37.6
19:43:45.977 35.4

Conclusion:

The measurements obtained using the HX711 sensor show a consistent


weight reading with minor fluctuations. Most readings are around 35.6 g,
indicating the sensor's reliability in capturing stable weight measurements.
The slight variations observed, including a spike to 37.6 g, could be due to
minor disturbances or inaccuracies in the load cell setup. Overall, the HX711
demonstrates its capability to provide precise and repeatable weight
measurements, making it suitable for applications requiring accurate load
sensing.

High frequency
High-frequency measurement sensors and modules are designed to detect
and measure signals or phenomena occurring at high frequencies. These
sensors are vital components in applications such as radar systems,
proximity sensing, and ultrasonic ranging.
The MH-ET HB100 X sensor operates in the microwave frequency range
and is used for motion detection. It emits microwave signals and detects
changes in their frequency caused by moving objects, making it suitable for
motion detection in security systems and automatic door openers.
The VL53L0X sensor utilizes Time-of-Flight (ToF) technology to measure
distance accurately. It emits infrared laser pulses and measures the time
taken for the pulses to reflect back from the target, enabling precise
distance measurements in various applications such as robotics, drones, and
gesture recognition.
The HC-SR04 sensor uses ultrasonic waves to measure distance. It emits
ultrasonic pulses and calculates the time taken for the pulses to bounce
back from obstacles, enabling accurate distance measurements. It is
commonly used in robotics, parking assistance systems, and object
detection.
The RCWL-0516 sensor is a microwave radar module capable of detecting
motion based on the Doppler effect. It emits microwave signals and detects
changes in frequency caused by moving objects, making it suitable for
motion detection in security systems, automatic lighting, and smart home
devices.

HC-SR04 Ultrasonic Sensor


The HC-SR04 is a versatile ultrasonic distance measuring module designed
for easy interfacing with microcontrollers. This sensor is ideal for
applications requiring accurate distance measurement and object detection,
such as robotics, automation systems, and obstacle avoidance in
autonomous vehicles. The HC-SR04 operates by emitting an ultrasonic pulse
and measuring the time it takes for the echo to return, providing precise
distance data.

Advantages of the HC-SR04 Ultrasonic Sensor:


1. Accurate Distance Measurement
2. High Resolution
3. Wide Operating Voltage Range
4. Low Power Consumption
5. Simple Trigger and Echo Interface
6. Temperature Compensation
7. Compact Design
8. Wide Angle of Coverage

Technical Specifications:

- Operating Voltage: 3.3V to 5V


-Current Consumption: 15 mA (typical)
- Ultrasonic Frequency: 40 kHz
- Max Range: 400 cm
- Min Range: 2 cm
- Measurement Angle: 15 degrees
- Resolution: 0.3 cm
- Dimensions: 45mm x 20mm x 15mm

Used code.
/*

Ultrasonic Sensor HC-SR04 and Arduino Tutorial

by Dejan Nedelkovski,
www.HowToMechatronics.com

*/

#include <NewPing.h>

#define TRIGGER_PIN 9
#define ECHO_PIN 10
#define MAX_DISTANCE 400 // Maximum distance we want to measure (in
centimeters).

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup


of pins and maximum distance.

void setup() {
Serial.begin(9600);
}

void loop() {
delay(50); // Wait 50ms between pings (about 20
pings/sec). 29ms should be the shortest delay between pings.

int distance = sonar.ping_cm(); // Send ping, get distance in cm


and print result (0 = outside set distance range)

Serial.print("Distance: ");
Serial.print(distance);
Serial.println("cm");
}
Measurements:
Measurement by Measurement by HC-
Ruler (cm) SR04 (cm)
5 4,5
10 8
15 12
20 20,5
25 24
30 28
35 34
40 40,4
45 45
50 50,3

The measurements obtained from the HC-SR04 Ultrasonic Sensor closely


match the measurements taken with a ruler across the tested distances.
This indicates the sensor's reliability and accuracy in measuring distances,
making it a suitable choice for applications requiring cost-effective and
straightforward distance sensing solutions.

VL53L0X Time-of-Flight Distance Sensor

The VL53L0X is an advanced Time-of-Flight (ToF) laser-ranging sensor,


capable of accurate distance measurements over a wide range of operating
conditions. This sensor employs state-of-the-art laser technology to provide
precise distance data, making it an ideal choice for applications such as
gesture recognition, robotics, and proximity sensing in electronic devices.
Advantages:
- High Accuracy
- Wide Measurement Range (30 mm to 2 meters)
- Fast Measurement Speed
- Multi-Target Detection
- User-Friendly Interface (I2C)
- Compact Form Factor
- Low Power Consumption
- Integrated Ambient Light Rejection

Technical Specifications:
- Operating Voltage: 2.6V to 3.5V
- Current Consumption: 10 mA (typical)
- Measurement Range: 30 mm to 2000 mm
- Measurement Time: < 30 ms
- Laser Wavelength: 940 nm
- Field of View: 25 degrees
- Interface: I2C (up to 400 kHz)
- Dimensions: 4.4mm x 2.4mm x 1.0mm (L x W x H)

Used code.
#include "Adafruit_VL53L0X.h"

Adafruit_VL53L0X lox = Adafruit_VL53L0X();

void setup() {
Serial.begin(115200);

// wait until serial port opens for native USB devices


while (! Serial) {
delay(1);
}

Serial.println("Adafruit VL53L0X test");


if (!lox.begin()) {
Serial.println(F("Failed to boot VL53L0X"));
while(1);
}
// power
Serial.println(F("VL53L0X API Simple Ranging example\n\n"));
}

void loop() {
VL53L0X_RangingMeasurementData_t measure;

Serial.print("Reading a measurement... ");


lox.rangingTest(&measure, false); // pass in 'true' to get debug
data printout!

if (measure.RangeStatus != 4) { // phase failures have incorrect


data
Serial.print("Distance (mm): ");
Serial.println(measure.RangeMilliMeter);
} else {
Serial.println(" out of range ");
}

delay(100);
}
Measurements:
Measurement by Measurement by
Ruler (cm) VL53L0X (cm)
5 5,5
10 10,2
15 14,6
20 18,9
25 23,5
30 32
35 36,5
40 41,3
45 44,9
50 51

The measurements obtained from the VL53L0X Time-of-Flight Distance


Sensor also closely align with the measurements taken with a ruler across
the tested distances. This demonstrates the sensor's high accuracy and
consistency in distance measurements, highlighting its suitability for
applications demanding precision and advanced features in distance
sensing.

You might also like