Sensor Reports
Sensor Reports
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
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
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
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
delay(500);
}
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.
/***************************************************
Infrared CO2 Sensor range : 400-4980ppm
* ****************************************************
This example The sensors detect CO2
@author qsjhyy([email protected])
@version V2.0
@date 2021-8-17
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;
}
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;
}
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);
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
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
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
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
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
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
#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
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
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
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!
}
pinMode(redpin, OUTPUT);
pinMode(greenpin, OUTPUT);
pinMode(bluepin, OUTPUT);
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.
void setup()
void loop()
}
}
#include <Wire.h>
#include <BH1750.h>
BH1750 lightMeter;
void setup(){
Serial.begin(9600);
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
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.
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>
int accX = 0;
int accY = 0;
int accZ = 0;
while (Serial.available())
{
Serial.read(); // Clear buffer
}
}
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:
Conclusion:
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.
Technical Specifications:
Used code.
/*
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).
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.
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
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"
void setup() {
Serial.begin(115200);
void loop() {
VL53L0X_RangingMeasurementData_t measure;
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