Introduction of MLX90614

Hello friends, I hope you all are doing great. In today's tutorial, we are gonna have a look at detailed Introduction to MLX90614. MLX90614 is a temperature measurement device works on infrared radiations. It is the best choice for such applications where we can not easily reach to measure temperature because it provides non-contact measurement of temperature. It has Infra Red radiation receptive thermopile and ASSP (Acoustics Speech and Signal Processing) on same TO-39 cascading. This temperature measuring device is surfaced with the digital Pulse width Modulation and System Managing Bus. It is used in different industries to measure and control the temperature of moving components of machines and it also used to remove the fog on the window of vehicles. In today's post, we will have a look at its structure, pinout, features, applications, etc. I will also share some links where I have interfaced it with other microcontrollers. You can also ask about it in comments, I will guide you more about it. So, let's get started with a basic Introduction to MLX90614.

Introduction to MLX90614

  • MLX90614 is a temperature measurement device works on infrared radiations. It is the best option for such applications where we can not easily reach to measure temperature because it provides non-contact measurement of temperature.
  • It has an amplifier of squat noise, Analog to Digital (ADC) converter of 17- bits and potent DSP component, all these components provides the elevated exactness and high decree of this thermometer.
  • During its fabrication, it is mounted with the 10 bit Pulse width modulation (PWM) which constantly sends out the calculated temperature in the assortment of -20 to 120 °C  by providing yield resolution of 0.14 °C.
  • It consists of two boards (chips) one is infrared radiation detector and other is ASSP which is a signal conditioner, it is for the processing of infrared sensor output. It is available in TO-39 enclosing.
  • The pinout of Pulse width Modulation can also be used as a thermal type of relay, which provides us less expensive completion in temperature observant applications such as boiling and freezing.
  • This device has two input supply choices one is 5V and other is the 3V battery. We can supply 5 volts by exterior supply.

MLX90614 Pinout & Description

  • These are the main pinout of MLX90614.
Pin# Type Parameters
Pin#1 VSS It is a ground pin.
Pin#2 SCL It is Serial Clock input for a protocol of two wire. At this pin, there is a Zener diode of 5.7V to connect it with other Bipolar transistors.
Pin#3 PWM / SDA It is digital input and output pin, the measured value of temperature can get by this pinout.
Pin#4 VDD It is an external power supply.
For further information, let's see the pinout diagram.

Features of MLX90614

  • These are some features of MLX90614.
    • It is accessible in lesser size and less costly.
    • It can be effortlessly incorporated.
    • It is obtainable in large no of temperature range such as -40 to 125 °C is used for temperature instruments and -70 to 380 °C for measurement of the different object's temperature.
    • It delivers high exactness on different temperature choices such as 0 to 50 °C.
    • It has a resolution value of 0.02°C.
    • It works on 3v and 5V temperature range.
    • It exists in single and twice over varieties.
    • For the evaluation of temperature on consistent basis System Management Bus control Pulse Width Modulation.
    • It can transform for such devices which works on 8 to 16V temperature.
    • This module also has a mode for energy saving.
    • It is offered in different suites according to the working atmosphere and applications.
    • It can easily adaptable from one state to another.

Working of MLX90614

  • Now we discuss its internal working operation with detailed.
  • It has a state machine in it's cascading which examine and govern the measured value of temperature after this procedure sends these values to output pin through pulse width modulation.
  • ASSP of this sensor adds in with the two infrared sensors. The yield of this sensor can intensify with the chopper amplifier. This output signal then strained by FIR and Infinite Impulse Response (IIR) filters to reduce the noise of the signal.
  • The IIR filter value is the anticipated output we can get it from exterior RAM.
  • On this unit there are three different cells one is for a temperature sensor and other for two infrared sensors.
  • For better understanding, it's working let's see its circuit diagram.

Applications of MLX90614

  • These are some applications of MLX90614.
    • It is used to measure the temperature of such equipment’s where a man cannot reach.
    • It is used for mobile air conditioners governor systems.
    • It is used in different buildings and industries to measure temperature.
    • It is used automobiles to confiscate the fog of windbreak.
    • It controls the temperature of no static part of machinery in industries.
    • It controls the temperature of photocopy machines and printers.
    • It also exists in home appliances to measure and control their temperature.
    • It used in medical tools.
    • It also measures body temperature.
So, friends, it was all about  MLX90614, if you have any question about it ask in comments. Thanks for reading. Take care until the next tutorial.

Introduction to BME280

Hello friends! Hope you’re well. In today’s tutorial, we’ll cover a detailed Introduction to BME280. BME280 is a digital environmental pressure, humidity, and temperature sensor mainly designed for mobile applications. This module comes with extremely compact metal-lid LGA packages. It has low power consumption (consumes only 5µA during idle and less than 1mA during measurements) and small dimensions that make it a perfect fit for battery-driven devices such as GPS, mobiles, and smartwatches. The BME280 working protocols are I2C and SPI which consist of separate pinouts. The module contains a built-in LM6260 regulator, allowing you to effortlessly use it with a 3.3V or 5V logic microcontroller or Raspberry Pi.

BME280 is used in a range of industrial projects and electronic devices and provides high performance in all applications where pressure and humidity measurement is required. From gaming controls to weather monitoring to altitude measurement, this module serves the purpose of all with high precision and accuracy. The device comes with many filtering and sampling options that can be customized to make it compatible with the scores of applications.

In today’s post, we will have a look at its pinout, features, specifications, modes, applications, etc. I will also share the information where I have interfaced with other microcontroller.

Let’s get started with an introduction to Introduction to BME280.

Where To Buy?
No.ComponentsDistributorLink To Buy
1BME280AmazonBuy Now

Introduction to BME280

  • BME280 is a digital device designed to sense pressure, humidity, and temperature. This module consists of extremely concise metal casing.
  • This device is used to measure humidity, temperature, and pressure with high accuracy and high linearity in an 8-pin metal-lid 2.5 x 2.5 x 0.93 mm³ LGA package.
  • BM230 is developed for low current consumption (3.6 µA), high EMC robustness and long-term stability.
  • This device can perfectly work with Bosch Sensortec BMP280 digital pressure sensor.
  • As it provides high performance in humidity and pressure measurement, it is used in advanced and emerging applications such as home automation, indoor navigation, health care, GPS, and a low TCO.
  • The BME280 humidity sensing part provides a fast response time for context-awareness applications and high accuracy over a wide temperature range. This device can measure humidity with the range of 0 to 100% maintaining an accuracy of ±3%. Know that the maximum measurable humidity of the module reduces at high or low temperatures.
  • Its pressure sensing part is an absolute barometric pressure sensor having high accuracy, resolution, and drastically lower noise than the Bosch Sensortec BMP280. Know that the pressure and altitude are related to each other, the reason this device is also used as an altimeter with ±1 meter accuracy. Plus, it can measure pressure ranging from 300 to 1100 hPa maintaining an accuracy of ±1.0 hPa. To maintain 100% accuracy, a temperature range from 0 to 65°C is required.
  • Its temperature sensing part has been optimized for the lowest noise and high resolution.
  • This sensor is available in both I2C and SPI interfaces and it can be supplied with 1.71 to 3.6 V for sensor supply Vdd and 1.2 to 3.6 V for the interface supply Vddio.
  • Whenever the sensor is disabled, current consumption drops to 0.1µA.
  • It supports a full suite of operating modes that optimize the device for power consumption, filter performance, and resolution.

BME280 Pinout

BME280 environmental sensor comes with 10 pins but more often only 6 pins are employed at a single time. The pin description of each pin is described below.

The following figure shows the pinout diagram of this module.

BME280 Datasheet

If you want to incorporate this module into your relevant project, make sure you thoroughly look at the datasheet of BME280. The characteristics of the device are listed in this datasheet. Click the link below to check the datasheet of BME280.

 

BME280 Arduino Interfacing

In this section, we’ll explain An Arduino Weather Station project with the BME280 sensor.

The components used in this setting include:

      • An Arduino Mega
      • A BME280 sensor
      • An LCD shield for Arduino
      • A power bank
      • Wires

Here, we are using Arduino Mega but Arduino UNO can also be used.

  • First, we connect LCD to Arduino. After this, we connect the Vin pin of a sensor with the Arduino 5v output pin. Next, we connect the GND pin of a sensor to the SCL pin of Arduino and the SDA pin of a sensor to the SDA pin of Arduino.
  • Know that the module runs at 3.3V. If you’re using an SPI interface, level shifting is required to avoid any damage, however, if you’re running the I2C interface which is a preferred interface to apply, no level shifting is required since it is an open-drain interface carrying 10K pull-up resistors, providing Vcc 3.3V.
  • That’s all connected, if we load the code and power up the project we can see the reading from the sensor on the screen. For better understanding let's see a diagram of this project below.

BME280 Features

BME280 comes with the following features:

  • Get this device in a metal lid LGA package with dimensions of 2.5x 2.5x 0.93 mm³
  • The Interface protocols are I²C and SPI
  • Supply Voltage is 1.71 to 3.6 V
  • The temperature range is -40 to +85°C
  • Humidity range is 0-100% real humidity
  • The pressure range is 300-1100 hPa
  • The humidity sensor and pressure sensor can be independently enabled/disabled
  • This module is Register and performance compatible with Bosch Sensortec BMP280 digital pressure sensor
  • It is RoHS compliant, halogen-free, MSL1
  • It gets a more precise temperature, atmospheric pressure values, humidity, and approximate altitude data fast
  • It is Grove compatible and easy to use
  • It has a highly abstracted library for building projects quickly

BME280 Modes

This module comes with three modes named:

  • Sleep mode
  • Forced mode
  • Normal mode

The sleep mode is by default selected when the sensor gets activated. In this mode, no measurements take place and the sensor stays at the lowest power consumption. Plus, all registers can be accessed and you can read the chip-ID and compensation coefficients.

In the forced mode only one measurement takes place. The sensor goes back to the default sleep mode after the measurement is performed. The data registers store the measurement results before the forced mode is selected again for the next measurement. The forced mode is a good fit for the applications that need host-based synchronization and a low sampling rate.

The normal mode consists of automated continuous cycling between the inactive standby period and the active measurement period. Know that the sleep mode current is slightly lower than the standby period current. When you enable the normal mode, the determined measurement results can be gathered from information stored in data registers.

The timing diagram of normal mode is shown below:

BME280 Specifications

In this section, we’ll cover the specifications of BME280 so you can get a hold of what this device projects in terms of electrical, pressure, temperature, and humidity specifications.

A few things to consider before you look out at those specifications:

  • All values mentioned in the tables are valid with the full voltage range.
  • And min/max values are provided with the temperature range with full accuracy.
  • The typical state machine timings and currents values are discovered at 25 °C.
  • The state machine min/max values are available with 0 to 65 °C temperature range.

BME280 Electrical Specifications

The following table shows the general electrical specifications.

Parameter
Symbol Condition Min Typ Max Unit
Supply Voltage Internal Domains VDD Ripple max. 50 mVpp   1.71 1.8 3.6 V
Supply Voltage I/O Domain VDDIO 1.2 1.8 3.6 V
Sleep Current IDDSL 0.1 0.3 µA
Standby Current IDDSB 0.2 0.5 µA
Current during humidity measurement IDDH Max value at 85 °C 340 µA
Current during pressure measurement IDDP Max value at - 40 °C   714 µA
Current during temperature measurement IDDT Max value at 85 °C 350 µA
Startup time Tstartup Time to first communication after both VDD > 1.58 V and VDDIO > 0.65 V   2 ms
Power supply Rejection Ratio PSRR Full VDD range   ± 0.01 ± 5   % RH/V Pa/V  
Standby time accuracy tstandby ±5 ±25 %

Humidity Parameter Specifications

The following table shows the humidity parameter specifications.

Parameter Symbol Condition Min Typ Max Unit
Operating Range RH For temperatures < 0 °C and > 60 °C   -40 0 25 85 100 °C % RH
Supply Current IDD.H 1 Hz forced mode, humidity and temperature 1.8 2.8 µA
Absolute accuracy tolerance AH 20...80 % RH, 25 °C, including hysteresis   ± 3 % RH
Hysteresis HH 10-90-10 %RH 25 °C   ± 1 % RH
NonLinearity NLH 10-90 % RH, 25 °C   1 % RH
Response time to Complete 63%   T63% 90-0 or 0-90 % RH, 25 °C     1 s
Resolution RH 0.008 % RH
Noise in humidity NH Highest oversampling   .02 % RH
Long term stability Hstab 10...90 % RH, 25 °C   0.5     % RH/year  

Pressure Sensor Specifications

The following table shows the pressure sensor specifications.

Parameter Symbol Condition Min Typ Max Unit
Operating Temp. Range TA Operational   Full accuracy   -40 0 25 +85 +65 °C
Operating pressure range P Full accuracy 300 1100 hPa
Supply Current IDDLP 1 Hz forced mode, pressure and temperature, lowest power   2.8 4.2 µA
Temperature coefficient of offset TCOP   25... 65 °C, 900 hPa   ± 1.5 ± 12.6   Pa/K cm/K
Absolute accuracy pressure Apex   AP,full   AP       300 . . 1100 hPa -20 . . . 0 °C   300 . . 1100 hPa 0 . . . 65 °C   1100 . . 1250 hPa 25 . . . 40 °C     ± 1.7   ± 1   ± 1.5     hPa hPa hPa
Relative accuracy pressure VDD = 3.3V   Arel 700 ... 900hPa 25 . . . 40 °C   ± .12 hPa
Resolution of pressure output data RP Highest Oversampling 0.18 Pa
Noise in pressure NP, fullBW   NP, filtered     Full bandwidth, highest oversampling Reduced bandwidth, highest oversampling   1.3 11 .2 1.7 Pa cm Pa cm  
Solder drift Minimum solder height 50µm -0.5 +2 hPa
Long term stability Pstab Per year   ±1 hPa
Possible sampling rate fsample_P   Lowest Sampling 157 182 Hz

Temperature Sensor Specifications

The following table shows the temperature sensor specifications.

Parameter Symbol Condition Min Typ Max Unit
Operating Temp. Range T Operational   Full accuracy   -40 0 25 +85 +65 °C
Supply Current IDD, T 1 Hz forced mode, Temp. measurement only 1 1100 µA
AT,25   25 °C ± 0.5   °C
Absolute Accuracy Temperature   AT,full   Aext   Aext       0 ... 65 °C   -20 ... 0 °C   -40 ... -20 °C     ± 1   ± 1.25   ± 1.5     °C
Output Resolution   RT API output resolution 0.01 °C
RMS noise   NT Lowest Oversampling   0.005 °C

BME280 Absolute Maximum Ratings

It is important to note that these ratings are available over complete temperature range.

The following table shows the absolute maximum ratings of BME280.

Parameter Condition Min Max Unit
Voltage at any supply pin VDD and VDDIO pin   -0.3 4.25 V
Voltage at any interface pin -0.3 VDDIO + 0.3   V
Storage Temp. = 65% RH   -45 +85 °C
Pressure 0 20,000 hPa
ESD HBM, at any pin   CDM   Machine Model   ± 2   ± 500   ± 200 KV V V
Condensation No power supplied allowed allowed

BME280 Applications

Due to its SPI and I2C compatibility, the BME280 sensor is employed in a range of applications especially weather monitoring and health monitoring. The applications it can be used for include:

  • Skin detection, room change detection
  • Health monitoring/well-being
  • Warning regarding dehydration or heat stroke
  • Measurement of lung volume and airflow
  • Home automation control
  • Control heating, ventilation, air conditioning (HVAC)
  • Internet of things
  • GPS enhancement (e.g. time-to-first-fix improvement, dead reckoning, slope detection)
  • Indoor navigation (change of floor detection, elevator detection)
  • Outdoor navigation, leisure, and sports applications
  • Weather forecast
  • Vertical velocity indication (rise/sink speed)

That was all about the Introduction to BME280. If your mind is brimmed with questions regarding this device, you can ask me in the section below. I’d love to assist you the best way I can. Feel free to share your feedback and suggestions about the content we share, so we keep improving our content and deliver exact as per your needs and expectations. Thank you for reading the article.

Introduction to TCS3200

Hello friends, I hope you all are doing great. In today's tutorial, we are gonna have a look at a detailed Introduction to TCS3200. TCS3200 is a color-detecting sensor, it consists of TAOS TCS3200 RGB sensor chip and four white LEDs. It is used to detect visible color in a measurable range. This sensor has an array of a photodetector diode, some diodes are equipped with different color filters i.e. red, blue or green color and some diodes do not have any filter. TCS3200 has different applications such as test strip reading, sorting by color and ambient light sensing. In today's post, we will have a look at its working, protocol, pinout, specification, etc. I will also share some links where I have interfaced it with other microcontrollers. If you have any questions about it ask in the comments I will resolve your problems. So, let's get started with a basic Introduction to TCS3200.

Introduction to TCS3200

  • TCS3200 is a color-detecting sensor, it consists of TAOS TCS3200 RGB sensor chip and four white LEDs. It is used to detect visible color in a measurable range.
  • It is a programmable sensor and color light-to-frequency converter. The board of this sensor is a monolithic integrated circuit that consists of a configurable silicon photodiode and a current-to-frequency converter.
  • The output of this sensor is a square wave (50% duty cycle), the frequency of output depends on the intensity of light (irradiance).
  • The output frequency of this sensor can be scaled by two input control pinouts. Due to its digital input and digital output, it can easily be interfaced with other microcontrollers.
  • The light-to-frequency converter of this sensor reads the 8 x 8 array of photodiodes. In this array of photodiodes, 16 photodiodes have green filters, 16 have blue filters, 16 have red filters and sixteen photodiodes have no filters.
  • To minimize, the effect of non-uniformity of incident radiation all photodiodes are interdigitated. The same colored diodes are connected in parallel. We can use pin S2 and S3 to check which group of photo diodes is active.
  • The dimensions of photodiodes are 110um x 110um.
  • The operating temperature of this sensor is -40°C to +85°C and it is available in 8-SOIC packages.
  • This sensor is mostly used in RGB-led industrial control projects and medical diagnostic types of equipment.

Now, we discuss TCS3200 pinouts with a detailed description.

TCS3200 Pinout & Description

  • There are main eight pinouts of TCS3200 which are described below.
Pin# Type Parameters
Pin#4 GND This pin is the power supply ground. All voltages are reference to the ground.
Pin#5 VCC It is a supply voltage.
Pin#3 OE Enable for FO  (Active low).
Pin#6 OUT This pin is for output frequency (fo).
Pin#1,2 S0, S1 Using these pins we can Select lines for output frequency scaling.
Pin#7,8 S2, S3 Using these pins we can Select lines for photodiode type.
Now, we discuss the specifications of TCS3200, which are described below.

Features of TCS3200

  • These are the main features of TCS3200.
    • Its operating voltage is 2.7v to 5.5v.
    • Its operating current is 2 mA at 5 V.
    • Its interface is digital TTL.
    • It can easily convert light intensity to frequency with high resolution.
    • There is no need for ADC.
    • It operating temperature is -40 C to 85 C.
    • It has a power down attribute.
    • Its dimensions are 28.4x28.4mm(1.12x1.12").
    • It is available in a 5mm x 6.2mm SOIC (D) package.
    • It is programmable.
    • It supports LED lamp light supplement control.

Working of TCS3200

  • As we have already seen that TCS3200 has an 8 x 8 array of photodiodes, which are used for color sensing.
  • When light falls on these photodiodes, then these light signals are converted into square waves and the frequency of these square waves is dependent on the intensity of falling light.
  • After getting results from light to frequency converter, which is a square wave, we can simply fed them to any microcontroller like Arduino, PIC Microcontroller or Atmel etc and detect the color of falling light.
  •  If we observe a given diagram we can easily understand how the sensor can detect various colors.
  • As we earlier discussed that photodiodes of the sensor have three different filters which are red, green, and blue while one group of photodiodes have no filter.
  • All sixteen photodiodes of a sensor are connected in parallel, by using two pins S2 and S3 we can select which pin we have to use for color reading.
  • Let's suppose we have to detect red color, we just have to use sixteen red filter photodiodes by setting two pin S2 and S3 to low logic level according to a given table.
  • TCS3200 also has two more pins used for controlling purposes, and are named as S0, and S1.
  • These two switches are used for tuning the frequency of square wave. We can set the output frequency to either 2%, 20% or 100%. These are builtin frequency values.
  • This function tells us that we can optimize the sensor output for various counters and microcontrollers.

Applications of TCS3200

  • These are some applications of TCS3200.
    • As we know this is a color light sensor, so we use it in color detecting projects, otherwise we have to use MATLAB for color detection, which will need laptop (not a good option).
    • TCS3200 is used for object sorting based on color.test strip reading,
    • We can also sense ambient light using this sensor.
    • We can also read color codes on LED strips.
So, friends that were all about TCS3200 If you have any questions about it please ask in comments. Thanks for reading. Take care until the next tutorial.

Introduction to ACS712

Hello friends, I hope you all are doing great. In today's tutorial, we are gonna have a look at detailed Introduction to ACS712. ACS712 is an AC or DC current sensor, which is used to measure AC or DC current. You should also have a look at Difference between AC & DC Power, that will help. The maximum value of AC and DC which can be measured is 30A, its output current signal can be read via analog I/O port of Arduino. It is also available in 5A and 20A version which provides precise and economical solutions for AC or DC current sensing in industrial and commercial systems. ACS712 consists of a precise and low offset linear Hall sensor circuit with a copper conduction path located near the surface of the die. ACS712  is used in different industrial projects and commercial electrical devices which includes motor control switched mode power supplies, load detection, and management and overcurrent fault protection. In today's post, we will have a look at its working, Arduino interfacing, applications, pinout, etc. I will also share some links where I have interfaced it with other microcontrollers. If you have any query ask in comments I will resolve your problems. So, let's get started with a basic Introduction to ACS712.

Introduction to ACS712

  • ACS712 is a current sensor, which can detect AC or DC current easily. The maximum values of AC or DC which can be detected is 30A. Its operating voltage is 5v.
  • ACS712 is available in small surface mount SOIC8 package. Its lead-frame is plated with 100% matte tin, which is compatible with standard lead-free printed circuit board assembly process.
  • Its package allows easy implementation by the customer, its typical applications are motor control, load detection and overcurrent fault protection.
  • It consists of a precise linear hall circuit with a copper conduction path located near the surface of the die. When applied current passes through this copper conduction path generates a magnetic field which is sensed by Hall integrated circuit (IC) and converted into a proportional voltage.
  • An output of ACS712 has a positive slope (>VIOUT (Q)) when increasing current passes through a primary copper conduction path (from pin 1 and 2, or pin 3 and 4), which is the path used for current sensing. The internal resistance of this conductive path is 1.2 mO. The thickness of the conductor provides survival for a device during the over-current condition.

Now, we discuss ACS712 pinout with a detailed description.

ACS712 Pinout & Description

  • There is three main pinout of ACS712, which are described below with detail description.
Pin# Type                                         Parameters
Pin#1 Vcc This is an input supply pin. 5v is given on this pin.
Pin#2 Output  This is output analog voltage proportional to current.
Pin#3 Ground This is used for ground.
  • For better understanding let's see ACS712 pinout diagram.
  • Now, we discuss ACS712 features.

Features of ACS712

    • These are the main features of ACS712.
      • It measures both DC and AC current.
      • Its operating voltage is 5v.
      • It is available in 5A, 20A and 30A module.
      • It provides isolation from the load.
      • It is easily integrated with MCU.
      • It provides a low noise analog signal path.
      • Its bandwidth is 50 kHz.
      • It is available in low profile SOIC8 package.
      • Its total error is 1.5% at TA = 25°C and 4% at –40°C to 85°C.
      • Its output sensitivity is 66 to 185 mV/A.
      • Its output voltage are proportional to AC or DC currents.
      • It has an extremely stable output offset voltage.
      • Its magnetic hysteresis is nearly zero.

ACS712 Arduino Interfacing

  • It is very easy to interface ACS712 with a microcontroller, you should also have a look at ACS712 Arduino Interfacing for better understanding.
  • In the given circuit diagram, the ACS712 module has two Phoenix terminal connectors with mounting screws as shown in the circuit diagram in green color. At these terminals, wires are connected.
  • In our circuit diagram we are measuring current drawn by the motor, so the wires which are connected with motor is passed through the ACS712 module. Make sure ACS712 module is connected in series with the motor.
  • On the other side of the module, we have three pins, Vcc is connected with +5V power supply and ground is connected to the ground of MCU.
  • Analog voltage given by the ACS712 module can be read using an analog pin of Microcontroller.
  • You can interface ACS712 with almost every microcontroller i.e. Arduino, PIC Microcontroller, 8051 etc.
  • For a better understanding of this module, let's see the circuit diagram.

Applications of ACS712

  • These are some applications of ACS712.
    • It is used for motor speed control.
    • It is used for load detection and management.
    • It is used as switched-mode power supplies.
    • It is used for over current fault protection.
So, that was all about ACS712, If you have any question regarding this module ask in comments, I will resolve your problems. Take care...

Introduction to DHT11

Hello Friends, I hope you all are fine and will be doing well in your life. In today's tutorial, I am going to give you a detailed Introduction to DHT11. It is an embedded sensor used to measure temperature & humidity in the surroundings and gives calibrated digital output. It can measure temperature in the range of 0°C to 50°C with ±2°C accuracy. Its humidity range is from 20% to 80% with ±5% accuracy. It is a small, low cost and easy-to-interface embedded sensor.

In this tutorial, I will explain its working, pinout, protocol and interfacing with other microcontrollers in detail.

  • Here are a few important features of DHT11, given in the below table:
DHT11 Features & Specs
No. Parameter Value
1 Measures Humidity & Temperature
2 Sensors Included Capacitive Humidity Sensor & Thermistor
3 Humidity Range 20% to 80% with ±5% accuracy
4 Temperature Range 0°C to 50°C with ±2°C accuracy
5 Package 4 Pins in a single row
6 Operating Voltage 3.0V to 5.5V
7 Operating Current 0.3mA(measuring), 60uA(idle)
8 Resolution 1°C, 1%RH (8-Bit)
9 Response Time 6s-15s
10 Repeatability ±1°C, ±1%RH
11 Sampling Frequency 1Hz
12 Dimensions 27mm x 59mm x 13.5mm (1.05" x 2.32" x 0.53")

So, let's start with the Introduction to DHT11:

Where To Buy?
No.ComponentsDistributorLink To Buy
1DHT11AmazonBuy Now

Introduction to DHT11

  • DHT11 is a low-cost, small-sized & easy-to-operate embedded sensor, consisting of 4 pins, used to measure Temperature(0°C to 50°C with ±2°C accuracy ) & Relative Humidity (20% to 80% with ±5% accuracy ) and provides calibrated digital output.
  • DHT11 Pinout consists of 4 Pins in total, listed below from left to right:
    1. Vcc: Need to provide +5V at this pinout.
    2. Data: It's the digital output pin, that gives either 0V or 5V.
    3. NC: Not Connected. (It's left open for future design)
    4. GND: Need to provide Ground at this pinout.


  • DHT11 has a Capacitive Sensor for measuring humidity & NTC Thermistor for temperature sensing. (We will cover them in detail below)
  • It comes in a single package comprising of 4 pins with 0.1" spacing between them and a special package can be provided according to user demand.
  • DHT11 updates the output value once every 2 seconds.
  • Small-size, low-cost, precise & calibrated output and up to 20 meters signal transmission stand it out from other sensors.
  • DHT11 uses a single-wire serial interface for data processing.
  • It calibrates the humidity using humidity coefficients, which are stored in the OTP program memory of the built-in controller.
  • Its operating voltage is 3V to 5.5V, so it works with both 3.3V and 5V microcontroller systems.
  • It has a sampling frequency of 1Hz, so it samples the data after every 1sec.
  • DHT11 has a dimension of 27mm x 59mm x 13.5mm (1.05" x 2.32" x 0.53"), so it is very small and can easily be placed in autonomous embedded projects.
  • It is quite accurate & precise in its readings as compared to other expensive sensors i.e. SHT10, DS18B20 etc.

We have discussed the basic features of our Moisture sensor DHT11. Now, let's have a look at DHT11 Pinout and description:

DHT11 Pinout & Description

  • DHT11 Pinout consists of 4 Pins in total, which are shown in the below table:
Pin# Type                                         Parameters
Pin#1 Vcc Provide 3.3V to 5V at this pin.
Pin#2 Data This pin provides a digital output.
Pin#3 N/C  Not Connected.
Pin#4 Ground This pin is used for Ground ( Connected to 0V or GND ).
  • For better understanding let's check its picture, given below:

Now, we will discuss the DHT11 working principle in detail:

DHT11 Working Principle

  • Now, let's understand the working principle of the DHT11 temperature & humidity sensor.
  • As we have discussed earlier, it has two sensors inside it, so let's have a look at both of them separately:

DHT11 Temperature Sensing

  • For temperature sensing, it has an NTC(Negative Temperature Coefficient) temperature sensor (also called a thermistor ) mounted on the surface inside the plastic casing.
  • NTC temperature sensors are variable resistive sensors and their resistance decreases with an increase in the surrounding temperature.
  • Thermistors are designed with the sintering of semiconductor materials, such as ceramic or polymers and they provide a large change in resistor with a small temperature change.
  • Here's the graph showing the relation between temperature and resistance for the DHT11 sensor:

Now, let's discuss the Humidity Measurement of DHT11:

DHT11 Humidity Measurement

  • For Humidity Measurement, it uses a capacitive humidity sensor, which has two electrodes and a substrate material in between.
  • The substrate material is used for holding the moisture on its surface.
  • As moisture content changes in our environment, they get saturated on the substrate material, which in turn changes the resistance between electrodes.
  • This change in electrode resistivity is then calibrated using the humidity coefficient (saved in OTP memory) and the final relative humidity value is released.
  • Here's the image showing the internal structure of the DHT11 humidity sensor:
Now let's discuss the communication Protocol of the DHT11 temperature & humidity sensor:

DHT11 Communication Protocol

  • DHT11 sensor uses a single-wire, two-way Serial Protocol for communicating with third-party peripherals normally microcontrollers.
  • We call it single-wire because the communication is performed through a single pin.
  • It's two-way because DHT11 receives commands from the microcontroller and then responds required data.
  • Data sent by the DHT11 sensor is 40 bits and it sends Higher Data Bits first.
  • Data contains both Integral and decimal values of temperature and relative humidity along with a checksum value.

DHT11 Data Format

  • DHT11 sends the 40Bit serial data in the below format:
    1. 8-Bit Humidity(Integral)
    2. 8-Bit Humidity(Decimal)
    3. 8-Bit Temperature(Integral)
    4. 8-Bit Temperature(Decimal)
    5. 8-Bit Checksum
  • If DHT11 is sending the correct data, then it must send an 8-bit Checksum data at the end.

DHT11 Communication with Microcontroller

  • The circuit diagram to interface DHT11 with the microcontroller is shown in the below figure:
  • A pull-up resistance of 5k ohm is recommended to place at the Data Pin of the DHT11 sensor.
  • At normal conditions, the data pin of DHT11 remains at the HIGH voltage level and the sensor remains in low power consumption mode.
  • To receive data from the DHT11 sensor, the microcontroller should make the Data Pin low for at least 18us, so that the sensor could sense it.
  • Once the DHT11 sensor senses the low signal at the Data Pin, it changes its state from low power consumption mode to running mode and waits for the Data Pin to get HIGH.
  • As the Data Pin gets HIGH again by the microcontroller, DHT11 sends out the 40-bit calibrated output value serially.
  • After sending the data, DHT11 returns to low power consumption mode and waits for the next command from the microcontroller.
  • The microcontroller has to wait for 20-40us to get a response from the DHT11 sensor.

Applications of DHT11

Because of its small size, low cost and ability to sense two values, DHT11 has a wide range of applications:
  • DHT11 is used in Home Automation Projects to maintain constant atmospheric values by controlling the appliances(i.e. AC, Fan etc.) based on the sensor's readings.
  • It is also used at weather stations for temperature & humidity sensing.
  • It is also used in automatic climate control appliances.
  • Environment monitoring devices also utilize this sensor.
  • Garden Monitoring Systems also use DHT11 sensors.

So, that was all about the DHT11 temperature and humidity sensor. I have tried to cover this sensor from all angles. Let me know about your experience with the DHT11 sensor in the comments. Take care!!!

Introduction to DHT22

Hello friends, I hope you are all fine and will be doing something interesting in your life. in today's post, I am going to discuss Introduction to DHT22. It is a temperature and humidity measure sensing device. It is easily used but it needs a specific time for an operation. Its temperature measuring range is from -40 to +125 degrees Celsius with +-0.5 accuracy. This sensor measures moisture content and temperature. This sensor is easily connected to other microcontrollers. DHT22 plays an important role in our environment in measuring temperature and moisture. It is a low cost easy-to-use small sensor. This sensor is used at different weather stations to measure temperature and ratio of moisture in the air, in this way, they tell about temperature or rain prediction. In today's post, I will talk about its working protocol, pinout, application and interfacing with other microcontrollers. I will also share some links to projects where I have interfaced with other Arduino. If you have any queries about it please ask in the comment I will resolve your queries. So let's start with Introduction to DHT22.

Introduction to DHT22

  • DHT22 is a low-cost humidity and temperature measuring sensor. It consists of thermister for temperature measurement and capacitive humidity sensor humidity measurement. The feature which gives importance then another sensor is that you can get data after two seconds.
  • It is very easy to use, just connect the first pin from left with supply then get data from the second pin. Its last pin used for ground.
  • It has higher accuracy and precision, due to this feature it can replace expensive imported SHT10 temperature and humidity sensor.
  • This sensor is used to measure environment temperature and humidity to meet the high demand.
  • This sensor has reliability and good stability. It is easy to combine with a special sensor Arduino expansion board, which is easy to use for temperature and humidity perception.
  • DHT22 is digital humidity sensor, designed for analog sensor interfacing.
  • It consists of 4.7 K to 10 K resistor, which can be used as pull up from data pin to Vcc.
  • It has four pins with 0.1" spacing.
For better understanding now discuss its pin configuration.

DHT22 PINOUT & Description

There is main four pinout of DHT22 we use three pins which are discussed below with details.
No. Pin Type                                         Parameters
1. Vcc This is Power Pin at this pin we apply 3.5 v to 5.0 volts.
2 Data Through this pin, we get outputs both Temperature and Humidity through serial Data.
3 Ground Ground Pin ( Connected to 0V or GND )
Better understanding lets see its pinout picture. Now discuss its working and its principle at which it works.

Working of DHT22

  • Now discuss how it works, It consists of two main parts one measure temperature and other is used for humidity measurement it also has IC to send data to Microcontroller. Discuss these component ones by one.
    •  Humidity Sensing Component
      • For humidity measurement, it uses the humidity measurement component, which has two electrodes with moisture holding substrate between them.
      • As humidity changes, the conductivity of substrate changes or resistance between electrodes changes. This changes in resistance are measured, then processed by IC which make it ready to be rad by Microcontroller.
    • Temperature Measuring Component
      • To measure temperature this sensor uses an NTC temperature sensor or Thermistor.
      • A thermistor is a variable resistor that changes its resistance with a change of temperature. These sensors are made by sintering of semiconductive materials, such as ceramic or polymers in order to large change in a resistor with small changes in temperature. As temperature changes, there is a change in the value of resistance by which we measure the temperature of our environment.
For a better understanding of its working, Lets its picture. Now, discuss the features and specifications of DHT22.

Features & Specification of DHT22

These are some features of DHT22.
  • The voltage it operates is 3.5v to 5.5v.
  • Its operating current is 0.3v to 5.5.
  • The protocol which it uses to send data is a serial transmission of data.
  • Its temperature at which it operates is -40°C to 80°C.
  • Its humidity range is 0% to 100%.
  • Its temperature and humidity resolution are 16-bit.
  • Its Accuracy is ±0.5°C and ±1%
  • Its sampling rate is 0.5 Hz once every two seconds.
  • Its dimensions are 27mm x 59mm x 13.5mm (1.05" x 2.32" x 0.53").
  • It has four pins with 0.1" spacing.
  • Its weight is 2.4g.
  • It is a low-cost sensor. Its price is just $1 to $5.
  • It has long term stability of ±0.5% per year.
Now we discuss the DHT22 Serial Data Transmission protocol by which it sends data.

DHT22 Serial Protocol

  • DHT22 sensor is calibrated in industries it is designed for serial output data transmission. I have to interface it with Microcontroller for its serial data transmission.
  • As you can see that the data pin is connected with an input-output pin of Microcontroller and 5k pull up resistor is used. This data pin sends output values of both temperature and humidity as serial data.
For a better understanding of serial transmission, let's see its picture. Now discuss DHT22 Arduino interfacing.

DHT22 Arduino Interfacing

  • In given circuit diagram I have interfaced Arduino with DHT22. By providing source code to Arduino we can use it according to desire requirement and also can use it for temperature and humidity measuring purpose.

Application of DHT22

These are some application of DHT22.
  • It is used for temperature and humidity measurement.
  • It is used as a weather station to measure temperature and humidity in the air.
  •  It is an automatic climate control sensor.
  • It is also used as an environmental monitoring device.
So, friends, this was all about DHT22, if you have any query regarding it please ask in a comment. I will resolve your queries. Thanks for reading. Take care until the next tutorial.....

Introduction to MPU6050

Hello friends, I hope you are all fine and will be doing something special in your life. In today's post, we are gonna have a look at a detailed Introduction to MPU6050. MPU6050 is a sensor for motion processing devices. It is the world's first six-dimension motion tracking device. It was designed for low-cost and high-performance smartphones, tablets and wearable sensors. It is capable of processing nine-axis algorithms, it captures motion in X, Y and Z axis at the same time. MPU6050 is used in different industrial projects and electronic devices to control and detect the 3-D motion of different objects. In today's post, we will have a look at its working, pinout, protocol, it's interfacing with Arduino, features, applications, etc. I will also share some links of projects where I have interfaced it with Arduino and some other microcontrollers. Friends if you have any questions about it, please ask in the comment box I will resolve your queries in the simplest way possible. So let's start with a basic Introduction to MPU6050.

Introduction to MPU6050

  • MPU6050 is a microelectromechanical system (MEMS), it consists of a three-axis accelerometer and a three-axis gyroscope. It helps us to measure velocity, orientation, acceleration, displacement and other motion-like features.
  • MPU6050 consists of  Digital Motion Processor (DMP), which has the property to solve complex calculations.
  • MPU6050 consists of a 16-bit analog-to-digital converter hardware. Due to this feature, it captures three-dimensional motion at the same time.
  • This module has some famous features which are easily accessible, due to its easy availability it can be used with a famous microcontroller like Arduino. Friend if you are looking for a sensor to control the motion of your Drone, self-balancing robot, RC Cars and something like that, then MPU6050 will be a good choice for you.
  • This module uses the I2C module for interfacing with Arduino.
  • MPU6050 is less expensive, Its main feature is that it can easily combine with an accelerometer and gyro.

Now, Lets discus PINOUT of MPU6050.

MPU6050 PINOUT & Description

There is a main eight PINOUT of MPU6050, which are described here:
MPU6050 Pinout
Pin# Pin Name Description
01  Vcc This pin used for Supply Voltage. Its input voltage is +3 to +5V.
02  GND This pin use for ground
03 SCL This pin is used for clock pulse for I2C compunction
04 SDA This pin is used for transferring of data through I2C communication.
05 Auxiliary Serial Data (XDA) It can be used for other interfaced other I2C module with MPU6050.
06 Auxiliary Serial Clock (XCL) It can also be used for other interfaced other I2C module with MPU6050.
07 AD0 If more than one MPU6050 is used a single MCU, then this pin can be used to vary the address.
08 interrupt (int) This pin is used to indicate that data is available for MCU to read.
 
  • For better understanding lets see PINOUT diagram:
Now, let's discuss the features of MPU6050.

Features of MPU6050

These are some features of MPU6050.
  • MPU6050 is the world's first integrated six motion tracking device
  • The communication protocol at which it operates is I2C.
  • It is built in 16 BIT ADC, which provide high accuracy.
  • Its operating voltage is 3 to 5 volts.
  • It consists of a digital motion processor, which provide high computational power.
  • It is inbuilt in the temperate sensor.
  • It can be used to interfaces with IIC devices like magnetometer.
  • The pitch of its pins is 0.1 inch.
  • Its Acceleration Range is  +/-2g, +/-4g, +/-8g, +/-16g.
  •  Its Dimensions (excluding pins) are, 21.2mm (0.84") length x 16.4mm (0.65") width x 3.3mm (0.13") height.
  •  Its weight is 2.1g.
  • It has the smallest and thinnest QFN package for portable devices, 4x4x0.9 mm.
  • Its operating current is 3.9 mA when its six motion sensing axes and DMP are in motion.
  • It also has gyroscope feature like its  Gyroscope operating current is 3.6 mA.
  • Its gyroscopic stand by current is 5µA. It also has low improved frequency noise performance.
  • It works at Gyroscope range, ± 250 500 1000 2000 °/ s.
Now let's discuss the I2C protocol on which it operates.

I2C Protocol

As we earlier discus that MPU6050 works on I2C protocol, now discuss this protocol.
  • MPU6050 was first introduced by the Philips semiconductors in 1982. For sending and receiving data between two or more devices we need a path which called BUS. I2C is a bidirectional two-wire bus which use to send data between integrated circuits.
  • I2C consist of three data transfer speed which is, standard, fast-mode, and high-speed mode. I2C sports 7 bit and 10-bit address devices.
  • I2C is the best choice where simplicity and low manufacturing cost are more important than speed.
  • For a better understanding of how I2C protocol works, let's see is a picture.

MPU6050 Arduino Interfacing

Now let's have a look at MPU6050 Arduino interfacing.
  • In the given diagram we have shown its interfacing with Arduino, the value which we can by using this module are given below The following data values can be obtained using this example.
    • Quaternion Components (w, x, y, z), Euler angles, Yaw, Pitch, Real world Acceleration, Roll, World frame acceleration and Teapot invent sense Values.
    Let's see the circuit. 

Applications of MPU6050

  •  It is used for IMU measurement.
  • It can be used in Drones / Quadcopters as direction controller.
  •  It used in Self-balancing robots.
  • It can use as Robotic arm controls.
  • It can be used in Humanoid robots
  •  It used in Tilt sensor.
  •  It can be used orientation or Rotation Detector.
  • It can be in Handset and portable gaming
  •  It used inMotion-based game controllers
  •  It used in 3D remote controls for Internet-connected DTVs and set-top boxes, 3D mice
Friend, that was about MPU6050, If you something else kindly asks in a comment box. I will further guide you in the next tutorial. Till then take care.....

Introduction to LM35

Hello friends, I hope you all are doing great. In today's tutorial, we are gonna have a look at a detailed Introduction to LM35. LM35  is a type of commonly used temperature sensor, that can be used to measure temperature with an electrical output compared to the temperature in (°C). In can measure temperature in a better way than a thermistor. LM35 is used in industries and commercial buildings where high accuracy of temperature measuring is needed. I will give you a detailed overview of this temperature sensor in today’s post where we will have a look its pinout, working, protocol, etc. I will also share some links of projects where I have interfaced it with Arduino or other microcontrollers. If you have any questions please ask in the comments, I will resolve your queries and will guide you in a comprehensive way. So, let’s get started with the basic Introduction to LM35:

Introduction to LM35

  • LM35 is a commonly used temperature sensor, It shows values in the form of output voltages instead of degrees Celsius.
  • LM35 shows higher voltage values than thermocouples and may not need the output voltage to be amplified.
  • The output voltage of LM35 is proportional to the Celsius temperature. The scale factor is .01 V/°C.
  • One most important characteristics is that it draws just 60 microamps from its supply and acquires a low self-heating capacity.
  • LM35 temperature sensor available in many different packages like T0-46 metal transistor-like package, TO-92 plastic transistor-like package, 8-lead surface mount SO-8 small outline package.
Let's have a look at LM35 PINOUT configuration:

LM35 Pinout

  • LM35 has three pinouts which are:
    • PIN 1: Vcc, it used as input at this pin we apply +5 V input voltage.
    • PIN 2: At this pin, we get output voltage.
    • PIN 3: This pin is used for ground.
  • Here's the table for LM35 Pinout for better understanding:
 
No. Parameter Pin Type
1. Vcc Power Pin ( Connected to +5V )
2 Vout Output Pin (It should be connected with an analog pin of Microcontroller)
3 Ground Ground Pin ( Connected to 0V or GND )
For better understanding lets, have a look at LM35 Pinout figure. Let's have a look at working of LM35  Working.

Working of LM35

  • LM35 is used to measure precise centigrade temperature. The output of this sensor changes describes the linearity. The output voltages of this sensor are linearly comparative to the Celsius temperature.
  • The output voltage range of this sensor is from -55° to +150°C. It also has low self-heating power.
  • Its operating voltages is 4 to 30 volts.
  • In the most circuit, this sensor is used with an operational amplifier. An amplifier is a device which amplifies applied a voltage at a certain level.
  • Operational Amplifier has three terminal, first two are inverting and noninverting inputs third one is used for output.
  • By using LM35 with operational amplifier we can get amplification of output voltages of LM35.
  • For better understanding lets have a look at circuit diagram.

LM35 Features

  • Its maximum and minimum input voltages are 35 V and -2 V respectively. It typically operates at 5 V.
  • It can measure temperature from -55°C to 150°C.
  • Its Output voltage is directly proportional (Linear) to temperature (i.e.) there will be a rise of 10mV (0.01V) for every 1°C rise in temperature.
  • Its Drain current is less than 60 uA.
  • Its low-cost temperature sensor.
  • It is small and hence suitable for remote applications.
  •  It is available in TO-92, TO-220, TO-CAN and SO IC package.
  • It is low self-heating, 0.08 C in still air n Non-linearity only ±1/4C typical.

Parameters of LM35

Let's discuss some working parameters of LM35
No. Parameter Conditions Value Unit
1. Accuracy LM35, LM 35C T A=+25°C ±0.4 °C
2 Accuracy, LM35D T A=+25°C ±0.6 °C
3 Non linearity T MIN=TA=T MAX ±0.3 °C
4 Sensor Gain T MIN=TA=T MAX +10.0 mV/°C
5 Load Regulation T A=+25°C ±0.4 mV/mA
6 Line Regulation T A=+25°C ±0.01 mV/V
7 Quiescent Current V S=+5V, +25°C 56 µA
8 Change of Quiescent Current 4V=VS=30V 0.2 µA
9 Temperature Coefficient of Quiescent Current             - +0.39 µA/°C
10 Long Term Stability T J=T MAX, for 1000 hours    ±0.08 ±0.08 °C
 

LM35 Interfaced with Aurdino

Now, let's discuss LM35 interfacing with Arduino and design a simple project:
  • The project which we are gonna discuss is Temperature Monitoring on Virtual Terminal of Arduino.
  • Temperature Sensor we are gonna use is LM35.
  • In this circuit, Aurdino is the main component because it controls all functions.
  • In this circuit LM35 senses the temperature and converts into an electoral (analog) signal, then this signal applied to Microelectronic Unit through an analog-to-digital converter (ADC).
  • The analog signal is converted into digital format by the ADC.
  • The value of temperature sensed by the sensor will be displayed on Serial Terminal or virtual Terminal if you are working on Proteus.
  • You can download this complete Proteus simulation from Interfacing of LM35 with Arduino in Proteus.
  • I have also shared Interfacing of LM35 with PIC Microcontroller, so if you are working on PIC Microcontroller then you should read that out.
  • For better understanding lets see the circuit diagram of this project:
Now, let's discuss the advantage and application of this project. Let's have a look at applications of LM35:

Applications of LM35

These are some applications of LM35, let discuss them.
  • It's used for measuring the temperature of a particular environment.
  • It provides thermal shutdown for a circuit or component used in a specific project.
  • It can be used for battery temperature measurement. It provides battery protection from overheating.
  • It can be used in HVAC applications as a temperature measurement device.
I hope you have enjoyed today's tutorial on this simple temperature sensor LM35. Let me know if you need any help with its projects. Will meet you guys in the next tutorial. Till then take care, have fun !!! :)

Introduction to HC-SR501

Hello friends, I hope you all are doing great. In today's tutorial, we are gonna have a look at a detailed Introduction to HC-SR501. HC-SR501 is a motion detector sensor, that uses infrared waves for the detection of an object. It is an automatic control device, and also has large sensitivity and high reliability. It is used in auto-sensing control devices, where we need to perform motion detection. HC-SR501 is used in industrial projects and buildings for security purposes. In today's post, we will have a look at its pinout, working, protocol, circuit diagram, etc. I will also share some links to projects where I have interfaced it with Arduino and some other microcontrollers. Friends if you have any questions please ask in the comments I will try my best to solve your problems and I will give you a comprehensive answer. So let's start with a basic Introduction to HC-SR501:

Introduction of HC-SR501

  • HC-SR501 is a Passive Infrared (PIR) motion detector sensor.
  • It is used for the detection of moving objects, particularly for the human.
  • Such, a device consists of such components and is integrated as a component of a system that automatically performs a task or alerts a user motion in that area.
  • They form a vital component of security,  home control, energy efficiency, automatic light control and other useful systems.
  • Its module also contains time delay adjustment and trigger selection which allow for fine tuning with your application.
  • Now let's have a look at the HC-SR501 pinout.

HC-SR501 PINOUT

  • HC-SR501 has a total of three pinout, which are:
    • PIN 1: This pin is Vcc, it is used for input voltage. Its input voltage varies from 5V to 12V.
    • PIN 2: It's the OUT Pin which is fed to the microcontroller.
    • PIN 3: We have to apply ground on this pin.
  • Now, for better understanding lets have look a at HC-SR501 Pinout figure:
  • Lets have a look at working of HC-SR501:

Working of HC-SR501

  • Every living object with a temperature above Absolute Zero (0 Kelvin / -273.15 °C) emit heat energy in the form of infrared radiations.
  • The hotter an object is the more radiation it emits. Human body works on a similar pattern and emits heat energy.
  • HC-SR 501 sensor is designed to detect such level of infrared radiation. It basically consists of two main parts:
    • A Pyroelectric Sensor.
    • A special lens called Fresnel lens which focuses the infrared signals onto the pyroelectric sensor.
  •  For better understanding lets see figure and explain it.
  • A pyroelectric sensor has two rectangular slots in it, which made of  such material which allow infrared radiation to pass through it.
  • Behind these two slots, there are two sensor electrodes,
    • One responsible for positive output.
    • Second for negative output.
  • The two electrode wire up so that they cancel each other out. If one half sees less or more infrared radiations  then other, the output will swing high or low.
Lets discuss these two conditions.
  • When the sensor is idle: If there is no movement around the sensor, both slots detect the same amount of infrared radiations, resulting in a zero output signal.
  • When a warm body like a human or animal passes by: If someone pass by as sensor then, it first intercept  one half of the sensor, which causes a positive differential change between the two halves. When the warm body leaves  the sensing area, the reverse happen, then the sensor generates a negative differential change.  The Corresponding pulse of signals results in the sensor setting its output pin high.

Using HC-SR501 as a Standalone Unit

  • One of the reasons, HC-SR501 to be extremely popular is the fact that HC-SR 501 is a very versatile sensor that is pretty capable all on its own.
  • By using it with other microelectronic such as Arduino you can expand upon its versatility even further.
Now lets have a look at its versatility by this circuit diagram. Lets discuss this circuit:
  • Connection for this circuit is very simple. Batteries are connected with Vcc and GND of the sensor and small Red LED connected to the output pin through a 220O current limiting resistor.
  • When the sensor detects motion, the output pin will go “high” and light up the LED.
  • One thing is to be remembered is that once you power up the circuit you need to wait 30-60 seconds for the  to acclimatize to the infrared energy in the room.
  • During this time LED may blink a little. Weight until LED is off and move around in front of it to  see led light up.
  • Let discuss its circuit diagram with aurdino.

HC-SR501 Interfaced With Aurdino

  • Now we have an understanding of HC-SR501 working, lets discus its interfacing with Aurdino. Connection of this circuit is very simple.
  • HC-SR501 acts as a digital sensor so all you need to do is listen for the output pin to flip HIGH or LOW.
  • For correctly working, you will want to set the jumper on the HC-SR501 to the H (Retriggering) position.
  • You should also download PIR Sensor Library for Proteus so that you can easily simulate it in Proteus.
  • You should also have a look at PIR Sensor Arduino Interfacing.
  • Lets see a diagram of this circuit.
Lets now discuss some features of HC SR501:

HC-SR501 Features

  • Wide range of voltages we can apply on its input varying from 4.V to 12V (+5V recommended).
  • Its best feature is that it can distinguish  between men movement and object movement.
  • Its Output voltage is High/Low (3.3V TTL).
  • It cover a distance of 7 meter and an area of 110 degrees.
  • It's operating temperature is  from -20° to +80° Celsius.
Now lets discuss HC-SR501 functional description.

HC SR501 Functional Description

Lets discuss HC-SR501 Functional Description with detail and know how it operate when someone come in its working range.
  • When someone comes under infrared waves regions, then  sensor detect variations in infrared waves it  trip alarm and tell about someone appearance at that point. We can its adjustment according to our requirements.
    • HC-SR501 Initialization:
  • When we start function on it, it require a minute for the initiate. During this period, it does not work properly. During this period for it to work properly, we need a circuit or controller to take this initialization period into consideration.
    • HC-SR501 Area of Detection:
  • In the coming line, we will discuss about its detection area.
  • It works in the range of 110 degree cone area and 3 to 7 meters.

 HC -SR 501 Applications

These are some application of HC-SR501:
  •  It can be used as Automatically sensing light for Floor, bathroom, basement, porch, warehouse and in Garage.
  •  It can also be used in the ventilator.
  • We can use it for security purposes as well.
So, that was all about Passive Infrared motion sensor HC-SR501. I hope you have enjoyed today's tutorial. Let me know if you have any questions. Will meet you guys in the next tutorial. Till then take care !!! :)

Introduction to DS18B20

Hello friends, I hope you all are doing great. In today's tutorial, we are gonna have a look at a detailed Introduction to DS18B20. DS18B20 is a temperature sensor that can measure temperature from -55oC to +125oC with an accuracy of +- 5%. It follows 1 wire protocol which has revolutionized the digital world. Because of its 1 wire protocol, you can control multiple sensors from a single pin of Microcontroller.

DS18B20 is normally used in industrial projects where high accuracy is necessary. I will give you a detailed overview of this temperature sensor in today's post where we will have a look at its Pinout, working, protocol, etc. I will also share some links to projects where I have interfaced it with Arduino or other microcontrollers. If you have any questions, please ask in comments and I will try my best to resolve them all. So, let's get started with a basic Introduction to DS18B20:

Introduction to DS18B20

  • DS18B20 is a digital temperature sensor that follows a 1-wire protocol and can measure temperature from -55oC to +125oC ( -67oF to +257oF ) with an accuracy of +-5%.
  • Data received from the single wire is in the ranges of 9-bit to 12-bit.

  • As DS18B20 follows the 1-wire protocol so we can control this sensor via a single pin of Microcontroller. (We also have to provide GND)
  • 1-wire protocol is an advanced level protocol and each DS18B20 is equipped with a serial code of 64 bit which helps in controlling multiple sensors via a single pin of the microcontroller.
  • In simple words, it assigns different addresses to all sensors attached and by calling the address, you can get that sensor's value.
  • So, now let's have a look at the DS18B20 Pinout:

DS1820 Pinout

  • DS18B20 has 3 pins in total, which are:
    • Pin # 1: Vcc ( We have to provide +5V here ).
    • Pin # 2: Data Pin ( It's the 1-wire from where we will get temperature readings ).
    • Pin # 3: GND ( We have to provide ground here ).
  • It is available in two packages, one is simple while the other one is waterproof DS18B20, both of their pinouts are shown in the below figure:

  • Now let's have a look at some of DS18B20's Characteristics and features:

DS18B20 Features

  • I have assembled a table where I have added all the features and characteristics of DS18B20.
No. Parameter Symbol Value Unit
1. Supply Voltage VDD +3 to 5.5 V
2. Pull-up Supply Voltage VPU +3 to 5.5 V
3. Input Logic Low VIL -0.3 to +0.8 V
4. Input Logic High VIH +2.2 V
5. Sink Current IL 4.0 ma
6. Standby Current IDDS 750 to 1000 na
7. Active Current IDD 1 to 1.5 ma
8. DQ Input Current IDQ  5 ua
9. Drift   +-2 C
10. NV Write Cycle Time tWR  2 to 10 ms
11. EEPROM Writes NEEWR 50k writes
12. EEPROM Data Retention tEEDR 10 years
13 Temperature Conversion Time tCONV 93.75 ms
14. Time to Strong Pullup On

tSPON

10 ms
15. Time Slot

tSLOT

120 us
16. Recovery Time TREC 1 us
17. Write 0 Low Time

tLOW0

120 us
18. Write 1 Low Time tLOW1 15 us
19 Read Data Valid

tRDV

15 us
20. Reset Time High

tRSTH

480 us
21 Reset Time Low

tRSTL

480 us
22. Presence-Detect High

tPDHIGH

60 us
23 Presence-Detect Low tPDLOW 240 us
20. Capacitance

CIN/OUT

25 pf

 

  • Let's have a look at one wire Bus system:

 One Wire Bus System

  • As I told earlier that DS18B20 follows 1 wire protocol, so in order to understand its working, we must have a look at this protocol first.
  • The main advantage of 1 wire protocol is that we can control multiple 1-wire devices via a single pin of Microcontroller.
  • You must have heard of the master-slave system, where 1 master device can control or communicate with all slave devices.
  • 1-wire protocol follows a similar master-slave system, where microcontroller acts as a master and all our 1-wire devices e.g. DS18B20 act as slaves.
  • If we have interfaced only one device with our microcontroller then such a system is called a single drop but if we interface multiple 1-wire devices via a single pin then it's called multidrop system.
  • Now let's have a better understanding of One Wire System from the figure given below:

  • Now let's have a look at DS18B20 Power Supply:

Power Supply of DS18B20

  • There are two ways to power up this temperature sensor DS18B20, which are:
    • External Power Supply.
    • Parasite Power Supply.
  • Let's discuss both of these power supplies in detail:                                    
External Power supply of DS18B20

  • In this method, we provide power to DS18B20 by conventional method i.e. battery or adapter.
  • This method is applicable for temperature below +100 degree Celsius.
  • The main benefit of this method is, there is no extra load on the resistor which uses in this method and it performs work correctly. 
  •  Let's have a look at the connections in the below figure:

Parasite Power Mode of DS18B20

  • In this method, we do not need a special power supply.
  • This method is used for temperature greater than +100 Celsius.
  • In a normal situation, this method provides efficient current and voltage to DS18B20 
  • But, in special work when DS18B20 convert temperature value into digital then current value increase to such value which can damage resister.
  • To limit current in save the value and good working of DS18B20 it is necessary to use pull up mosfet.
  • As it is used only for specific temperature value there we use an external power supply.

Now, let's have a look at pictures of this method

Working of DS18B20

  • It works on the principle of direct conversion of temperature into a digital value.
  • Its main features are to change its bit numbers according to change in temperature 
  • Like, it changes a bit in 9. 10, 11, and 12  bits as temperature changes in values 0.5 ° C. 0.25°C,1.25 and  0.0625°C respectively.
  • Its default bits value is 12 but it changes values according to Temperature Change
  • It has alarm and LCD as temperature changes alarms work and temperature value changes which we can get from LCD.
  • Now let's have a look at the DS18B20 memory map 

DS18B20 Memory Map

  • There are are two types of memories which have DS18B20
  •  One SRAM  and other is EEPROM.
  • Sram is volatile memory it has data only in on the condition 
  • EEPROM is Non-volatile memory it stores data in the off condition
  • EEPROM also has a low and high alarm trigger 
  • To have a better understanding of Memory Map of DS18B20 look at pictures which gives a better idea of a memory map of ds18b20 

  • Now let's have a look at Function Commands of DS18B20

DS18B20 Function Commands

These are function Commands of DS18B20. These commands allow some to read and write data on DS18B20 scratched memory. Let's discuss them

  • Convert T[44h]: This command starts the single temperature conversion.
  • Write scratched Pad [4Eh]: In this command, we can write data on memory of DS18B20 to three bytes. Data is transferred in the least multiple bits first.
  • Read Scratched Pad[BEh]: In this command, we can read data on a scratched pad memory of DS18B20.
  • Copy Scratchpad [48h]: This command data from the scratched pad and send data to EEPROM in 2, 3 and 4 bytes.
  • Read Power Supply [B4h]: This command tells about the power supply mode of DS18B20.

Now let's have a look at Applications of DS18B20:

Applications of DS18B20

DS18B20 is used for temperature measurement. There are some applications of DS18B20:

  • We can use it in the thermostat controls system.
  • It can be used in industries as a temperature measuring device.
  • It can be used as a thermometer.
  • We can use it in thermally sensitive devices.   
  • It can also use in HVAC systems.

So, that was all about temperature sensor DS18B20. I hope you have enjoyed today's tutorial. IF you have any questions then ask in comments and we will resolve them all. Thanks for reading. Take care !!! :)

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir