Arduino Tutorial for Beginners
Hello friends, I hope you all are fine and having fun with your lives. Today, I am going to share a complete
Arduino Tutorial for Beginners because I was having a lot of requests about it. Reader were asking the same question that they are new to Arduino and how should they start so if you are beginner to Arduino and you don't have any idea How to learn it then you should read the below tutorials.
I have posted all the basic Arduino Tutorial for Beginners already so in today's tutorial I am just gonna arrange them and must ask you to read them one by one from top to bottom and at then end you will really be able to design any kind of project on Arduino. So, let's get started with Arduino Tutorial for Beginners:
Arduino Tutorial for Beginners
Before going into the practical Arduino Programming, you must first read some theoretical knowledge about Arduino which will really help you out in your Arduino Projects. So these are the
basic Arduino tutorial which I will post here step by step:
What is Arduino ?
First of all, you should read this tutorial in which I have given the basic introduction of Arduino. This tutorial is essential one, if you are new to Arduino.
Arduino Vs Raspberry Pi
Next thing you should read is Arduino Vs Raspberry Pi, its not that important but its always good to have a look at alternatives.
Installation of Arduino Driver in Windows
Now, I suppose that you know the basics of Arduino and have got your Arduino UNO in your hand and are ready to install Arduino Drivers in your Windows.
Arduino Library for Proteus
Next thing you need to read is How to use Arduino Library for Proteus. Using this library you can easily simulate your Arduino boards in Proteus software.
Getting Started with Arduino Software
Now you have the basic idea of Arduino board and you know How to use it in Proteus, the next thing you need to do is to have some understanding about Arduino software.
Basic Arduino Commands
Now, that you have understood the basics of Arduino and its programming so now let's have a look at some
Basic Arduino Commands and I would suggest you to test these commands in Proteus on your own so that you do mistakes and get some knowledge from them. Anyways, let's continue with these Basic Arduino Commands:
Getting Started with Arduino Programming
After having a look at the Arduino software, next thing you need to do is to read about Getting Started with Arduino Programming.
Arduino Data Types
Then we have a tutorial at Arduino Data Types in which we have explained in detail all the Data Types of Arduino.
How to use pinMode in Arduino
How to use pinMode in Arduino is the next tutorial which you must read so that you have an idea about how to make pins input or output.
How to use DigitalRead in Arduino
How to use DigitalRead in Arduino is the next tutorial which you must read so that you have an idea about how to use the digital Pins of Arduino.
How to use DigitalWrite in Arduino
How to use DigitalWrite in Arduino is the next tutorial which you must read so that you have an idea about how to use the digital Pins of Arduino.
How to use AnalogRead in Arduino
How to use AnalogRead in Arduino is the next tutorial and I have explained here how to read the status of analog Pins.
How to use AnalogWrite in Arduino
Analog Write is used to update the status of analog Pins as well as PWM Pins. Here we will discuss this command and in next tutorial we will have a look at PWM Pins.
How to use Arduino PWM Pins
How to use DigitalRead in Arduino is the next tutorial which you must read so that you have an idea about how to use the digital Pins of Arduino.
A Simple Arduino LED Example
First of all, you should have a look at A Simple Arduino LED Example in which I have designed a simple example in Proteus and blinked the LED at Pin # 13 of Arduino.
How to write Arduino code
Next article you should have a look at is How to write Arduino code, in this tutorial I have explained how to write arduino code efficiently.
- Now that you have the idea of basic Arduino programming so now let's move a little further and have a look at How to do Arduino Serial Communication. I have posted a lot of Arduino Serial Tutorial and I would suggest you to read them one by one. Here are all the links of Arduino Serial Tutorials:
At the end, I would suggest you to have a look at this list of
Arduino Projects in which I have given all the Arduino Projects which are posted on our blog, so once you get trained in Arduino then you can try those projects and can get pro in Arduino.
Flex Sensor Library for Proteus
Hello friends,I hope you all are fine and having fun with your lives. In today's tutorial, I am going to share a new Proteus Library named as
Flex Sensor Library for Proteus. I am quite excited while sharing this one because we are the first one to design this library and share it online. Although, I wanna add one thing here that most of the flex sensors are analog sensors and their resistance changes over bending and believe me I have tried my best to design an analog sensor but despite the efforts we couldn't so I am sharing a digital version of Flex Sensor. So, its not gonna detect how much its bent but it will detect whether its up or bent. So, I thought to share it with you guys. It's better to have something than nothing. You should also have a look at
Analog Flex Sensor Library for Proteus, which we have designed finally. :)
Although our team is still working on it and we hope to make it analog soon. Let me know your suggestions in the comments and if someone can help us in making it analog then it will be really great.Other bloggers are welcome to share this new with their reader but do mention our link. It will be a great favor to us. So, let's get started with
Flex Sensor Library for Proteus:
Note:
Other
Proteus Libraries are as follows:
Flex Sensor Library for Proteus
- First of all, click the below button and download this Flex Sensor Library for Proteus:
Flex Sensor Library for Proteus
- Open this rar file and you will get three file in it named as:
- FlexSensorTEP.IDX
- FlexSensorTEP.LIB
- FlexSensorTEP.HEX
- Now add these three files in the Library folder of your Proteus software.
Note:
- If you are using Proteus 7 Professional, then the library folder link will be something like this: C:Program Files (x86)Labcenter ElectronicsProteus 7 ProfessionalLIBRARY
- If you are using Proteus 8 Professional, then the library folder link will be something like this: C:ProgramDataLabcenter ElectronicsProteus 8 ProfessionalDataLIBRARY
- Now I hope you have done everything correctly so now open your Proteus software or restart it if its already open.
- In Proteus, make a search for Flex Sensor and you will get something as shown in below figure:
- So, now select this Flex Sensor and place it in your workspace and it will look something as shown in below figure:
- As I have told earlier that this Flex Sensor is not analog and it just works on digital.
- So, there are four pins on it.
- One is Vcc which you need to give 5V and second one is GND where you need to place the ground.
- Third pin is OUT which will be either HIGH or LOW depending on the Test Pin, so if Test Pin is HIGH then OUT will be HIGH otherwise it will be LOW.
- Both Straight and bent conditions are shown in below figure:
So, that's all for today. I hope you guys have enjoyed today's tutorial and this Flex Sensor Library for Proteus is really gonna help you out. Take care and have fun !!! :)
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 !!! :)
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:
- PIR Sensor: For Motion Detection.
- Smoke Sensor: For Smoke Detection.
- Flame Sensor: For Fire Detection.
- Vibration Sensor for Window: For Detection of vibrations on Window.
- Vibration Sensor for Door: For Detection of vibrations on Door.
- Ultrasonic Sensor for Window: For intruder Detection on Window.
- 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.
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 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.