GSM Based Home Security System

Hello friends, I hope you all are fine and having fun with your lives. Today, I am going to share a complete project named as GSM Based Home Security System. I have designed its complete working simulation in Proteus and have used different libraries which you can also download from our blog. In the previous post, I have posted Home Automation Project using XBee & Arduino and today we are gonna work on Home Security System.

We have designed this simulation after a lot of efforts that's why we have placed a very small amount of $50 on it so that engineering students can download it and get knowledge from it. Moreover, as its a complex project so when you buy it then there's a chance that you can't run it by yourself so we also offer a free service. If you got into any trouble while running this simulation then use our Contact Form we will help you out personally within 24 hours.

GSM based Home Security System

  • You can buy this complete project by clicking the below button:

Buy This Project

  • When you will click the above button, you will be taken to the sale page for this project and you can buy this project using PayPal.
  • When you buy it you will get the complete code along with working Proteus simulation.
  • So, let's have an overview of this GSM Based Home Security System.
  • This GSM based Home Security System contains seven sensors which will be installed theoretically in your home. :)
  • These seven sensors are:
    1. PIR Sensor: For Motion Detection.
    2. Smoke Sensor: For Smoke Detection.
    3. Flame Sensor: For Fire Detection.
    4. Vibration Sensor for Window: For Detection of vibrations on Window.
    5. Vibration Sensor for Door: For Detection of vibrations on Door.
    6. Ultrasonic Sensor for Window: For intruder Detection on Window.
    7. Ultrasonic Sensor for Door: For intruder Detection on Door.
  • When we are talking about security then we have to take care of door and windows.
  • That's why I have placed two sensors on each of them. If someone tries to break the window then the vibration sensor will sense it and if someone tries to open the window then ultrasonic sensor will detect it.
  • The same will happen for the door.
  • So, whenever any of these seven sensors will get activated then the buzzer will go on and at the same time the user will receive a warning message.
  • Moreover, I have also placed an LCD which will display the sensors' condition.
  • Here's the Proteus Simulation for this GSM based Home Security System:
  • You can see in the above figure that I have used all these seven sensors mentioned above.
  • Moreover, I have used the GSM module, you can read more about it on GSM Library for Proteus.
  • Moreover, we have the Power circuit and the Buzzer Driver Circuit at the bottom.
  • Arduino UNO acting as the brain of this GSM Based Home Security System.
  • Now, let's run this simulation and if everything goes fine then you will get something as shown in below figure:
  • First of all, the system will configure the GSM module and then it will display two screens on LCD side by side.
  • First LCD screen is shown in below figure:
  • The first screen will show the status of first three sensors.
  • Now here's the screenshot of second screen showing the status for next four sensors:
  • That's how this project is working, now when any of these sensors got HIGH then buzzer will go ON and a message will be sent to the given number:
  • Now, you can see when I click the Smoke Sensor HIGH, it got detected immediately and a warning message is sent to my number.
  • I have explained this GSM based Home Security System in detail in the below video:
So, that's all for today. I hope you guys have enjoyed this awesome project. Before buying it, you must read it completely and also watch the video so that you are sure about what you are buying.

Home Automation Project using XBee & Arduino

Hello friends, I hope you all are fine and having fun with your lives. Today, I am going to share a new Home Automation Project using XBee & Arduino. Home Automation Project is a most commonly designed project by the engineering students. So, that's why I have thought to create a complete Home Automation Project so that engineering students can get benefit out of it.

We all know about automation which is originated from automate or automatic. In automation the task is done automatically and you don't need to control it. In normal Home automation project, there are few sensors which are displayed wirelessly to user and there are few controls like user can ON or OFF Lights, Fans etc via remote or mobile App.

In this Project, I have used Arduino UNO board and I have designed its complete working simulation in Proteus software, so that users got sure that its working perfectly. Because we have to work a lot in designing this complete working simulation of home Automation Project that's why its not free but you can buy it for a small price of $50. In this price, you will get the compelte Arduino code along with the working Proteus Simulation. But before buying this project, must have a look at the details below so that you are sure what you are buying. So, let's get started with Home Automation Project using XBee & Arduino.

Home Automation Project using XBee & Arduino

  • You can buy the complete working Proteus Simulation along with the Arduino Programming Code by clicking the below button.
  • You can pay via Paypal and the download link will be instantly available to you and if you don't have the PayPal account then use our Contact Us Form and we will find some other way for you.

Buy This Project

1: Overview
  • First of all, let's have an overview of this Home Automation Project.
  • In this Project, I have designed two simulations, one simulation is for Remote using which we are gonna control our appliances and the second simulation is for the controlling of these appliances.
  • So, when you press buttons from your remote section, a wireless command will be sent to the control board and it will turn ON or OFF the respective load.
  • Moreover, there's an LCD on the Remote on which you will also check the values of the sensors.
  • So, in simple words, the remote will be in your hand and using this remote you can easily turn ON or OFF your appliances and can also check the status of your different sensors wirelessly.
  • Let's first have a look at the remote section:
Remote Control:
  • In Remote Control Section, I have used the below main modules:
    • Arduino UNO: Microcontroller Board.
    • KeyPad: Commands will be sent by clicking this Keypad's buttons.
    • LCD (20 x 4): For Displaying Sensor's Data & Commands.
    • XBee Module: It's an RF Module used for sending wireless commands.
  • Now when you click any button on your Keypad, a command is sent from Arduino to XBee Module and the XBee module then forwards that command to other XBee on the Control Unit.
  • Moreover, when the Control Unit sends the Sensors' data on xbee then Arduino receives that data and then displayed that data on LCD.
  • Here's the block diagram of Remote control section which will give you a better idea of its working:
  • Here's the Proteus Diagram of our Remote Section:
  • In the above Proteus Simulation of Remote Control, you can see that we have Arduino UNO board which is connected with LCD, KeyPad and XBee Module.
  • Working of this Remote section will be discussed in the later section.
  • Now let's have a look at the Control Unit Side of Home Automation Project.
Note:You must also have a look at below tutorials because I have interfaced these modules separately with Arduino as well: Control Unit:
  • In the previous section, we had an overview of the Remote section, now let's have a look at the Control Unit.
  • The Control Unit is the Unit which is being controlled by the Remote Control.
  • The Main components of Control Unit are:
    • Arduino UNO: Microcontroller Board.
    • Relays: Used to control the appliances. I have added eight relays so you can control eight appliances.
    • Lamps: Indicating the Bulbs.
    • DC Motors: Indicating the Fans.
    • Smoke Sensor: Used to detect the Smoke.
    • Flame Sensor: Used for Fire detection.
    • DS18B20: Used to measure atmospheric temperature.
Note:
  • On this Control unit, the Arduino UNO is getting the data from the smoke sensors and then sending this data via XBee to Remote Control.
  • We have seen in the previous section that this data is then displayed over LCD.
  • Moreover, when any button is pressed from the Remote Control, the command is received by this Arduino via XBee.
  • On receiving this command, Arduino UNO then turns ON or OFF the respective relay which in turn ON or OFF the respective appliance.
  • Here's the block diagram of this control unit:
  • You can see in the above block diagram that I have connected three sensors with Arduino and Arduino is receving their values and then sending these values to the remote control via XBee.
  • Moreover Relays are also connected to Arduino and then loads are further connected to these Relays.
  • So, Arduino is controlling these Relays which in turn are controlling the loads.
  • I have used eight relays and hence eight loads.
  • The Loads I have used are all DC loads because Proteus doesn't have AC active loads in it but you can place AC loads as well.
  • Here's the Proteus Simulation of Control Unit:
  • You can see all the modules are present in it.
  • Eight relays are present on the right side and their outputs are going into the loads.
  • I have used four lamps and four DC Motors.
  • Now let's have a look at their operation.
Note:You should also have a look at below tutorials in which I have interfaced these sensors separately with Arduino:
2: Operation
  • I have already mentioned their operation in above section so I am not gonna discuss it in detail.
  • But let's have a little talk about their operation.
  • First I am gonna discuss the operation of Remote Control:
Remote Control:
  • The remote Control has an XBee module which is used for wireless communication.
  • The Keypad has buttons on it so now when you press button "1" on the keypad then the Signal is sent via XBee to Control Unit.
  • The control unit will automatically turn on the first load when it will receive the command from button "1" of Remote Control.
  • When you press "1" for the first time then the first load will turn ON but when you press button "1" again then the first load will go off.
  • So, its like if you want to turn it ON then press it and if you want to turn it OFF then press again. (Quite simple :P)
  • As there are eigth loads, so button "1" to "8" are working for loads "1" to "8" respectively.
  • Moreover, when sensor's data come from control unit then it is updated in the LCD of Remote Control.
  • Now let's have a look at the operation of Control Unit:
Control Unit:
  • As the Control Unit is concerned, it keeps on waiting for the command from remote and whenever a command is received from the Remote Control, it turns ON or OFF the respective load.
  • Moreover, it also sends the data of sensors continuously to the Remote Control.
  • For this wireless communication, XBee is used here.
3: Working
  • This is the last section of this project where will will have a look at the working of the project.
  • I haven't divided this section in parts instead I have create a video which will explain the working in detail.
  • Here's the First look of Remote section image while working:
  • Now when the Sensor's data come from the remote Section then it will be displayed in the LCD as shown in below figure:
  • You can see in the above figure that both sensors are detecting and the temperature is also displayed in the LCD.
  • Now the complete working of this project is shown in the below video which will give you complete idea of this project:
Note:
  • If you buy this project and you are unable to run it properly then we will provide you free service and will make it work on your laptop perfectly. :)
So, that's all for today. I hope you have liked this Home Automation Project and are gonna buy this one. But again before buying it must read this tutorial and also watch the video so that you get complete understanding of this project.

Interfacing of Flame Sensor with Arduino

Hello friends, I hope you all are fine and having fun with your lives. Today, I am going to share a new tutorial which is Interfacing of Flame Sensor with Arduino. I have recently posted a tutorial in which I have shared the Flame Sensor Library for Proteus. Now in this tutorial, I am gonna use that Flame Sensor Library and will interface this Flame Sensor with Arduino. So, if you haven't downloaded this file then I suggest you to download this Flame Sensor Library so that you can easily simulate this flame Sensor in Proteus.

I am sharing interfacing of this Flame Sensor with Arduino today, but soon I will also post a tutorial on Interfacing of Flame Sensor with PIC Microcontroller. If you guys have any questions then ask in comments. I have also given the Simulation file and the Programming code below to download. But I would recommend you to design this proejct on your own so that you make mistakes and then learn from them. So, let's get started with Interfacing of Flame Sensor with Arduino:

Interfacing of Flame Sensor with Arduino

  • You can download the complete Proteus Simulation along with Arduino programming code from the below button:

Download the Simulation

  • Now design a small Arduino code as given below:
#include <LiquidCrystal.h>

LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

int Flame = 7;

void setup() {
  Serial.begin(9600);
  pinMode(Flame, INPUT_PULLUP);
  lcd.begin(20, 4);
  lcd.setCursor(0,0);
  lcd.print("Flame : ");
  lcd.setCursor(1,2);
  lcd.print("www.TheEngineering");
  lcd.setCursor(4,3);
  lcd.print("Projects.com");
}

void loop() {
  if(digitalRead(Flame) == HIGH){lcd.setCursor(8,0);lcd.print("Detected    ");}
  if(digitalRead(Flame) == LOW ){lcd.setCursor(8,0);lcd.print("Not Detected");}
  
}
  • Add this code in your Arduino software and compile it to get the Hex File from Arduino Software.
  • Upload this hex file in your simulation and then run your simulation and if everything goes fine then you will get something as shown in below figure:
  • In the above figure, you can see the sensor is off that's why in the LCD its written that no smoke detected.
  • Now, let's bring some Flame by clicking the Logic State on Flame Sensor and you will see the below results:
  • Now you can see in the above figure that when the Flame is detected then the LCD indicated that Flame has detected.
  • That's how we can easily simulate the Flame Sensor with Arduino.
  • I have explained this project in detail in the below video:
That's all for today. I hope you have enjoyed this project and now you can easily interface your Flame Sensor with Arduino in Proteus ISIS.

Arduino Vs Raspberry Pi

Hello friends, I hope you all are fine and enjoying your lives. Today, I am going to share a comparison titled Arduino Vs Raspberry Pi. Actually, I have been receiving a lot of emails and comments from new engineering students that "we are new in embedded and we want to start our project so please tell us which one is better Arduino or Raspberry Pi?" So, I thought to write a post on Arduino Vs Raspberry Pi and in this post, I am going to make a detailed comparison between the two and will let you know, which one you should use in your project and why?

So, I hope that you are all aware of or at least have heard about these two boards, which are Arduino and Raspberry Pi. If you haven't heard yet then you must have a look at Arduino Official Site and Raspberry Pi Official Site. They will give you a basic overview of what these boards are. Anyhow, I am going to start it from the very basics so that you guys won't get into much trouble. So, let's get started with Arduino Vs Raspberry Pi:

Where To Buy?
No.ComponentsDistributorLink To Buy
1Arduino Mega 2560AmazonBuy Now
2Arduino NanoAmazonBuy Now
3Arduino Pro MiniAmazonBuy Now
4Arduino UnoAmazonBuy Now
5Raspberry Pi 3AmazonBuy Now
6Raspberry Pi 4AmazonBuy Now
7Raspberry Pi PicoAmazonBuy Now
8Raspberry Pi ZeroAmazonBuy Now

Arduino Vs Raspberry Pi

I have created few points below and in each of these points, I have made the difference between these two boards. I have also mentioned their strengths and weaknesses and which one to use. Obviously, they both have their own importance so we can't say that one is better than the other. Instead, we are making a comparison between the two and then you will get a clear idea of which one you should use for your project. The selection of your controller board actually depends entirely on the nature of your project. Am I getting far :O don't worry if it's more to digest about Arduino Uno R3 Vs Raspberry PI 3, I am explaining them below in detail. :D

1. History

Arduino:

  • The idea of Arduino was first presented by Massimo Banzi in Italy. That's why it's written Made in Italy on each of these boards. :)
  • Banzi was a teacher at Interaction Design Institute Ivrea and the reason for designing these boards was to help his students by giving them an easy-to-use platform.
  • So that, students don't waste much time over soldering etc and spend more time in designing the algorithms.
Raspberry Pi:
  • Raspberry Pi was first invented by Eben Upton in the United Kingdom.
  • He was also a teacher and he has the same reason for developing these boards.
  • He also wanted to help his students so that they learn more out of it.
  • Upton was a Professor at the University of Cambridge.
Obviously, they both have co-founders, who have helped them a lot in bringing these ideas to existence. So, let's move on to the next step of this Arduino Vs Raspberry Pi comparison.

2. Nature of Arduino & Raspberry Pi

Arduino:
  • The Arduino boards are actually Microcontrollers boards but in a very easy-to-use form.
  • Have you ever worked on PIC Microcontroller, Atmel or 8051 Microcontroller?
  • If you have worked on standalone microcontrollers, you must be aware of Microcontroller basic circuit, which includes crystal oscillator and pull-up resistors, capacitors etc.
  • Moreover, you also need the programmer/burner hardware using which you upload your code into these microcontrollers.
  • But in Arduino, you don't need to use any of these. Arduino comes with a built-in programmer and an onboard basic circuit for powering up the microcontroller.
  • So, what you need to do is simply plug Arduino board and start testing your code.
  • So, in simple words, Arduino is nothing but a simple microcontroller board.
Raspberry Pi:
  • Now if we talk about Raspberry Pi, it's a mini-computer and is actually termed a microprocessor.
  • Raspberry Pi has onboard RAM, ROM, i/O Ports, USB Ports, HDMI Port etc.
  • Seems quite powerful than Arduino but don't come to a conclusion right away :)
  • But yes Raspberry Pi is like a small computer, obviously, it's not comparable with your Laptop or PC but it's really powerful.
  • And the beauty of it lies in the small size and low price.
  • The latest Raspberry Pi even has a RAM of around 3GB, which is quite a lot. I am using Note 3 Mobile and it has 3GB RAM. So, now you can get an idea of what it is capable of.
  • As it's a small computer so you must be thinking what its operating system. When it comes out of the factory, it has no operating system on it but one can install any operating system like Linux, Windows etc.
  • Normally it is used with Linux and its current operating system is called Raspbian.
So, from the above discussion, we concluded that Arduino is a Microcontroller board while Raspberry Pi is a mini-computer. Next, we are going to have a look at the type of Arduino Vs Raspberry Pi.

3. Types of Arduino Vs Raspberry Pi

Arduino:
  • The first board developed by the Arduino company was Arduino UNO which uses Atmega328 Microcontroller but later on, they have developed many new boards.
  • For example, now we have Arduino Ethernet Shield, Arduino Wifi Shield using these we can provide Internet access to our system.
  • Recently they have also developed the Arduino YUN board, which also supports Linux just like Raspberry Pi.
  • Arduino Due is another board that works on a 32-bit instruction set.
  • So, in short, there are a lot of Arduino boards and by combining different boards you can accomplish anything.
  • Suppose, you want to control your Fan via Wifi then you can use Arduino UNO with Arduino Wifi shield and you can easily design this IoT project and can control the fan over WiFi.
Raspberry Pi:
  • Raspberry Pi doesn't have different boards for different tasks like Arduino.
  • Like once there was Raspberry Pi Model A but then they added some more functionality like increased the RAM end so we have Raspberry Pi 2, Raspberry Pi 3 Raspberry Pi 4 etc.
  • So, you can think of Raspberry Pi as a mobile, whose models come out with more enhancement.
  • As I told you earlier Raspberry Pi is a small computer board so it already has everything in it like Wifi, Ethernet, USB Host etc.
  • Raspberry Pi has recently launched a Microcontroller board called Raspberry Pi Pico, which is available for $4.

4. Programming Code

Arduino:
  • For programming Arduino boards, Arduino has launched official software called Arduino IDE.
  • Arduino uses C programming language with a slight difference in syntax from the original C.
  • It has an extensive list of libraries(mostly third-party) for interfacing sensors and modules.
Raspberry Pi:
  • Raspberry Pi can be programmed in any high-level programming language i.e. python, C# etc.
  • Normally, python is used for programming purposes.

Arduino Vs Raspberry Pi - Which one you should prefer?

For a new Engineering student, who has just started his project. He always wonders which one I should use among these two. Should I go with Arduino or should I start working on Raspberry Pi? It's really a big question if you are new in this field. So, let me tell you one thing first, no one is better than the other, Arduino and Raspberry Pi both have their own importance. Now which one you should use, entirely depends on the nature of your project. So, let's take a look at projects for both of these boards. I think this Arduino Vs Raspberry Pi comparison is now going to take an interesting turn. :)

Arduino:
  • Whenever you are working on some pure hardware-related project, in which you need to use different sensors, need to move your motors or actuators etc. then you should always go for Arduino because Arduino is a microcontroller and its best for hardware equipment controlling.
  • That's why in most of the Electrical, Electronics, Mechatronics and Mechanical Projects, Arduino is preferred.
  • It's not like you can't control sensors or motors on Raspberry Pi but it's too difficult in Raspberry Pi and quite easy in Arduino.
  • Moreover, with Arduino, you can attach as many sensors as you want. In simple words, Arduino has a lot of I/Os.
  • Once I have to work on a project, in which I have to control fifty relays so in that case I have used Arduino Mega 2560 which has around 60 input/Output Pins.
  • But you can't control fifty relays with Raspberry Pi.
  • So, in all the hardware projects where you don't need to do cloud computing, IoT etc. it's always preferred to use Arduino boards.
Raspberry Pi:
  • Raspberry Pi is mostly used in computer software projects i.e. IoT, cloud computing etc.
  • Like you have a project in which you need to send data over to some network, then in these types of projects, your first choice should be Raspberry Pi.
  • I once had a project in which I have to design an online Home Automation system.
  • So, in such projects, we just need to interface few sensors which we can do with the Raspberry Pi as it has few Input/Output Pins.
  • But the main part of such projects is to send sensors data over to some network so Raspberry Pi is the right choice here.
  • Although we can also use Arduino YUN in such projects as well but because Raspberry Pi is programmed in python so it's more flexible to use when it comes to cloud computing.
  • Similarly, if you want to design some Face recognition project then Raspberry Pi comes in handy because we can easily install openCV on it as it's an OS (LINUX), we can install anything we want.

So, that's a kind of an overview on Arduino Vs Raspberry Pi, which I think you guys must have enjoyed. It was quite boring so that's why I have tried my best to make it as interesting as I can, but still, if you find it boring then I can't do anything. :) So, that's all about Arduino Vs Raspberry Pi, I hope you guys have got something out of it. Will see you guys in the next tutorial. Till then take care and have fun. :)

How to Measure Frequency using Arduino

Hello friends, hope you all are fine and having fun with your lives. Today, I am going to share on How to measure Frequency using Arduino board. Its quite a simple tutorial but is an essential one especially when you are working on some power related project. Because in Power projects, you have to measure the frequency of AC voltages. I was working on a project in which I have to do dimming of AC Lamp so in that project I have to measure the frequency of AC signal.

I have designed this project using Arduino UNO and have simulated in the Proteus software, which you all know is my favorite simulating software. :) The code is also quite simple which I have given below for download. The simulation is also included in download package but again I suggest you to design it on your own. If you got into any trouble then ask in comments and I will try to resolve them. Anyways let's get started with How to measure frequency using Arduino.

How to Measure Frequency using Arduino ???

  • You can download the simulation for this frequency measuring by clicking the below button:

Download Project Files

  • Now let's design this project in Proteus. So, first of all, design a simulation as shown in below figure:
  • The small block attached with the pin # 2 of Arduino is a frequency meter.
  • We can create any kind of frequency signal using this component.
  • If you double click it then its properties will open up where you can change the frequency as shown in below figure:
  • You can see in the above figure that I have setted the Clock Frequency to 2000 Hz.
  • Now, let's design the programming code for this project. So, paste the below code in your Arduino software:
#include <LiquidCrystal.h>

LiquidCrystal lcd(13,12,11,10,9,8);

long freq, tempo;
int pulsos;
boolean pulso;
void setup() {
  pulso=HIGH;
  pinMode(2,INPUT);
  lcd.begin(20, 4);
  lcd.setCursor(0,0);
  lcd.print("Frequency =");
  lcd.setCursor(1,2);
  lcd.print("www.TheEngineering");
  lcd.setCursor(4,3);
  lcd.print("Projects.com");
}

void loop() {
  tempo = millis();
  if(digitalRead(2)==HIGH)
  {
    if(pulso==HIGH)
    {
      pulsos = pulsos + 1;
    }

    pulso=LOW; 

  }
  else{
    pulso=HIGH;
  }

  if(tempo%2000==0){
    freq = pulsos/2;
    lcd.setCursor(12,0);
    lcd.print(freq);
    lcd.print("Hz");
    pulsos=0;  
  }
}
  • Now using the above code, get your hex file from Arduino software and upload it in your Proteus software.
  • Now once you are done then run your simulation and if everything goes fine then you will get results as shown in below figure:
  • Now you can see the LCD is showing the same frequency as we set in the properties of the frequency meter.
  • The code is quite simple, I don't think it needs any explanation but if you get into sme trouble then ask in comments.
  • The below video will show you this project in detail:
So, that's all for today. I hope now you know How to measure frequency using Arduino. So, will meet you guys in the next tutorial. Till then take care !!! :)

Interfacing of GPS Module with Arduino in Proteus ISIS

Hello Everyone, hope you all are fine and having fun with your lives. Today, I am going to interface GPS Module with Arduino in Proteus ISIS software. Recently, I have shared this amazing GPS Library for Proteus, using which you can quite easily simulate your GPS Module in Proteus software. Today, I am going to interface this GPS Module with the Arduino UNO board and will simulate the result in Proteus software. I am going to use TinyGPS Library and will get Longitude and Latitude out of this GPS Module.

So, if you are new to GPS and you haven't yet installed the GPS Library for Proteus, then you must first download that library and install it. I am using Arduino board in today's tutorial but you can use any other microcontroller as well like PIC Microcontroller or 8051 Microcontroller. So, let's get started with the Interfacing of GPS Module with Arduino in Proteus ISIS. I have explained this project in detail in the below video:

 

Interfacing of GPS Module with Arduino in Proteus ISIS

  • You can download the complete Simulation along with Arduino Code by clicking the below button, but as I always suggest, design it on your own so that you learn the most out of it.
Download Project Files
  • So, design a simulation in your Proteus software as shown in the below figure:
  • As shown in the above figure, I have used Arduino UNO along with GPS Module.
  • I have used a Virtual terminal to show values getting from the GPS Module.
  • So, I am getting data from the GPS Module via the RX pin of Arduino and then sending this data to Serial Terminal via TX pin.
  • Now, the next thing you need to do is to upload the below code to your Arduino board:
#include <TinyGPS.h>

TinyGPS gps;  //Creates a new instance of the TinyGPS object


void setup()
{
  Serial.begin(9600);  
  Serial.print("Simple TinyGPS library v. "); Serial.println(TinyGPS::library_version());
  Serial.println("Testing GPS");
  Serial.println("Designed by: www.TheEngineeringProjects.com");
  Serial.println();
}

void loop()
{
  bool newData = false;
  unsigned long chars;
  unsigned short sentences, failed;

  // For one second we parse GPS data and report some key values
  for (unsigned long start = millis(); millis() - start < 1000;)
  {
    while (Serial.available())
    {
      char c = Serial.read();
      //Serial.print(c);
      if (gps.encode(c)) 
        newData = true;  
    }
  }

  if (newData)      //If newData is true
  {
    float flat, flon;
    unsigned long age;
    gps.f_get_position(&flat, &flon, &age);   
    Serial.print("Latitude = ");
    Serial.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
    Serial.print(" Longitude = ");
    Serial.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);

  }
 
  Serial.println(failed);
 // if (chars == 0)
   // Serial.println("** No characters received from GPS: check wiring **");
}
  • Now Get the Hex File from Arduino software, and upload it to your Arduino board.
  • Now run your simulation and if everything goes fine then you will get results, as shown in the below figure:
  • Now you can see in the above figure that we have our Latitude and Longitude.
  • This Latitude and Longitude will not change because we have added the dummy values in our GPS module.
  • So, that's how you can quite easily simulate your GPS module with Arduino in Proteus ISIS.

If you have any questions then ask in the comments and I will try to resolve them. Take care. :)

DS1307 Arduino based Digital Clock in Proteus

Hello everyone, today I am going to share a complete project which is DS1307 Arduino based digital Clock in Proteus ISIS. In this project, I have designed a digital clock using Arduino UNO and DS1307 RTC Module. So, first of all, if you haven't yet installed then, you should install Arduino Library for Proteus using which you will be able to easily simulate Arduino baords in Proteus. Along with Arduino Library you will also need to install DS1307 Library for Proteus, which I have shared in my previous post as we are gonna use this RTC Module DS1307 for designing our digital clock.

So, now I hope that you have installed both these libraries successfully and are ready to design this DS1307 Arduino based Digital Clock. I have given the Simulation and Code for download below but as I always advise, don't just download the files. Instead design your own simulation and try to write your own code. In this way, you will learn more out of it. So, let's get started with DS1307 Arduino based Digital Clock in Proteus ISIS:

DS1307 Arduino based Digital Clock in Proteus

  • You can download the complete Proteus Simulation along with Arduino Code by clicking the below button.
  • You will also need DS1307 Library for Arduino, which is also available in this package.

Download Project Files

  • Now, let's get started with designing of this DS1307 Arduino based Digital Clock.
  • So, first of all, design a circuit in Proteus as shown in below figure:
  • You can see in the above figure that I have used Arduino UNO along with RTC module, LCD and the four buttons.
  • These four buttons will be used to change the year,date etc as mentioned on each of them.
  • Now here's the code for DS1307 Arduino based Digital Clock.
#include <LiquidCrystal.h>
#include <DS1307.h>
#include <Wire.h>

LiquidCrystal lcd(13,12,11,10,9,8);

int clock[7];

void setup(){
for(int i=3;i<8;i++){
 pinMode(i,INPUT); 
}

lcd.begin(20,2);
DS1307.begin();
DS1307.setDate(16,4,7,0,17,50,04);//ano,mes,dia,semana,horas,minutos,segundos
}

void loop(){
DS1307.getDate(clock);

lcd.setCursor(0,1);
lcd.print("Time: ");
Print(clock[4]);
lcd.print(":");
Print(clock[5]);
lcd.print(":");
Print(clock[6]);
lcd.setCursor(0,0);
lcd.print("Date: ");
Print(clock[1]);
lcd.print("/");
Print(clock[2]);
lcd.print("/");
lcd.print("20");
Print(clock[0]);

if(digitalRead(7)){
 clock[5]++;
 if(clock[5]>59) clock[5]=0;
 DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]);
 while(digitalRead(7));
}

if(digitalRead(6)){
 clock[4]++;
 if(clock[4]>23) clock[4]=0;
 DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]);
 while(digitalRead(6));
}

if(digitalRead(5)){
 clock[2]++;
  if(clock[2]>31) clock[2]=1;
 DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]);
 while(digitalRead(5));
}

if(digitalRead(4)){
 clock[1]++;
 if(clock[1]>12) clock[1]=1;
 DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]);
 while(digitalRead(4));
}

if(digitalRead(3)){
 clock[0]++;
 if(clock[0]>99) clock[0]=0;
 DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]);
 while(digitalRead(3));
}


delay(100);
}

void Print(int number){
lcd.print(number/10);
lcd.print(number%10);
}
  • Now get your hex file from Arduino software and then upload it in your Proteus software.
  • Now run your simulation and if everything goes fine, then it will look like something as shown in below figure:
  • Now you can see its today's date in the LCD and the same is shown over on the small pop up of DS1307 Clock.
  • Now the time will start on ticking and the buttons will used to change the minutes hours etc.
  • You will get the better demonstration of this project in the below video.
So, that's all for today. I hope this projects DS1307 Arduino based Digital Clock will help you in some way. So see you in next post.

Interfacing of Multiple DS18B20 Arduino

Hello everyone, hope you all are fine and having fun with your lives. Today, I am going to share a new project named as Interfacing of Multiple Temperature sensors DS18B20 arduino. I have already shared a tutorial on Interfacing of Temperature Senor 18B20 with Arduino but in that tutorial, we have seen how to connect one temperature sensor DS18B20 arduino. But today, I am gonna interface multiple temperature sensors DS18B20 Arduino. For this project I have used two sensors but you can use more if you want.

Temperature sensor DS18B20 is a one wire temperature sensor means we can get its data through a single wire and we can connect as many as we want temperature sensors with this single wire and can call them through their addressing. Each temperature sensor is allotted an address and when we call that address, we get its value. So, in today's project, I have used two sensors and displayed their values on LCD. Both of these sensors are connected with single wire. I am not using both DS18B20 sensors instead I am using one 18B20 and one 18S20 temperature sensors just to give a taste, but you can connect any kind of Dallas Temperature sensor. I have designed the simulation in Proteus and the simulation is also available for download. Anyways let's get started with interfacing of Multiple Temperature Sensors DS18B20 arduino.

Interfacing of Multiple DS18B20 Arduino

  • You can download the complete simulation along with progrmming code by clicking the below button:

Download Simulation and Code

  • Now, let's design our simulation because its always a good practice to design from basics. So, open your Proteus software and design the below circuit diagram:
  • Now, as you can see in the above figure, I have used two temperature sensors DS18B20 Arduino is used as a micrcontroller and LCD is used for displaying the values of these two temperature sensors.
  • Both of these temperature sensors are connected with a single wire of Arduino board which is Pin # 2.
  • So, now using this single wire we can connect as many temerature sensors as we want.
  • So, now next thing we need to do is to Get the Hex File from Arduino Software. So for that place the below code in your Arduino software and get your hex file.
#include <LiquidCrystal.h>
#include <OneWire.h>

OneWire  ds(2);  // pin 2
LiquidCrystal lcd(13,12,11,10,9,8);

void setup(void) {
  lcd.begin(20,4);
  lcd.print("Temp 1 = ");
  lcd.setCursor(0,1);
  lcd.print("Temp 2 = ");

  lcd.setCursor(1,2);
  lcd.print("www.TheEngineering");
  lcd.setCursor(4,3);
  lcd.print("Projects.com");
}


void loop(void) {
  byte i = 0;
  byte data[9];
  byte addr[8];
  int temp;
  boolean type;
  
  //get the addresses of Temperature Sensors
  if(!ds.search(addr)){
    return; 
  }
  
  switch(addr[0]){
   case 0x10: type = 1; break;//DS18S20
   case 0x22: type = 0; break;//DS1822
   case 0x28: type = 0; break;//DS18B20
   default: break; 
  }

  ds.reset();
  ds.select(addr);
  ds.write(0x44);
  delay(750);

  ds.reset();
  ds.select(addr);
  ds.write(0xBE);

  //Leitura
  for ( i = 0; i < 9; i++) {
    data[i] = ds.read();
  }
  
  if(!type){//DS18B20 ou DS1822
  
  lcd.setCursor(9,1);
  
    if((data[1]>>7)==1){
      data[1] = ~data[1];
      data[0] = (~data[0]) + 1;
      lcd.print("-"); 
    }
    else{
      lcd.print("+"); 
    }
    temp = (data[1]<<4) | (data[0]>>4);
    lcd.print(temp);
    lcd.print(".");
    temp = (data[0] & 0x0F) * 625;
    if(temp>625){
      lcd.print(temp);
    }
    else{
      lcd.print("0");
      lcd.print(temp);
    }
  }
  else{//DS18S20

  lcd.setCursor(9,0);
  
    if((data[1]>>7)==1){
      data[0] = ~data[0];
      lcd.print("-"); 
    }
    else{
      lcd.print("+"); 
    }
    temp = data[0]>>1;
    lcd.print(temp);
    lcd.print(".");
    lcd.print((data[0] & 0x01)*5);
    
  }
  lcd.print(" ");
  lcd.write(223);// degree symbol
  lcd.print("C    ");
}
  • Now, when you uploaded your hex file in Arduino board of your Proteus software then run your Proteus file.
  • If everything goes fine then you will get the results as shown in below figure:
  • So, you can see in the above figure that I am getting the data of both these temperature sensors and displaying them on LCD.
  • Both of these temperature sensors are showing different temperature values and their respective values are displayed over the LCD.
That's all for today, I hope you can now easily interface multiple temperature sensors with Arduino. Will meet in the next tutorial. Till then take care and have fun !!! :)

DC Motor Speed Control using Arduino in Proteus

Hello friends, hope you all are fine and having fun with your lives. Today, I am going to share a tutorial on DC Motor Speed Control using Arduino in Proteus ISIS. In my previous post, we have seen How to design a DC Motor Direction Control Project using Arduino in Proteus ISIS and if you haven't checked it out then I would recommend you to have a look at it first. Because, in today's tutorial, I am gonna extend that tutorial and will add the DC Motor Speed Control in it. So, today, we will control both the direction as well as speed of the DC Motor. Moreover, you should also have a look at How to use Arduino PWM Pins if you are not much familiar with PWM control.

In the previous tutorial, we have seen How to control the direction of a DC Motor, which is important when you are working on some robot and you need to move that robot in both forward and reverse direction. So, in such cases you need to do the direction control of DC motor. But in most projects, along with direction, we also need to control the speed of DC motor so that we can implement some PID algorithm on the motors. So, in such cases, there comes a need for DC Motor Speed control, which we are gonna cover in today's post. So, let's get started with it.

DC Motor Speed Control using Arduino in Proteus

  • As I have explained earlier, I am gonna take it further from our previous tutorial. So, in previous tutorial, what we have done is, we have controlled the direction of DC Motor using Serial Terminal.
  • When we send commands on the Serial Terminal the motor moves in clockwise or Anti-clockwise direction.
  • So, now the above mentioned functionality will remain the same but an addition will be of speed control.
  • I have placed a LDR sensor in the simulation and depending on the value of that LDR sensor our DC motor speed will either increase or decrease.
  • So, you can download the complete simulation of DC Motor Speed Control by clicking the below button:
Download DC Motor Simulation

  • As I always recommend, design this simulation on your own so that you learn most of it.
  • So, first of all, design a circuit as shown in below figure:
  • As you can see in the above figure, its exactly the same as we designed for Direction Control of DC Motor in Proteus ISIS with a slight difference.
  • The difference is NPN transistor which is used for DC Motor speed control.
  • The base of this NPN transistor is connected with PWM pin of Arduino board.
  • So, I am generating a PWM pulse on this pin which is then applied on the base of transistor.
  • Now if I increase the duty cycle of this PWM pulse then the transistor induction will increase and thus the speed of the DC motor.
  • Now in order to control this PWM pulse I have used the LDR sensor, now depending on the LDR sensor the speed of DC motor will increase or decrease.
  • Now upload the below code in your Arduino software and Get the hex file from Arduino software.
int Motor1 = 2;
int Motor2 = 3;

int PWMControl= 6;

int PWM_Input = A0;

int PWM_Value = 0;
void setup() {
  pinMode(Motor1, OUTPUT);
  pinMode(Motor2, OUTPUT);
  pinMode(PWMControl, OUTPUT);
  pinMode(PWM_Input, INPUT);
  Serial.begin(9600);
}

void loop() {
  PWM_Value = analogRead(PWM_Input);
  PWM_Value = map(PWM_Value, 0, 1023, 0, 255);
  analogWrite(PWMControl, PWM_Value);
  if(Serial.available())
  {
    char data = Serial.read();
    Serial.println(data);
    if(data == 'C'){MotorClockwise();}
    if(data == 'A'){MotorAntiClockwise();}
    if(data == 'S'){MotorStop();}
    
  }
}

void MotorAntiClockwise()
{
  digitalWrite(Motor1, HIGH);
  digitalWrite(Motor2, LOW);
}

void MotorClockwise()
{
  digitalWrite(Motor1, LOW);
  digitalWrite(Motor2, HIGH);
}

void MotorStop()
{
  digitalWrite(Motor1, HIGH);
  digitalWrite(Motor2, HIGH);
}
  • So, now I am starting the simulation and then will send the commands via virtual Terminal and it will start moving and then by changing the LDR position DC motor speed control will take place.
  • I know its not clear from above figure so that's why I have designed this video. In the below video you will get the clear idea of DC Motor speed motor.
So, that's all for today. I hope you have got the idea of DC Motor Speed Control. Take care and have fun !!! :)  

DC Motor Direction Control with Arduino in Proteus

Hello friends, hope you all are fine and having fun with life. Today, I am going to share DC Motor Direction Control with Arduino. I have designed a complete simulation in Proteus, which will help you in understanding the controlling of DC motor. I would recommend you to first read How to Control relay in Proteus ISIS which will help you in understanding the functionality of relays because in today's tutorial, I have used relays to do the DC Motor Direction Control. I have already posted a tutorial on DC Motor Drive Circuit in Proteus ISIS.

So, for DC Motor Direction Control, I have used Arduino UNO baord, so you should also download this Arduino Library for Proteus so that you can use Arduino boards in Proteus software. I have also provide the simulation and the code for DC Motor Direction Control but I would recommend you to design it on your own so that you learn from it. If you have any problem then ask in comments and I will try to resolve them. In this project, I have used Serial Terminal. So, whenever someone, sends character "C" on serial terminal then the motor will move in Clockwise Direction and when someone sends character "A" then it will move in Anti-clockwise Direction and will stop on character "S". Anyways, lets get started with DC Motor Direction Control with Arduino in Proteus ISIS.

DC Motor Direction Control with Arduino in Proteus ISIS

  • You can download the Proteus simulation for DC Motor Direction Control by clicking the below button:
Download Proteus Simulation for DC Motor

  • So, now let's move on with designing it, first of all get the below components from Proteus and place them in your workspace:
  • Now, design a circuit in Proteus software, as shown in below figure:
  • You can see in the above figure that I have used two relays which I have used for DC Motor Direction Control.
  • Moreover, there's a Virtual Terminal through which I am sending the commands.
  • I have used Arduino UNO board for DC Motor Direction Control through Virtual Terminal. You should download the Arduino Library for Proteus so that you can use it in Proteus.
  • Now upload the below code in your Arduino software and get the hex file. You should read how to get the Hex file from Arduino.
int Motor1 = 2;
int Motor2 = 3;

void setup() {
  pinMode(Motor1, OUTPUT);
  pinMode(Motor2, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  if(Serial.available())
  {
    char data = Serial.read();
    Serial.println(data);
    if(data == 'C'){MotorClockwise();}
    if(data == 'A'){MotorAntiClockwise();}
    if(data == 'S'){MotorStop();}
  }
}

void MotorAntiClockwise()
{
  digitalWrite(Motor1, HIGH);
  digitalWrite(Motor2, LOW);
}

void MotorClockwise()
{
  digitalWrite(Motor1, LOW);
  digitalWrite(Motor2, HIGH);
}

void MotorStop()
{
  digitalWrite(Motor1, HIGH);
  digitalWrite(Motor2, HIGH);
}
  • In the above code, I have designed three functions which I am calling on Serial receive.
  • The code is quite self explanatory but if you got problem then ask in comments and I will resolve them.
  • Once everything's done then run your simulation and if you have done fine then it will start working as shown in below figure:
  • Obviously, you can't see a moving DC motor in an image but you can get the idea from Relays position in above figure. :)
  • The below video will give you the better idea of How it works.

So, that's all for today. Hopefully now you have got the idea of How to do DC Motor Direction Control with Arduino in Proteus ISIS. In the next tutorial, I am gonna add speed control of DC Motor. So, till then take care and have fun. :)

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