Line Following Robot using Arduino

Hello everyone, I hope you all are fine and having fun with your lives. Today, I am going to share a very basic project named as Line Following Robot using Arduino. I have designed a three wheeler robot and have placed IR sensors beneath it to detect the black line and then I have made it move over this Black Line.

This Line Following Robot is not doing any extra feature i.e. turning or rotating back. It will just simply move in the straight line. I have also posted a short video at the botton of this tutorials which will give you better idea of how this robot moves. You should first read this tutorial and design the basic robot and once you are successful in designing the basic Line Following Robot then you should have a look at my recent Project Line following Robotic Waiter in which I have designed a Robotic waiter which follows the line and also take turns on different tables. So, let's get started with Line Following Robot using Arduino.

Line Following Robot using Arduino

  • First of all I have designed the Mechanical model of the robot, which has three wheels on it.
  • Its a triangular method in which the motors were attached to the front two wheels and the back wheel is a caster wheel, which is present in the middle of the robot.
  • Here's the image of front wheel coupled with the DC Gear Motor:
  • Now let's have a look at the rear caster wheels, shown in below image:
  • Finally, I have used Acrylic as the body of the robot.
  • Here's the assembled version of our Line Following Robot:
  • Now that we have the mechanical design of our robot and we have assembled it completely.
  • So, now comes the electronics part where we are gonna place the DC Motor Driver Circuits and will also place the IR sensors.
  • I have used Arduino board for programming of this Line following Robot.
  • First of all, I have designed the 2 relay baord for DC motors.
  • Its circuit diagram is shown in below figure:
  • We also need a voltage divider circuit because we need such a power supply from which we can get 5V, while our source battery is of 12V.
  • So, in order to do that I have used 7805 Regulator IC and have designed a simple circuit as shown in below figure:
  • Now placing all the components over the Line following Robot, it looked like something as shown in below figure:
  • Here's the Arduino code which you need to upload in your Arduino board:
#define motorL1 8
#define motorL2 9
#define motorR1 10
#define motorR2 11

#define PwmLeft 5
#define PwmRight 6

#define SensorR 2
#define SensorL 3
#define Sensor3 A0
#define Sensor4 A1

#define TableA A4
#define TableB A2
#define TableC A5
#define TableD A3

int OriginalSpeed = 200;
int TableCount = 0;
int TableCheck = 0;
int RFCheck = 10;

void setup() 
{
  Serial.begin (9600);
 
  pinMode(motorR1, OUTPUT);
  pinMode(motorR2, OUTPUT);
  pinMode(motorL1, OUTPUT);
  pinMode(motorL2, OUTPUT);
  
  pinMode(PwmLeft, OUTPUT);
  pinMode(PwmRight, OUTPUT);
  
  pinMode(SensorL, INPUT);
  pinMode(SensorR, INPUT);
  pinMode(Sensor3, INPUT);
  pinMode(Sensor4, INPUT);
  
  pinMode(TableA, INPUT);
  pinMode(TableB, INPUT);
  pinMode(TableC, INPUT);
  pinMode(TableD, INPUT);
  
  MotorsStop();
  
  analogWrite(PwmLeft, 0); 
  analogWrite(PwmRight, 0);
  delay(2000); 
 // Serial.println("fghfg");
  
}

void loop() {
  MotorsForward();
  PIDController();
}

void MotorsBackward()
{
    digitalWrite(motorL1, HIGH);
    digitalWrite(motorL2, LOW);
    digitalWrite(motorR1, HIGH);
    digitalWrite(motorR2, LOW);
}

void MotorsForward()
{
    digitalWrite(motorL1, LOW);
    digitalWrite(motorL2, HIGH);
    digitalWrite(motorR1, LOW);
    digitalWrite(motorR2, HIGH);
}

void MotorsStop()
{
    digitalWrite(motorL1, HIGH);
    digitalWrite(motorL2, HIGH);
    digitalWrite(motorR1, HIGH);
    digitalWrite(motorR2, HIGH);
}

void MotorsLeft()
{
    analogWrite(PwmLeft, 0); 
  analogWrite(PwmRight, 0);
    digitalWrite(motorR1, HIGH);
    digitalWrite(motorR2, HIGH);
    digitalWrite(motorL1, LOW);
    digitalWrite(motorL2, HIGH);
}

void MotorsRight()
{
      analogWrite(PwmLeft, 0); 
  analogWrite(PwmRight, 0);
    digitalWrite(motorR1, LOW);
    digitalWrite(motorR2, HIGH);
    digitalWrite(motorL1, HIGH);
    digitalWrite(motorL2, HIGH);
}

void Motors180()
{
    analogWrite(PwmLeft, 0); 
    analogWrite(PwmRight, 0);
    digitalWrite(motorL1, HIGH);
    digitalWrite(motorL2, LOW);
    digitalWrite(motorR1, LOW);
    digitalWrite(motorR2, HIGH);
}

void PIDController()
{
  if(digitalRead(SensorL) == HIGH){analogWrite(PwmRight, 250);analogWrite(PwmLeft, 0);}
  if(digitalRead(SensorR) == HIGH){analogWrite(PwmLeft, 250);analogWrite(PwmRight,0);}
  if((digitalRead(SensorL) == LOW) && (digitalRead(SensorR) == LOW)){analogWrite(PwmRight, 0);analogWrite(PwmLeft, 0);}
}
  • Now that's all, here's the video for Line Following Robot using Arduino which will give you better idea:
That's all for today. I hope you have enjoyed this Line Following Robot using Arduino and are gonna use it in your projects. feel free to ask in comments, if you got into any trouble. Thanks for reading. Take care !!! :)

Automatic Street Light Project in Proteus

Hello everyone, I hope you all are fine and having fun with your lives. Today, I am going to share a semester project which is named as Automatic Street Light Project. I have designed this project in Proteus ISIS and the simulation is also given below for download. Btw this was my first project during my engineering course. :D I had really enjoyed while working on this project as I was new to electronics then.

This project is about Automatic Street Light. You must have examined on your streets that the street lights turn ON at night while they turn OFF in the day. When I was a child then I think that someone turns ON the switch in the day and then turns it OFF at night but that's really not the case. :P

In fact, these lights are automatic and have a sensor in them which is known as LDR sensor. This sensor is used to detect the light intensity so if there's sun light in the surroundings then it simply turn OFF the street light and if there's no sun light then it turns ON the street light and that's how Automatic Street Light works. I have designed its simulation in Proteus ISIS software which you can download below. So, let's get started with Automatic Street Light Project in Proteus ISIS.

Note:

Automatic Street Light Project in Proteus ISIS

  • You can download the working simulation of Automatic Street Light Project designed in Proteus ISIS by clicking the below button:

Download Proteus Simulation

  • You can download the Proteus simulation by clicking the above button but I would recommend you to design it on your own so that you get maximum knowledge out of it.
  • So, let's design it on our own. :)
  • First of all, design a simple circuit as shown in below figure:
  • You can see in the above figure that I have designed two circuits. Both of these circuits are exactly same but they have different LDR sensors.
  • Proteus has two LDR sensors in its database that's why I have designed two circuit diagrams and have used both of them.
  • Moreover, I have used LM324 IC in it which is getting the input from the LDR sensor at its negative pole and the LED is attached at its output.
  • LDR is a Light Dependent Resistance which gives output when it detects light.
  • The output of LDR is analog and it depends on the light intensity.
  • If the light intensity is HIGH then LDR value will be HIGH if its LOW then value will be LOW.
  • That's why I have placed a variable resistance which is used for setting the threshold value for LDR.
  • Rite now when there is full light only then the LED will go HIGH otherwise it will remain LOW.
  • So, let's now simulate this simulation of Automatic Street Light and have a look at the results:
  • You can see in the above figure that in the OFF state the LED is OFF when LDR is not detecting light.
  • Now in the ON state, when LDR detected the Light then the LED goes ON automatically.
  • You must be wondering that its working on opposite logic i.e. when there's light then the Light goes HIGH and when there's no light then the Light goes LOW.
  • Moreover, the output is just of 5V but the street lights are of normally 220V AC or 12V DC.
  • So, let's add a simple Relay in front of this circuit so that we can add some lamp as shown in below figure:
  • Now let's have a look at the OFF state of this Automatic Street Light Project, shown in below figure:
  • You can see in the above figure that the LDR is detecting the light but the Lamp is OFF, so its like a day time. There's light and that's why street light is OFF.
  • Now, let's have a look at its ON state in the below figure:
  • Now you can see the LDR is not detecting any Light which means its a night time and that's why our lamp is ON.
  • The below video will give you a better idea of How it works:

So, that's all for today. I hope you have enjoyed this Automatic Street Light Project in Proteus ISIS. Will meet you guys in next tutorial. Till then take care and have fun !!! :)

Getting Started with Cayenne - Arduino

Hello friends, I hope you all are fine and having fun with your lives. Today, I am going to share a new and very exciting service with you guys which is named as myDevices Cayenne, we will have a look at getting started with Cayenne. Its really an awesome platform for students and hobbyist who wants to work on embedded systems but are afraid of programming codes.

Cayenne is an online project building platform using drag and drop. Currently it supports Arduino and Raspberry Pi. In simple words, you can design any of your Arduino or Raspberry Pi project simply by drag and drop different components. You don't need to write any code, you just need to place your blocks and upload it to your Arduino board. Its also known as the Graphical coding.

I came to know about Cayenne a few days ago and I have really enjoyed working on it so I thought to share it with you guys so that you can also get benefit from it. In today's tutorial, I am just gonna give an overview of Cayenne and we will design a simple Arduino LED project on it. In the coming tutorials I will share different projects on Cayenne, which will help you guys in your projects. Moreover, first we will cover the Arduino Project on Cayenne and later we will work on Raspberry Pi as well. So, let's have a look at Getting Started with Cayenne.

Getting Started with Cayenne

  • First of all, what you need to do is to open this myDevices Cayenne Website.
  • Now on this myDevices Cayenne Website you have a to create a free account so click on the Green Button which says Get Started for Free.
  • So, fill out the form on the Registration page and then it will ask you which one you want to use as shown in below figure:
  • Now as we are gonna work on Arduino so I will select Arduino among them.
  • You must have the Arduino IDE installed on your computer and you should also install the Cayenne Library for Arduino.
Note:
  • When I first started working on Cayenne, I had an older version of Arduino software and when I compiled the code then it generated errors, so I updated my Arduino software and it worked fine.
  • So, you just make sure to have the latest Arduino IDE.
  • Next thing you need is the Arduino Ethernet or Arduino Wifi Shield, which will be used for uploading the code to Arduino board from Cayenne website.
  • So, now plug your Ethernet or Wifi shield on the Arduino board.
  • I have plugged Arduino Wifi shield with Arduino UNO.
  • So, now once you selected the Arduino then on the nex page you will get some instructions, which I have already disscused.
  • Now you should plug your Arduino board with your computer and click Next.
  • In this step you need to select your device as shown in below figure:
  • In the above figure, you can see first of all, I have selected the Arduino UNO shield becasue I want to upload the code in this shield and then I have selected the Wifi Shield using which the code will be uploaded.
  • Now when you click on the Sketch button you will get a small sketch which you need to upload in your Arduino board.
  • This is the only code which you need to upload, this code is acting as a bridge between Arduino and Cayenne.
  • Once you uploaded that code then Cayenne will automatically detect your board, you just need to wait.
  • As soon as your board is detected, you will be redirected to your Dashboard, where you can design your first project as shown in below figure. :)

Arduino LED Blinking Project in Cayenne

  • Now Click on the Create new Project button and give it a name, I have given it Arduino LED and click OK.
  • The new project will be created, now we need to add the LED Control in it.
  • So, in order to do so you need to click on the Add new button and then Device/ Widget as shown in below figure:
  • You can see in the above figure, that all the devices are now visible.
  • As we are working on the LED, so you need to click the Light icon, which is among Actuators.
  • When you click it you will get something as shown in below figure:
  • So, I have selected the Light switch and in its properties, I have selected the D8 which is 8th digital Pin of Arduino.
  • Now click on the Add Actuator button and you are done.
  • You first LED Blinking Project is done on Cayenne and it will look something as shown in below figure:
  • So, now when you click this light switch your LED on pin 8 will go ON and if you click it again then it will go OFF.
  • I have plugged an LED on Pin # 8 on my hardware.
  • In the below video, I have explained this Arduino LED project in more detail, so must watch it:
I hope you guys have enjoyed today's tutorial and are gonna like this Cayenne online Platform. I will post more tutorial on it in which I will interface all these devices with Arduino. So, stay tuned and have fun !!! :)

LPG Gas Leak Detector using Arduino

Hello friends, hope you all are fine and having fun with your lives. Today, I am going to share a new project named LPG Gas Leak Detector using Arduino in Proteus ISIS. Before reading this tutorial, you must first download the Gas Sensor Library for Proteus because we are gonna use that Library and will simulate the Gas Sensor in Proteus.

In this library you will find eight sensors and all of them works exactly the same so that's why we are gonna use one of them. For LPG Gas Leak Detector Project I have used MQ-2 sensor which is used for detection of LPG gas. I have also used Arduino UNO board which you can simulate in Proteus using Arduino Library for Proteus. Moreover, I have also placed an LCD which will display either LPG gas Leak Detected or not. So, let's get started with LPG Gas Leak Detector using Arduino in Proteus ISIS.

LPG Gas Leak Detector using Arduino in Proteus ISIS

  • First of all, download the Gas Sensor Library for Proteus and install it in your Proteus software so that you can it in Proteus.
  • After installing the Gas Sensor Library, now download the LPG Gas Leak Detector Project's simulation and programming code by clicking the below button:

Download Proteus Simulation & Code

  • Now, let's design this project so that you can get a better idea of how it works.
  • First of all, design a small circuit in your Proteus software as shown in below figure:
  • Now you can see in the above figure that I have used Arduino UNO board along with 20 x 4 LCD and Gas Sensor MQ-2.
  • You can use this LCD by download this New LCD Library for Proteus.
  • Next thing you need to do is to download the below code and get your hex file.
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

int Gas = 7;

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(20, 4);
  // Print a message to the LCD.

  lcd.setCursor(0,0);
  lcd.print("Gas Detected :");
  
  lcd.setCursor(1,2);
  lcd.print("www.TheEngineering");
  lcd.setCursor(4,3);
  lcd.print("Projects.com");
  pinMode(Gas , INPUT);
}

void loop() {
  
  if(digitalRead(Gas) == HIGH){lcd.setCursor(14,0);lcd.print(" Yes");}
  if(digitalRead(Gas) == LOW){lcd.setCursor(14,0);lcd.print(" No ");}
 
}
  • If you don't know about Hex file then read How to Get Hex file from Arduino Software.
  • Upload this Hex File in your Proteus Arduino software and then run your simulation.
  • If everything goes fine then you will get results as shown in below figure:
  • So, you can see in the above figure that when Gas Sensor is HIGH then its written on the LCD that Gas Detected: Yes.
  • Here's a video which will explain this LPG Gas Leak Detection using Arduino in Proteus ISIS:
So, that's all for today. I hope you have enjoyed this project named LPG Gas Leak Detection using Arduino in Proteus ISIS. Will meet you guys in the next tutorial. Till then take care and have fun !!! :)

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 Install and Download Proteus Software

Hello everyone, I hope you all are fine and having fun. Today, I am not going to share a project. Instead, I am gonna share a tutorial in which I will teach you How to download Proteus and install it. It's going to be a quick tutorial because there's not much in it to say. You know Proteus is a Paid software and you must pay the company because they have put really great effort into designing this software. So, if you can afford then you must buy the latest version of Proteus software from their Official Website.

In today's post, I am going to share the Full version of Proteus software and it is Proteus 7 Professional, I am sharing it for engineering students. I hope you are going to enjoy this software its not only free but also complete and the Professional version. So, let's get started with How to Install and Download Proteus Software. Please watch this youTube video for better guidance:

How to Install and Download Proteus Software ???

  • First of all, download the Proteus 7 Professional software by clicking the below button:
Proteus 7 Professional Free download Proteus 8.5 Professional Free download

  • Once you downloaded the files, now unrar them and place them in some folder.
  • The next thing you need to do is to run the Setup file from the package and it will start to install.
  • Use the recommended settings and once it's done then it will ask about the key.
  • The default key is given in the package so browse it and upload it to the software.
  • Once the key is uploaded, now complete the setup and you will get yourself a Proteus software.
  • After the completion, one more thing you need to do is to install the software given in the next folder.
  • In the path selection, gave it the path to your Proteus software, which you just installed.
  • Now hit run and after it's complete, your Proteus will become registered.
  • I have made a small video that will explain the above procedure of How to Install and Download Proteus software in a better way.
So, that's all for today, I hope you guys are gonna enjoy this Proteus software free download and gonna write about it in the comments. That's all for today, will meet you guys in the next tutorial. Till then take care !!! :)

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 !!! :)
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