Heart Beat Monitor using Arduino in Proteus

Hello friends, I hope you all are doing great and having fun in your lives. In today's tutorial, we are gonna design a Heart Beat Monitor using Arduino in Proteus ISIS. You should download this Heart Beat Sensor Library V2.0 for Proteus because we are gonna use that to detect heart beat in Proteus. I have also used a 20x4 LCD which will display our heart rate value. You should download this New LCD Library for Proteus. I have counted the heart beat for ten seconds and then I have multiplied it with 6 to get the heartbeat per minute which is abbreviated as bpm (beats per minute). So, let's get started with Heart Beat Monitor using Arduino in Proteus ISIS.
Where To Buy?
No.ComponentsDistributorLink To Buy
1LCD 20x4AmazonBuy Now
2Arduino UnoAmazonBuy Now

Heart Beat Monitor using Arduino in Proteus

  • First of all, click the below button to download this complete Proteus simulation & Arduino code for Heart Beat Monitor:
Heart Beat Monitor using Arduino in Proteus

Proteus Simulation of Heart Rate Monitor

  • Now let's have a look at How we have designed this simulation and How it works.
  • So, design a simple circuit in Proteus as shown in the below figure:
  • As you can see in the above figure, we have our Arduino UNO board along with LCD and Heart Beat Sensor.
  • There's also a Button attached to Pin # 2, so when we press this button our Arduino will start counting the Heart Beat and will update it on the LCD.
Now let's have a look at the programming code for Heart Rate Monitor:

Arduino Code for Heart Rate Monitor

  • Here's the code which I have used for this Heart Beat Monitor using Arduino:
#include <LiquidCrystal.h>
#include <TimerOne.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

int HBSensor = 4;
int HBCount = 0;
int HBCheck = 0;
int TimeinSec = 0;
int HBperMin = 0;
int HBStart = 2;
int HBStartCheck = 0;

void setup() {
  // put your setup code here, to run once:
  lcd.begin(20, 4);
  pinMode(HBSensor, INPUT);
  pinMode(HBStart, INPUT_PULLUP);
  Timer1.initialize(800000); 
  Timer1.attachInterrupt( timerIsr );
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Current HB  : ");
  lcd.setCursor(0,1);
  lcd.print("Time in Sec : ");
  lcd.setCursor(0,2);
  lcd.print("HB per Min  : 0.0");
}

void loop() {
  if(digitalRead(HBStart) == LOW){lcd.setCursor(0,3);lcd.print("HB Counting ..");HBStartCheck = 1;}
  if(HBStartCheck == 1)
  {
      if((digitalRead(HBSensor) == HIGH) && (HBCheck == 0))
      {
        HBCount = HBCount + 1;
        HBCheck = 1;
        lcd.setCursor(14,0);
        lcd.print(HBCount);
        lcd.print(" ");
      }
      if((digitalRead(HBSensor) == LOW) && (HBCheck == 1))
      {
        HBCheck = 0;   
      }
      if(TimeinSec == 10)
      {
          HBperMin = HBCount * 6;
          HBStartCheck = 0;
          lcd.setCursor(14,2);
          lcd.print(HBperMin);
          lcd.print(" ");
          lcd.setCursor(0,3);
          lcd.print("Press Button again.");
          HBCount = 0;
          TimeinSec = 0;      
      }
  }
}

void timerIsr()
{
  if(HBStartCheck == 1)
  {
      TimeinSec = TimeinSec + 1;
      lcd.setCursor(14,1);
      lcd.print(TimeinSec);
      lcd.print(" ");
  }
}
  • In this code, I have used a TimerOne Library which creates an interrupt after every 1sec.
  • On each interrupt, it executes timerIsr() function, in which I have placed a check that whenever this interrupt will call we will increment TimeinSec variable.
  • So, when TimeinSec will become equal to 10 then I am simply multiplying it with 6 and updating it on the LCD.
  • So, use the above code and get your Hex File from Arduino Software and update it in your Proteus Simulation.

Simulating Heart Rate Monitor

  • Now run your Proteus Simulation and you will get something as shown in the below figure:
  • Now click this HB button and it will start counting the HB as well as will count the Time in seconds.
  • After ten seconds it will multiply the current heart rate with six and will give the Heart Beat Per Minute.
  • Here's a final image of the result:
  • You can change the value of Heart Beat from the variable resistor connected with Heart Beat Sensor.
  • Let's change the value of variable resistance connected to Heart Beat sensor, and have a look at the results.
  • You have to press the button again in order to get the value.
  • Here's the screenshot of the results obtained:
  • So, now the heart is beating a little faster and we have got 108 bpm.
  • If you run this simulation then you will notice that the second is quite slow which I think is because of Proteus.
  • I have tested this code on hardware and it worked perfectly fine, although you need to change heart beat sensor's values in coding.
  • Here's the video in which I have explained the working of this Heart Rate Monitor Simulation in detail.
So, that was all about Heart Beat Monitor using Arduino in Proteus ISIS. I hope you have enjoyed it and will get something out of it. Have a good day. :)

C945 Library for Proteus

Hello friends, I hope you all are doing great. In today's tutorials, I am gonna share a new C945 Library for Proteus. If you have searched for this transistor in Proteus, then you must have known that it's not available in Proteus. We have designed this transistor in Proteus and here's its library. If you don't know much about this transistor then you should have a look at Introduction to C945, in which I have explained in detail the basics of this transistor. Today, first of all, I will show you How to install this library and after that we will design a simple Proteus Simulation in which we will see How to simulate C945 in Proteus. You should also check this amazing list of New Proteus Libraries for Engineering Students. So, let's get started with C945 Library for Proteus:

C945 Library for Proteus

  • First of all, download this C945 Library for Proteus by clicking the below button:
C945 Library for Proteus
  • You will get two files in it named as:
  • TransistorsTEP.IDX
  • TransistorsTEP.LIB
Note:
  • Place these two files in the Library folder of your Proteus software.
  • Now open you Proteus Software or restart it if its already open.
  • In your Components Search box, make a search for C945 and you will get some results as shown in below figure:
  • Now place this component in your Proteus work space and it will look something as shown in below figure:
  • Here's our NPN transistor named as C945, its first pin is Emitter, second one is Collector and the third one is Base.
  • Now let's have a look at C945 Simulation in Proteus.

C945 Simulation in Proteus

  • I hope you have installed the C945 Library for Proteus Successfully.
  • Now let's design a simple circuit to have a look at working of this transistor.
  • You can download this simulation by clicking the above button but as always, I would suggest you to design it on your own.
  • That way you can learn a lot.
  • The C945 Simulation for Proteus is shown in below figure:
  • I have used an opto-coupler (normally I use PC817 while designing it on hardware), which is getting a 5V signal and then I am sending that signal to the Base of C945.
  • At Emitter of C945, I have connected the GND and Collector is connected to the Load.
  • Here's the ON and OFF state of above circuit:
  • Its quite a simple circuit and actually what we are doing is we are controlling a 12V load frm 5V signal, which normally comes from Microcontroller like Arduino or PIC Microcontroller.
  • You can also assemble this circuit in hardware and can use it in your projects.
  • Here's the video in which I have shown How to download this C945 Library for Proteus and also how to run C945 Proteus Simulation:
So, that was all about C945 Library for Proteus and also How to design a C945 Simulation in Proteus. I hope you have enjoyed it and can design it on your own. You can download the Library as well as this Simulation by clicking above download button. Thanks for reading. Take care !!! :)

DC Motor Control using XBee & Arduino in Proteus

Hello friends, I hope you all are doing great. In today's tutorial, we are gonna design a project named DC Motor Control using XBee & Arduino in Proteus ISIS. I have shared the complete code and have also explained it in detail. You can also download the complete working Proteus Simulation given at the end of this tutorial. In this project, I have designed two Proteus Simulations. The first Simulation is of Remote control in which I have used a keypad. The second simulation contains our two DC Motors and I am controlling the direction of those DC Motors with my Remote Control. XBee Module is used for sending wireless data. The code will also work on hardware as I have tested it myself. So, let's get started with DC Motor Control using XBee & Arduino in Proteus ISIS:

DC Motor Control using XBee & Arduino in Proteus

  • I have designed two Proteus Simulations for this project.
  • The First Simulation is named as Remote Control while the second one is named as DC Motor Control.
  • I am controlling the directions of these DC Motors from my Remote.
  • So, let's first have a look at Remote section and then we will discuss the DC Motor Control.
  • You can download both of these Proteus Simulations (explained below) and Arduino codes by clicking below button:
Download Proteus Simulation
Remote Control
  • Here's the overall circuit for Remote Control designed in Proteus ISIS:
  • As you can see in the above figure that we have Arduino UNO which is used as a microcontroller and then we have XBee module which is used for RF communication and finally we have Keypad for sending commands.
  • You have to download this XBee Library for Proteus in order to use this XBee module in Proteus.
  • You will also need to download Arduino Library for Proteus because Proteus doesn't have Arduino in it.
  • The Serial Monitor is used to have a look at all the commands.
  • Now next thing we need to do is, we need to write code for our Arduino UNO.
  • So, copy the below code and Get your Hex File from Arduino Software.
#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 4; //three columns
char keys[ROWS][COLS] = {
  {'7','8','9', '/'},
  {'4','5','6','x'},
  {'1','2','3','-'},
  {'*','0','#','+'}
};
byte rowPins[ROWS] = {13, 12, 11, 10}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {9, 8, 7, 6}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

int KeyCheck = 0;

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

}

void loop() 
{
  char key = keypad.getKey();
  
  if (key)
  {
    if(key == '1'){KeyCheck = 1; Serial.print("1");}
    if(key == '2'){KeyCheck = 1; Serial.print("2");}
    if(key == '3'){KeyCheck = 1; Serial.print("3");}
    
    if(key == '4'){KeyCheck = 1; Serial.print("4");}
    if(key == '5'){KeyCheck = 1; Serial.print("5");}
    if(key == '6'){KeyCheck = 1; Serial.print("6");}

    if(KeyCheck == 0){Serial.print(key);}
    KeyCheck = 0; 
  }

}
  • The code is quite simple and doesn't need much explanation.
  • First of all, I have initiated my Keypad and then I have started my Serial Port which is connected with XBee Module.
  • In the Loop section, I am checking the key press and when any key is pressed our microcontroller sends a signal via XBee.
  • Now let's have a look at the DC Motor Control Section.
DC Motor Control
  • Here's the image of Proteus Simulation for DC Motor Control Section:
  • We have already installed the XBee & Arduino Library for Proteus in the previous section.
  • Here you need to install L298 Motor Driver Library for Proteus, which is not available in it.
  • So here we have used two DC Motors, which are controlled with L298 Motor Driver.
  • XBee is used to receive commands coming from Remote Control.
  • Now use below code and get your hex file from Arduino Software:
int Motor1 = 7;
int Motor2 = 6;
int Motor3 = 5;
int Motor4 = 4;

int DataCheck = 0;

void setup() 
{
  Serial.begin(9600);
  pinMode(Motor1, OUTPUT);
  pinMode(Motor2, OUTPUT);
  pinMode(Motor3, OUTPUT);
  pinMode(Motor4, OUTPUT);
   
  digitalWrite(Motor1, HIGH);
  digitalWrite(Motor2, HIGH);
  digitalWrite(Motor3, HIGH);
  digitalWrite(Motor4, HIGH);

  Serial.print("This Arduino Code & Proteus simulation is designed by:");
  Serial.println();
  Serial.println("        www.TheEngineeringProjects.com");
  Serial.println();
  Serial.println();
  Serial.println();
   
}

void loop() 
{
  if(Serial.available())
  {
    char data = Serial.read();
    Serial.print(data);
    Serial.print("      ======== >      ");
    
    if(data == '1'){DataCheck = 1; digitalWrite(Motor2, LOW);digitalWrite(Motor1, HIGH); Serial.println("First Motor is moving in Clockwise Direction.");}
    if(data == '2'){DataCheck = 1; digitalWrite(Motor1, LOW);digitalWrite(Motor2, HIGH); Serial.println("First Motor is moving in Anti-Clockwise Direction.");}
    if(data == '3'){DataCheck = 1; digitalWrite(Motor1, LOW);digitalWrite(Motor2,  LOW); Serial.println("First Motor is Stopped");} 

    if(data == '4'){DataCheck = 1; digitalWrite(Motor3, LOW);digitalWrite(Motor4, HIGH); Serial.println("Second Motor is moving in Clockwise Direction.");}
    if(data == '5'){DataCheck = 1; digitalWrite(Motor4, LOW);digitalWrite(Motor3, HIGH); Serial.println("Second Motor is moving in Anti-Clockwise Direction.");}
    if(data == '6'){DataCheck = 1; digitalWrite(Motor3, LOW);digitalWrite(Motor4,  LOW); Serial.println("Second Motor is Stopped.");}

    if(DataCheck == 0){Serial.println("Invalid Command. Please Try Again !!! ");}
    Serial.println();
    DataCheck = 0;
  }

}
  • In this code, I am receiving commands from my remote and then changing the direction of my DC Motors.
  • When it will get '1', it will move the first motor in Clockwise Direction.
  • When it will get '2', it will move the first motor in Anti-Clockwise Direction.
  • When it will get '3', it will stop the first motor.
  • When it will get '4', it will move the second motor in Anti-Clockwise Direction.
  • When it will get '5', it will move the second motor in Clockwise Direction.
  • When it will get '6', it will stop the second motor.
  • It will say Invalid Commands on all other commands.
  • Now let's have a look at its working & results.
Working & Results
  • Now run both of your Simulations and if everything goes fine, then you will have something as shown in below figure:
  • Now when you will press buttons from keypad then DC Motors will move accordingly.
  • Here's an image where I have shown all the commands.
So, that's all for today. I hope you have enjoyed today's project in which we have designed DC Motor Control using XBee & Arduino in Proteus ISIS. Thanks for reading !!! :)

Real Time Security Control System using XBee and GSM

Hello everyone, I hope you all are doing great. In today's post, I am going to share a Final Year Project in detail, named as Real Time Security Control System using XBee and GSM. I will give you all the details so that you can easily design it on your own. I've given the Proteus Simulation to download below. In that zip file, you will get both the Arduino codes and Proteus Simulations.

I have divided this whole project design into four parts. If you got into any trouble in your project, then ask in comments and I will try my best to resolve them. So, today we are gonna have a look at the basics of this Security project. There are a lot of systems introduced in the market these days that are used to transfer sensor data from one node to another either wirelessly or through some wired connection. The proposed technique also works on this same principle. But a lot of modifications are intended to introduce in order to enhance this technique.

Where To Buy?
No.ComponentsDistributorLink To Buy
1LCD 20x4AmazonBuy Now
2NEO-6MAmazonBuy Now
3SIM900AmazonBuy Now
4DS18B20AmazonBuy Now
5Flame SensorsAmazonBuy Now
6MQ-2AmazonBuy Now
7Arduino UnoAmazonBuy Now

Real Time Security Control System

  • You can download this Project by clicking the below button:
Real Time Security Control System using XBee and GSM Now let's have a look at the project description:

Project Description

In this project, I have designed a real-time security system, which consists of two wireless nodes named as
  • Sensor Node
  • Base Node.
So, first of all, let's have a look at these two nodes one by one. First, I am going to discuss Sensor Node:

Sensor Node

The sensor node is placed in that building which is needed to be secured. Sensor node consists of three different sensors and two modules used for security purposes named as:
  • Sensors:
    • Smoke Sensor: To detect Smoke.
    • Flame Sensor: Used for Fire Detection.
    • Temperature Sensor: Measuring Temperature of surroundings.
  • Modules:
    • GSM module: is used to deliver the notification message if any fault occurs in the system.
    • GPS module: is used to locate the exact position of the fault that occurred.
Below two modules are used for controlling purposes:
  • Modules:
    • Arduino UNO: All these Sensors and modules are connected to Arduino UNO.
    • XBee Module: To send sensors' data & GPS Location to Base Node.
Block Diagram for the Sensor Unit of Real Time Security Control System using XBee and GSM is shown in below figure: Now let's have a look at the Base Unit of Real Time Security Control System using XBee and GSM.
Base Unit:
  • The base node will be placed in the Control Department. It could be your security guard's room or the nearby police station.
  • This node will receive the data from the sensor node via XBee module.
  • So, in total it will have three modules on it which are:
    • XBee Module: It is used to maintain wireless communication between the sensor node and base node.
    • LCD 20x4: It is used to display real-time conditions like sensors' values & GPS Location.
    • Arduino Mega 2560: It is used to control both of these modules.
  • Here's the block diagram of Base Unit for Real Time Security Control System using XBee and GSM:

Components Selected

In the previous section, we have had a look at the basic Introduction of our Real Time Security Control System using XBee and GSM. This section will elaborate on the selection of the components which is the most important factor before designing any project/product. This is basically a simulation based project so there is no hardware involved in this project. The proposed technique is designed in Proteus ISIS. All of the components are taken from the Proteus library.

Flame Sensor

  • The flame sensor is an electronic device usually used for fire detection purposes.
  • It can be used in homes, industries, offices, schools etc.
  • A certain threshold is adjusted while designing the algorithm.
  • When the fire flames cross that particular threshold, the flame sensor will send a signal to Arduino which will send that signal through Xbee to Base Unit immediately.
  • As soon as the signal will be received on the Base Unit, the alarm will turn ON and hence guards will come to know that this area has become dangerous now.
  • Immediate precautions must be taken in this case.
  • Flame Sensor is not available in Proteus so we have designed its library.
  • You should download this Flame Sensor Library for Proteus.

Smoke Sensor

  • A smoke sensor is used to detect a certain level of smoke within the desired region.
  • It is usually used in homes and organizations for the detection of fire or internal burns.
  • It is a low-cost and very sensitive sensor that also beeps if someone is smoking in its coverage area.
  • This Smoke Sensor will detect any smoke in the area then it will warn the Arduino board which will, in turn, send a signal via XBee to Base Unit.
  • Proteus software doesn't have a smoke sensor in it so you should download this Smoke Sensor Library for Proteus.

Temperature Sensor

  • The temperature sensor is an electronic sensor used to estimate the temperature in the surroundings.
  • The temperature range can be adjusted while designing its algorithm.
  • When the temperature in the surroundings reaches the adjusted threshold, it generates a notification.
  • Most of the time an alarm is attached to the temperature sensor. The alarm starts to beep when the desired temperature is reached. It can be used in homes, offices and organizations to maintain the temperature of a certain area according to the desired requirements.
  • But in our project we want to send a signal to the base unit, so that's why this sensor will send a signal to the base unit.

XBee Module

  • XBee is selected as a wireless module. The proposed technique consists of two XBee modules.
  • One is attached to the base unit and the other is attached to the sensor unit.
  • The data is transmitted by the sensor unit via XBee module.
  • And the XBee module attached to the base unit receives that data from the sensor unit and sends it to the microcontroller to manipulate it.
  • There are many wireless modules available in the market these days e.g. Radio Frequency (RF) module.
  • Some of them are not used commonly due to their shorter ranges e.g. Bluetooth module.
  • XBee module is far better as compared to the Bluetooth module and provides a larger coverage area in comparison to similar wireless modules.
  • So, XBee is used in this project. XBee module is not available in Proteus so that's why you should download XBee Library for Proteus.

Arduino UNO

  • The microcontroller plays a vital role in any project and is like a backbone of a particular project.
  • Arduino UNO and Mega 2560 both are selected as a microcontroller.
  • Arduino UNO is attached to the sensor unit and Arduino Mega 2560 is attached to the base unit.
  • Arduino is an open-source device. Students can take online help in almost every task. Online source codes are also available for different tasks.
  • So, a student can easily perform them with a proper understanding.
  • Arduino boards are also not available in Proteus so you should download this Arduino Library for Proteus.

GPS Module

  • GPS module is used to locate the exact location of the fault.
  • GPS module will be attached to Sensor Unit, so if anything goes wrong then we can also get the GPS location via SMS.
  • It will provide us the longitude and latitude of the fault that occurred on the sensor unit.
  • So, now if any of these sensors goes wrong then you can easily get the location of your sensor node via SMS.
  • Proteus doesn't have GPS Module in it so you should download this GPS Library for Proteus.

GSM Module

  • GSM module is used for security purposes.
  • If a fault occurs at any position within the network, a notification message will be generated and sent towards the base unit from the sensor unit.
  • We can also generate a call using this GSM which will be a much better way.
  • This GSM module will also send the location via SMS. We have received this location from GPS in the form of longitude and latitude.
  • Proteus doesn't have GSM Module in it so you should download this GSM Library for Proteus.
So, these are all the components/modules, which I have used in this project. So, in the first part, have seen the basic Introduction of the project and then in the second section, we have had a detailed overview of all the modules used. So, now in the next section which is the third part I am gonna show you How to design these Proteus Simulations.

Proteus Simulation of Security Control System

In this section, we are gonna have a look at how to design these Proteus Simulations for Real Time Security Control System using XBee and GSM. As you know, I have used Arduino so we also need to discuss the code in order to run these simulations. So, first, we will design the proteus simulations and then we will write its code.

Proteus Simulations

  • I have designed two simulations for this project.
  • First of all, what you need to do is to download all those above Proteus Libraries and add them properly.
  • I have given detailed instructions in each post about How to use them.
  • After adding all these Libraries, now restart your Proteus software and design a circuit for the Sensor Unit.
  • Proteus Simulation of Sensor Unit is shown in the below figure:
  • As you can see in the above figure, the Sensor unit consists of three different sensor modules, which are:
    • Temperature sensor.
    • Smoke sensor.
    • Flame sensor.
  • In this unit, Arduino UNO is used as a microcontroller to get data from all the sensors and this data will be transmitted wirelessly towards the base unit for proper monitoring.
  • XBee module is used for wireless communication between the sensor unit and the base unit.
  • GPS module is interfaced in order to locate the exact position of the fault that occurred in the system.
  • Now we are gonna design our second simulation for the Base Unit.
  • The Proteus Simulation of Base Unit is shown in the below figure:
  • The base unit is basically a monitoring end of the system.
  • All the data obtained from the sensors is transmitted by the sensor unit towards the base unit.
  • The base unit has an Arduino Mega 2560 as a micro-processing unit.
  • Just like the sensor unit, an XBee module is also attached to the base unit in order to receive the data wirelessly sent by the base unit.
  • There is an LCD on the base unit. It is used to visualize the obtained results. It displays different messages e.g. fault detection, sensors data etc.
  • GSM module is used in the base unit to send the notification if a fault occurs in the system or the system is showing some abnormal behavior even for an instance.
  • This GSM module will also send the location in SMS. You have to enter the number of recipients in the programming code.

Arduino Code of Security Control System

  • When you download this project, you will get a .rar file and within that file, you will find two folders.
  • One of them will have the Arduino Codes and the other one will have Proteus Simulations.
  • I have already added all the hex files so you just need to run these simulations.
  • If you got into any trouble then use our Contact Form and our team will help you out.
  • You should also need to read How to Get the hex file from your Arduino Software.

Proteus Simulation Results

  • Now coming towards the last section of this project, now I am gonna show you the results of these simulations.
  • So, I have run both of these Simulations and here's the first look at Base Unit:
  • The LCD on the base unit is displaying the title of our project.
  • Virtual Terminal is connected with Arduino so that we could also have a look at incoming or outgoing data.
  • After that first of all, Arduino will communicate with the GSM module and will set its settings, as shown in the below figure:
  • Now our GSM module has configured, so the next screen of the base unit is shown below:
  • As you can see in the above figure that LCD is displaying the values of all three sensors and because all are normal that's why the Alarm is OFF.
  • The temp value is 0 because we haven't yet received the data from the sensor unit.
  • Now let's run our Sensor Unit and make our Fire Sensor HIGH, then you will get results as shown in the below figure:
  • The alarm is also ON in the above figure and SMS has also been sent which is shown in Virtual Terminal.
  • In case, when both fire and smoke are detected, LCD will display smoke as well as fire detection messages.
  • SMS will also be sent as you can see in the Virtual Terminal. GSM has sent the message indicating Fire Detected and GPS Location.
  • Base Unit Proteus Simulation is shown in the below figure:
  • So, whenever you change any of these sensors' values in the Sensor Unit then the respective value will change in the Base Unit.
So, that was all about Real Time Security Control System using XBee and GSM. If you got into any trouble then ask in the comments and I will help you out. Thanks for reading, take care and have fun !!! :)

L298 Motor Driver Library for Proteus

Hello everyone, I hope you all are doing great. Today, I am going to share a new L298 Motor Driver Library for Proteus. It has never been designed before and we are proudly presenting it for the first time. I hope you guys are gonna like it. You should also have a look at DC Motor Speed Control using L298 in which I have used the same module in hardware design. But today we are gonna see it in action in Proteus Simulation and its quite exciting for me as well. :) If you don't know much about L298 then you should also have a look at Introduction to L298, in which I have discussed the basics of L298 module, it will be quite informative for you. If you got into any trouble regarding this L298 Motor Driver Library for Proteus, then you can ask in comments and I will try my best to resolve your issues. So, let's get started with L298 Motor Driver Library for Proteus:

L298 Motor Driver Library for Proteus

  • First of all, download the L298 Motor Driver Library for Proteus by clicking the below button:
L298 Motor Driver Library for Proteus
  • Once you downloaded the rar file, open it and extract the files.
  • You will get two files in it, named as:
    • L298MotorDriverTEP.LIB
    • L298MotorDriverTEP.IDX
  • Place these two files in the Library folder of your Proteus Software.
Note:
  • If you are using Proteus 7 Professional, then the library folder link will be something like this: C:Program Files (x86)Labcenter ElectronicsProteus 7 ProfessionalLIBRARY
  • If you are using Proteus 8 Professional, then the library folder link will be something like this: C:ProgramDataLabcenter ElectronicsProteus 8 ProfessionalDataLIBRARY
  • Now restart your Proteus software and search for L298 Motor Driver in the search box as shown in below figure:
  • Place this L298 Motor Driver in your Proteus work space.
  • If everything goes fine then you will get something as shown in below figure:
  • You can see its looking quite awesome in above figure.
  • Using this L298 Motor Driver, you can easily control two DC Motors and it works exactly the same as our hardware L298 module.
  • It has two output pins on left and 2 on the right side, while the input pins are shown at the right bottom corner.
  • Now, let's design a small circuit and check out its controlling operation.

L298 Motor Driver Simulation in Proteus

  • Now, I am gonna design a small circuit which will simulate this L298 Motor Driver and we will driver two DC motors with it.
  • You can download this L298 Motor Driver Simulation in Proteus by clicking the below button:
Download Proteus Simulation for L298
  • So, first of all design a simple circuit as shown in below figure:
  • I have attached one DC Motor at OUT1 and OUT2 while second DC Motor at OUT3 and OUT4.
  • I have attached Logic States at all of four inputs and you can also provide input using any microcontroller like Arduino or PIC Microcontroller.
  • Now run your simulation and if everything goes fine then you will get results as shown in below figure:
  • You can also have a look at the working of this L298 Motor Driver in below video:
That's all about L298 Motor Driver in Proteus and I hope you won't get any problem in simulating it in Proteus. If you still got any problem then as k in comments and I will help you out and do give your suggestions as well. I will also run Stepper Motor using this L298 Motor Driver.

Ultrasonic Sensor Arduino Interfacing

Hello everyone! I hope you all will be absolutely fine and having fun. Today, I would like to provide a complete discussion on Ultrasonic Sensor Arduino Interfacing. I would like to tell you some detail about ultrasonic sensor, after that we will move towards ultrasonic sensor Arduino interfacing. Ultrasonic sensor is also known as SONAR sensor. SONAR basically stands for Sound Navigation and Ranging. Ultrasonic is mostly used for the distance measurements. It can also be used for measuring the depth of the sea. I have already shared Ultrasonic Sensor Library for Proteus. Ultrasonic/SONAR sensor is an electronic device used to estimate the distance of an object by continuously transmitting sound waves at a particular frequency and listens to that transmitted sound wave to bounce back. It measures the time between the transmission and receiving of that sound wave, which is actually equal to the distance of an object from the SONAR. An optical sensor has both a transmitter to transmit and a receiver to receive the waves. But in comparison to that optical sensor ultrasonic sensor has only a single element for both transmitting and receiving ultrasonic/sound waves. I have also shared Ultrasonic Sensor Simulation in Proteus. Ultrasonic sensor has four pins whose detail will be given later in this tutorial. This is another sensor similar to the ultrasonic sensor i.e. PNG sensor. PNG has three pins. Both of these sensors are designed for the estimation of the distance of an object from the sensor. In this tutorial I am going to use ultrasonic sensor. The basic principle of ultrasonic sensor is that, it transmits ultrasonic waves and receives it back after getting reflected back from the surface of the object and measures the time between transmitting and receiving of the ultrasonic wave. The further detail about ultrasonic sensor/SONAR will be given later in this article.

Ultrasonic Sensor Arduino Interfacing

Ultrasonic sensor is also known as SONAR. It is used for measuring the distance between the object and the sensor itself. It transmits ultrasonic waves and receives it back after reflecting from the surface of an object. Then its measures the time during entire process which is equal to the distance between object and the sensor itself. It has four pins and is very easy to use. It is easily available in the market and is available at very low cost. It has a wide range of applications e.g. estimating the sea’s depth and many more. SONAR/ultrasonic sensor along with proper labeling is given in the figure shown below.
1. Ultrasonic Sensor Pins
  • Ultrasonic sensor has total four pins, each pin has to perform different task.
  • Ultrasonic sensor all pins are listed in the table shown in the figure below.
2. Ultrasonic Sensor Pins Description
  • Since each pin has different task to perform, so we must know about the functionality of each pin.
  • Ultrasonic sensor pins description is listed in the table given in the figure shown below.
3. Ultrasonic Sensor Pinout
  • Pinout diagram provides us the information about all the pins of electronic device.
  • Ultrasonic pinout diagram is given in the figure show below.
4. Ultrasonic Sensor Working Principle
  • Ultrasonic sensor transmits sound waves.
  • These waves are reflected back from the surface of an object.
  • Ultrasonic sensors receives the reflected waves.
  • Then it measures the time elapsed during the entire process, from transmission to receiving, it is known as round trip time.
  • This time is equal to the distance between an object and the sensor itself.
  • I have also provide some visual, so that you can easily understand its working principle.
  • Ultrasonic sensor principle is shown in the figure given below.
5. Ultrasonic Sensor Arduino Interfacing Wiring Diagram
6. Ultrasonic Sensor Arduino Interfacing Source Code
  • I have provided the complete Arduino code for ultrasonic sensor Arduino interfacing.
  • You need to just copy and paste the entire code in your Arduino software.
  • After uploading it to Arduino board, you will be able to get the desired results.
// defines arduino pins numbers
const int trigPin = 12;
const int echoPin = 11;
// defines variables
long duration;
int distance;
void setup() 
{
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600); // Starts the serial communication
}
void loop() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance from the object = ");
Serial.print(distance);
Serial.println(" cm");
delay(1000);
}
  • First of all I have defined the pins for Echo and Trig pin.
  • Then I changed their mode to input and output as well.
  • Then I defined the formula to calculate the distance.
  • You can download the wiring diagram and complete Arduino source code here by clicking on the button below.

7. Ultrasonic Sensor Ratings
  • From the ratings of a device we can learn about its power, voltage and current requirement.
  • Ultrasonic sensor ratings are listed in the figure shown below.
8. Ultrasonic Sensor Dimensions
  • The dimensions of ultrasonic sensor are given in the figure shown below.
9. Ultrasonic Sensor Features & Formula to Measure Distance
  • Ultrasonic sensor features are listed in the table given in the figure shown below.
  • The formula to calculate the distance between an object and the sensor itself is given below.

Distance = (Speed of sound × Time)/2

In the tutorial Ultrasonic Sensor Arduino Interfacing, we have learnt about the pins and working principle of ultrasonic sensor to estimate the distance of an object from the sensor. I hope you enjoyed the tutorial. I have provided all the important details about ultrasonic sensor Arduino interfacing. If you find something missing, please let me know in comments, so that I can update the tutorial correspondingly. I will share further topics in my upcoming tutorials. Till my next post take care and bye :)

2 Relay Module Interfacing with Arduino

Hello everyone! I hope you all will be absolutely fine and having fun. Today, I am going to provide a detailed discussion on 2 Relay Module Interfacing with Arduino. First of all I would like to explain you that what is relay and how to use it and then we will move forward towards 2 relay module interfacing with Arduino. I have already controlled relay with 555 timers. 2 relay module consists of two relays. Relay is basically an electronic device or a switch which is used to open and close the circuits electronically. A relay controls an electric circuit by opening and closing contacts in another circuit. When the relay contact is normally open (NO), there will be an open connection when the relay is not energized. When the relay contact is normally closed, there will be a closed connection even when the relay is not energized. We can use relays to control the smaller currents in different electronic circuits. 2 relay module has two relays. One relay can control two AC/DC device simultaneously. That means 2 relay module can control four AC/DC devices at a time. 2 relay module is normally used to control the DC motors in different projects e.g. robotics, automation, embedded projects etc. It can control two DC motors simultaneously. Moreover, we can also use it for different applications e.g. to control DC/AC fans, AC/DC lights, AC/DC bulbs and a lot more. The further detail about 2 relay module interfacing with Arduino will be given later in this tutorial.

2 Relay Module Interfacing with Arduino

2 Relay Module is an electronic device consists of two relays as its major components. Relay is a switch which makes or loses the connection between two different circuits. A single relay is capable of controlling two AC/DC devices simultaneously. So, 2 relay module is able to control four AC/DC devices at the same time. Mostly it is used to control the DC motors. It can also be used in different projects e.g embedded projects, robotic, automation, power etc. 2 relay module is shown in the figure given below.
1. Relay Proteus Simulation
2. 2 Relay Module  Components
  • A complete list of the components used while designing 2 relay module is shown in the figure given below.
3. 2 Relay Module  Input Pins
  • 2 relay module has five (5) input pins in total, each perform different action.
  •  All of its pins are provided in the table shown in the figure below.
4. 2 Relay Module  Input Pins Description
  • We must know about the functions of each pin.
  • 2 relay board/module input pin functions are listed in the table shown in the figure below.
  • Both IN1 and IN2 comes from the micro-controller (Arduino UNO in this case).
  • IN1 pin controls the 1st relay attached on 2 relay module.
  • IN2 pin controls the 2nd relay attached on 2 relay module
5. 2 Relay Module  Output Pins
  • 2 relay module has three (3) output pins for each relay.
  • Its output pins are given in the table shown in the figure given below.
6. 2 Relay Module  Output Pins Description
  • Each output pin of 2 relay module has its own functions.
  • 2 relay module pin functions are listed in the table given in the figure shown below.
  • NO pin is normally open pin and device attached to this pin will not work if the relay is not energized.
  • COM is a common pin i.e. ground pin.
  • NC is normally closed pin and device attached to this pin will start working even if the relay is not energized.
7. 2 Relay Module  Compatibility
  • 2 relay module is compatible with different micro-controllers.
  • Some of those micro-controllers are provided in the table shown in the figure given below.
8. 2 Relay Module  Circuit Diagram
  • Circuit diagram of 2 relay module is given in the figure shown below.
9. 2 Relay Module  Interfacing with Arduino Wiring Diagrams
10. 2 Relay Module  Interfacing with Arduino Actual Diagrams
  • I have provided the complete wiring diagram for 2 relay module interfacing with Arduino.
  • Wiring diagram is shown in the figure given below.
11. 2 Relay Module  Interfacing with Arduino Source Code & Description
  • If you are new to Arduino software then you must have a look at How to write Arduino code.
  • You just need to copy and paste the source code given below in your Arduino software.
  • The complete source code for 2 relay module interfacing with Arduino is given below.
int relay1 = 6;
int relay2 = 7;  

void setup() {
  
  pinMode(relay1, OUTPUT); 
  pinMode(relay2, OUTPUT);
}

void loop() {

   digitalWrite(relay1,LOW);
   delay(1000);
 
   digitalWrite(relay1,HIGH); 
   delay(1000);
   
   digitalWrite(relay2,LOW); 
   delay(1000);
   
   digitalWrite(relay2,HIGH); 
   delay(1000);
}
  • First of all I have defined relay pins.
  • Then I have changed the mode of these pins to output.
  • After that I have turned on and off both of the relays with the delay of 1 sec or 1000 msec.
  • So, that was the brief description about the source code for 2 relay module interfacing with Arduino.
  • You can download the wiring diagram and complete Arduino source code here by clicking on the button below.

12. 2 Relay Module  Features
  • The most common features associated with 2 relay module are provided in the table shown in the figure given below.
13. 2 Relay Module  Application
  • 2 relay module applications are given in the table shown in the figure below.
In the tutorial 2 Relay Module Interfacing with Arduino, we have learnt about the components used in the design of 2 relay module. We have also learnt about the 2 relay module interfacing with Arduino. I have provided the complete Arduino source code, you can control this module using the same code. I hope you have enjoyed the tutorial. If you have any problem you can ask us in comments. Out team is 24/7 available for you. I will share different informative engineering topics in my upcoming tutorials. So, till my next tutorial, take care and bye :)

Introduction to Pixy Camera

Hello everyone! I hope you all will be absolutely fine and having fun. Today, I am going to give you an elaboration about Introduction to Pixy Camera. It is basically is an electronic device or sensor having fast vision. It is also known as fast vision sensor most of the time. Using this device we can teach to find objects in a very less time duration. It is an image sensor having a very powerful processor. Pixy is easy to interface with the micro-controllers e.g. Arduino. We can make different programs only to send the desired data from the device to micro-controller. In this way micro-controller can not overwhelm. Pixy camera is able to communicate with the micro-controller in several different ways e.g. serial communication, I2C protocol, digital out, analog out and SPI communication techniques. Using this type of communication between pixy camera and micro-controller we can also perform other tasks when camera is communicating with micro-controller. We can also attach multiple pixy cameras with a single micro-controller. Its normal mean of image detection is through RGB (Red Green Blue) color detection technique. Moreover, it can also detect different images using hue and saturation techniques. Light doesn't effect the image detection of this camera. Its a huge problem while doing image processing techniques. This module has an ability to find hundreds of objects simultaneously and it can remember seven different types of colors. It detects images with a very fast processing speed of 50 frames per second. It is a low cost and highly efficient device available in the market. The further detail about introduction to pixy camera will be given later in this section.

Introduction to Pixy Camera

Pixy camera is a fast vision electronic device. It can capture 50 frames per second. It can communicate with the mirco-controller using different types of communications e.g I2C protocol, SPI and serial communication. Its image detection technique is not effected by the light like all other devices. It cam remember 7 different colors simultaneously. Its a low cost device. It also uses hue & saturation technique for image detection. Pixy-camera is shown in the figure given below.
1. Pixy Camera Pins
  • It has six pins having assigned with different tasks.
  • All the pins are given in the table shown in the figure given below.
2. Pixy Camera Pinout
  • Pinout diagram tells us about the complete information of all the pins of any device.
  • Pixy-camera pinout diagram is given in the figure shown below.
3. Pixy Camera Technical Specifications
  • Technical specifications tell us about the efficiency and different tasks whether they can be performed by it or not.
  • Pixy-camera technical specifications are listed in the table shown in the figure given below.
4. Pixy Camera Features
  • Any device can become a lot popular only on the basis of its unique features.
  • Pixy-camera features are listed in the table given in the figure shown below.
5. Pixy Camera Communication Techniques
  • Pixy-camera has an ability to communicate with the micro-controller in different ways.
  • Alla the communication mediums are provided in the table shown in the figure below.
6. Pixy Camera Result Visualization
  • Its results can be visualized on an application named as Pixy Mon.
  • Pixy Mon is an applications that is able to run on computer or MAC.
  • Using this application we can visualize, that pixy-camera sees, in the form of either raw video or processed video.
  • While using pixy camera, you must know about How to Train Pixy Camera with Computer.
  • Pixy set the output port and manage colors.
  • USB cable maintains communication between pixy mon and pixy-camera.
7. Pixy Camera Problems
  • Each electronic device has its pros and cons, similarly pixy-camera has also some issues with it.
  • The two major problems associated with the pixy-camera are listed in the table shown in the figure given below.
8. Pixy Camera Applications
  • Pixy-camera has several different real life applications.
  • Some of the major applications are provided in the table shown in the figure below.
  The tutorial Introduction to Pixy Camera has provided the detailed discussion on the basics of this module. I hope this tutorial is proved to be an informative for you and you will enjoy this tutorial. You can ask us if you have any problem. I will try me best to help out you. I will share different informative topics in my upcoming tutorials. Till my upcoming tutorial, taker care and bye :)

PIR Sensor Arduino Interfacing

Hello everyone! I hope you all will be absolutely fine and having fun. Today, I am going to provide the detailed discussion on PIR Sensor Arduino Interfacing. PIR basically stands for Passive Infrared Sensor. Basically PIR is an electronic equipment which is often used to measure the infrared light radiating from the different objects in their field of view. It detects the infrared energy released from animals as well as from human beings, when this energy is higher than the certain threshold level PIR sensor shows an indication correspondingly. The energy detected by PIR sensor is usually in the form of heat i.e. emitted by humans as well as from animals. We can also test and verify our results in Proteus using PIR sensor. I have already shared PIR Sensor Library for Proteus. PIR sensor is most of the time used for sensing the motion of the different objects. It can sense the different objects up to 10 meters. It has three different pins. Each pin is assigned with the different task to be performed when the sensor is in working condition. PIR sensor has several different features like wide voltage supply ranges, automated induction, photosensitive control, low micro-power consumption, high output signal and many more. PIR (Passive Infra Red) sensor is most of the time used in security systems. Moreover, it can be used in OEM applications, automatic illuminating devices, building detection, building automation, alarm & security systems and at a lot more places in real life. The further detail about PIR Sensor Arduino Interfacing will be given later in this tutorial.

PIR Sensor Arduino Interfacing

PIR sensor stands for Passive Infra Red sensors. As it is clear from its name that PIR is an electronic device or sensor used to measure the infrared energy emitted by animals and human beings. This energy is emitted in the form of heat. When this energy is above the certain level, there is algorithm to show an an indication that the desired level has be reached. This tutorial is based on PIR interfacing with Arduino. PIR sensor is shown in the figure below along all of its pin names.
1. PIR Sensor Pins
  • PIR sensor has three pins voltage, output and ground respectively.
  • All of the pins are provided in the table shown in the figure given below.
2. PIR Sensor Pins Description
  • Each pin has different task to perform while the sensor is in working condition.
  • PIR sensor pin descriptions are listed in the table shown in the figure below.
3. PIR Working Principle
  • PIR sensor has two different slot which are sensitive to infrared light/energy.
  • When the sensor is in normal condition, both of the slots measure the same amount of infrared energy radiated by walls etc.
  • When a warm body e.g animals and human beings crosses its coverage area, they first cross PIR sensors's first slot, which produces positive differential change between two slots.
  • When an animal or human being leave from the sensing area, a corresponding negative differential change is produced.
  • By detecting these types of changes PIR sensor can detect the motion of different objects which radiates infrared energy.
  • I have tried to elaborate the PIR working principle through some visuals shown in the figure given below.
  • I have also provided the visuals about how PIR sensor generates an output signal after sensing different objects/
  • PIR sensor object sensing is given in the figure shown below.
4. PIR Sensor Schematic Diagram
  • To understand the internal structure of any electronic device, we must have a look at its schematic diagram.
  • PIR sensor schematic diagram is shown in the figure given below.
5. Apparatus Required
A list of apparatus required for PIR interfacing with Arduino is given below.
  • PIR (Passive Infra Red) Sensor
  • Arduino (Microcontroller)
  • Jumper wires
6. PIR Interfacing with Arduino Wiring Diagram
  • I have already shared a brief article on Interfacing PIR sensor with Arduino.
  • Now, this is a detailed article about the similar topic.
  • I have provided wiring diagram for PIR interfacing with Arduino.
  • You can make the similar wiring diagram and can test and verify your results as well.
  • PIR Sensor Arduino Interfacing wiring diagram is shown in the figure given below.
7. PIR Sensor Arduino Interfacing Source Code and Description
  • If you have never use Arduino software for programming then you should first go through How to Write Arduino Code.
  • I have provided the complete source code for PIR interfacing with Arduino.
  • You just need to copy and paste the entire code and upload it to your Arduino board and observe the results.
  • You can also made the same simulation on Proteus as well and can verify the results.
  • In case of Proteus simulation you must need to know about How to get Hex File from Arduino.
int LED = 13;                
int inputPin = 2;               
int PIR_STATE = LOW;             
int VALUE = 0;                   
 
void setup() {
  pinMode(LED, OUTPUT);      
 
  Serial.begin(9600);
}
 
void loop(){
  VALUE = digitalRead(inputPin); 
  if (VALUE == HIGH) {           
    digitalWrite(LED, HIGH); 
    if (PIR_STATE == LOW) {
      // we have just turned on
      Serial.println("Motion has been detected!");
      PIR_STATE = HIGH;
    }
  } else {
    digitalWrite(LED, LOW); 
    if (PIR_STATE == HIGH){
      // we have just turned of
      Serial.println("Motion has been stopped!");
      PIR_STATE = LOW;
    }
  }
}
  • I have initialized the LED pin, PIR state pin and the pin and a variable for reading sensor's data.
  • Then I have checked whether the detected value from the sensor is above or below the certain level.
  • Then I have decide to be print the certain values on Serial Monitor.
  • If it is above the certain level a message "Motion has been detected" will be displayed on the serial monitor through Serial Communication.
  • If the detected value is below the certain level then the message "Motion has been stopped" will be displayed on the serial monitor in Arduino software.
  • So, that was the brief description of the source code designed for PIR interfacing with Arduino.
  • You can download the complete wiring diagram along with the complete Arduino source code here by clicking on the button below.

8. PIR Sensor Interfacing with Arduino Actual Circuit Diagram
  • I have also provided the actual circuit diagram for PIR interfacing with Arduino.
  • Actual circuit diagram is shown in the figure given below.
9. PIR Sensor Ratings
  • To know the power, current and voltage requirements of an electronic device can be known through its ratings.
  • PIR sensor ratings are listed in the table given in the figure shown below.
10. PIR Sensor Features
  • A device can be popular on the basis of its amazing and unique features, which make it different from other devices.
  • PIR sensor some of the main features are listed in the table given in the figure shown below.
11. PIR Sensor Applications
  • PIR sensor has several different real applications.
  • Some of common applications associated with PIR sensor are provided in the table shown in the figure given below.
  • I have provided a circuit designed for security alarm system, which is its most common application.
  • The complete circuit design for security alarm system is given in the figure shown below.
  • PIR sensor's another application is making a timer circuit using PIR.
  • I have provided timer circuit using PIR sensor, shown in the figure given below.
  • Another most common application of PIR sensor is the motion detection.
  • Motion detection circuit diagram using PIR sensor is shown in the figure given below.
12. PIR Sensor Advantages
  • There are a lot of advantages associated with Passive Infrared Sensor, few of them are given below.
13. PIR Sensor Disadvantages
  • Infrared sensors also have some disadvantages but they are in a very small as compared to its disadvantage.
  • Infrared sensor disadvantage are listed in the table given in the figure shown below.
The tutorial PIR Sensor Arduino Interfacing has provided the detailed discussion about the interfacing of PIR sensor with Arduino. If you feel any problem in PIR Sensor Arduino Interfacing, you can ask me in comments anytime. I will try me level best to entertain you and to solve your problems. I will share further informative topic in my later tutorials. Till then take care and bye :)

DHT11 Arduino Interfacing

Hello everyone! I hope you all will be absolutely fine and having fun. Today, we will have a look at the DHT11 Arduino Interfacing. DHT11 is an embedded sensor, used to measure both temperature and humidity of the surroundings. It is made up of two different parts i.e. capacitive humidity sensor and a thermistor. DHT11 is a slow sensor but is quite efficient for the applications where we need to do some basic analog data exchange. There is a small chip inside this sensor which performs the function of analog to digital to analog conversion and gives the results for temperature as well as for humidity in digital form. This digital signal can be read easily through any micro-controller.

LM335 is another temperature sensor and to understand today's post more properly, you should also go through Introduction to LM335. DHT11 is a low cost sensor and is easily available in the market now a days. This property makes it more popular among the similar type of sensors. It provide precise results with the higher efficiency. It has a small size and low power consumption. It can transmit the signal up to 20 meters. It has four pins whose detail will be explained later. DHT11 has a lot of features including low cost, long term stability, fast response time, excellent quality, long distance signal transmission and many more. In real life DHT11 can be used at several different places e.g. home appliances, weather stations, consumer goods etc. the further detail about DHT11 Arduino Interfacing will be given later in this tutorial.

Where To Buy?
No.ComponentsDistributorLink To Buy
1DHT11AmazonBuy Now
2Arduino UnoAmazonBuy Now

What is DHT11 Sensor?

  • DHT11 is an electronic sensor, consists of 4 pins and is used to measure the temperature and humidity of the surroundings.
  • DHT Pinout is as follows:
    1. Pin#1: Vcc (+5V)
    2. Pin#2: Out (digital)
    3. Pin#3: NC (Not Connected)
    4. Pin#4: GND (Ground)
  • It has both a capacitive humidity sensor and a thermistor embedded in it.
  • It is a low-cost sensor but provides precise results and it gives value once every 2 seconds.
  • DHT11 measures the relative humidity of the surrounding.
  • It is used in home appliances, weather stations, medical humidity control, data loggers, HVAC and at several security places.
  • DHT11 along with its pinout is shown in the figure given below.

DHT11 Pinout

  • Before using any electronic device we must know about the functions of its all pins.
  • DHT Pinout is as follows:
    1. Pin#1: Vcc: We need to provide +5V to this pin.
    2. Pin#2: Out: Output Pin for reading DHT11 data.
    3. Pin#3: NC: It's an open pin and is not connected to anything(For future use).
    4. Pin#4: GND: Need to provide ground to this pin.
  • DHT11 pin description is provided in the below table:

DHT11 Working Principle

  • In order to measure temperature, DHT11 uses a thermistor also known as NTC (Negative Temperature Coefficient) temperature sensor.
  • A thermistor is simply a variable resistor, which changes its resistance with respect to the temperature.
  • A thermistor is made up of sintering of semiconductors in order to provide a large change in its resistance with the small changes in temperature.
  • NTC means the resistance decrease with the increase in temperature.
  • I have provided a visual display of the relation between temperature and resistance for the DHT11 sensor, shown in the below figure:
  • For humidity sensing, DHT11 uses a capacitive humidity sensor.
  • The humidity part consists of two electrodes having moisture-holding substrates in between them.
  • As the humidity level changes, the resistance between both of the electrodes or conductivity also changes correspondingly.
  • This change in conductivity or resistance is estimated and processed by an internal IC.
  • I have also provided the visual description of humidity sensing using DHT11 sensor, as given in the figure shown below.

DHT11 Temperature Sensing Characteristics

  • The temperature sensing characteristics of the DHT11 sensor are listed in the below table:

DHT11 Humidity Sensing Characteristics

  • The humidity sensing characteristics of the DHT11 sensor are listed in the below table:
Note: I have also made some LabVIEW simulations for temperature measuring and conversion, their links are shared below.

Components Required for DHT11 Arduino Interfacing

As its a simple project, so we are going to need few components, listed below:

  • DHT11 Sensor (Temperature and humidity sensor)
  • Arduino UNO (Microcontroller Board)
  • Jumper wires (Male to Female)

DHT11 Arduino Interfacing

  • The connections between Arduino and DHT11 pins are shown in the figure given below.
  • The circuit diagram for DHT11 Arduino Interfacing is given in the below figure:

Arduino Code

  • If you have not written Arduino code before, you must have a look at How to Write Arduino Code.
  • You just need to copy and paste the source code given below into your Arduino software.
  • After that just upload the code into your Arduino board to test the results.
#include<dht.h>// DHT11 humidity sensor library
dht DHT; //Creating sensor object
#define DHT11_PIN 2 // Sensor is connected to Arduino pin 2
void setup()
{
  Serial.begin(9600); //setting baud rate
  Serial.println("   =====================================================");
  Serial.println("   ||   Welcome to Temperarue and Humidity Detector   ||");
  Serial.println("   =====================================================");
  Serial.println("");
  }
void loop()//method used to run the code repeatedly
{
  int chk = DHT.read11(DHT11_PIN); //Reading data from sensor
  Serial.print(" Humidity = ");//prints on the serial monitor
  Serial.print(DHT.humidity);// prints obtained humidity on serial port
  Serial.print(" g/m^3");
  Serial.print("    \tTemperature = ");//prints on the serial monitor
  Serial.print(DHT.temperature, 1);//prints obtained temperature on serial port
  Serial.println(" degrees");
  
  delay(2000);//adding the delay of 2 seconds
  }
  • First of all, I have defined the library for the DHT11 sensor.
  • After that, I have read the humidity and temperature values from DHT11 sensor in digital form.
  • Then I have printed the digital values of both humidity and temperature on the Arduino Serial Monitor.
  • We can print the values obtained from the sensor on the serial monitor using Serial Communication.
  • So that was the brief description about DHT11 interfacing with Arduino.
  • You can download DHT11 library, wiring diagram and complete Arduino source code here by clicking on the button below.

Temperature & Humidity Results on Serial Monitor

  • I have printed the digital values obtained from DHT11 sensors.
  • Both temperature and humidity digital values are given in the figure shown below.

DHT11 Sensor Interfacing with Arduino Circuit Diagram

  • I have provided an actual circuit diagram for DHT11 sensor interfacing with Arduino.
  • Actual circuit diagram is given in the figure shown below.

DHT11 Features

  • The features are such parameters depending upon which a device can flop as well as features that can make a device more popular due to their uniqueness.
  • DHT11's major features are provided in the table given in the figure shown below.

DHT11 Applications

  • Most of the devices are usually known by their range of applications.
  • DHT11 sensor applications are given in the table shown in the figure below.

That is all from today's tutorial. If you have any problem you can ask me in comments any time you want. Till my next tutorial bye :)

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