0% found this document useful (0 votes)
2K views295 pages

Complete Guide On Proteus ISIS

This document provides a complete guide to using Proteus ISIS and ARES software. It is divided into multiple sections that cover basics of Proteus ISIS, commonly used components, simulating microcontrollers and sensors, designing PCBs in Proteus ARES, creating custom components, and examples of complex projects. Tutorials and resources are provided for a variety of topics to help users learn Proteus from beginning to advanced skills.

Uploaded by

berija1968
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views295 pages

Complete Guide On Proteus ISIS

This document provides a complete guide to using Proteus ISIS and ARES software. It is divided into multiple sections that cover basics of Proteus ISIS, commonly used components, simulating microcontrollers and sensors, designing PCBs in Proteus ARES, creating custom components, and examples of complex projects. Tutorials and resources are provided for a variety of topics to help users learn Proteus from beginning to advanced skills.

Uploaded by

berija1968
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 295

Complete Guide on Proteus ISIS & ARES

A Complete Tutorial on How to Use Proteus ISIS & ARES


Hello friends, I hope you all are
fine and having fun. In today’s
tutorial, I will provide you a
Complete Guide on Proteus ISIS &
ARES. I will start from very basics
& will gradually move towards
complex projects. I have already
shared a lot of tutorials on Proteus
software on my blog, I will add
their links in today’s tutorial as
well, in the projects section.
If you guys have any problem
anywhere, ask in comments and I
will try my best to resolve your
issues and also subscribe to our
newsletter so that you get these
burning tutorials rite in your mail
box. I will continuously update this
list of tutorials so that we have all
tutorials at one place.

Course Content of Proteus Guide


I have divided this tutorial in few sections and you have to follow them in sequence and at the
end of this course, I hope you will be able to create any simulation in Proteus ISIS & also design
its PCB model in Proteus ARES. These sections are as follows:

 In the 1st section of this course, we will have a look at few basic concepts in Proteus,
which are necessary for a beginner to understand.
 In the 2nd section, we will discuss various components available in Proteus. I know
there’s countless components in its database and we can’t discuss them all but we will
have a look at most commonly used components i.e. DC motor, servo motor, serial port,
etc. We will design some simple electronics circuits in Proteus to get better
understanding.
 In the 3rd section, we will have a look at How to simulate different Microcontrollers in
Proteus ISIS, and we will also simulate different sensors in it. Moreover, I will guide you
How to Install 3rd Party Proteus Libraries.
 In the 4th section, we will first have a detailed introduction to Proteus ARES & then we
will design different PCB boards in it, both single layered and multi-layered.
 In the 5th section, we will see how to design a component in Proteus along with its PCB
footprint, if it’s not already in Proteus database. Its important, especially when you need
to design a PCB in Proteus.
 In the 6th section, we will simulate different final year complex projects.
Complete Guide on Proteus ISIS & ARES

I have created above mentioned sections and added respective links in sequence.

Section 1: Basics of Proteus ISIS


So, let’s get started with Basics of Proteus ISIS, these are very basic tutorials, so if you have
worked on Proteus before, then you can skip this section. Although, I would recommend you to
read them once:

 Introduction to Proteus
 Simulate First Electronics Project in Proteus ISIS
 How to Increase Workspace in Proteus
 Voltmeter & Ammeter in Proteus ISIS
 How To Use Virtual Terminal in Proteus ISIS
 How To Use Oscilloscope in Proteus ISIS
 How to Install and Download Proteus Software?
 Knowing About Components Available in Proteus ISIS
 Component Designing in Proteus ISIS
 Top 10 PCB Design Software

Section 2: Components Available in Proteus ISIS

Proteus has a wide range of components in its database. Using these components, you can
design almost any kind of circuit and can test and debug it. Below tutorials mention few of these
components, which are most commonly used while working on Proteus.

 How to Design a DC Power Supply in Proteus?


 Variable Voltage Modulation Using LM317 in Proteus ISIS
 DC Motor Drive Circuit in Proteus ISIS
 Stepper Motor Drive Circuit in Proteus ISIS
 Servo Motor Drive Circuit in Proteus ISIS
 Relay simulation in Proteus ISIS
 Design a Buzzer in Proteus

Components Libraries for Proteus


Proteus has a wide range of components available in its database. But it happens quite a lot that
you search for some component in Proteus but you can’t find it in Proteus database. For such
cases, Proteus has given a method using which you can design your component in Proteus and
can add all of its features in it. It’s quite a lengthy process and needs a lot of effort as it involves
creation of DLL files using C++ and VSM. We have designed few components libraries for Proteus,
using which you can simulate that component or module in Proteus. Here’s the list:

 Arduino Library for Proteus


 Genuino Library for Proteus
 GPS Library for Proteus
 GSM Library for Proteus
 XBee Library for Proteus
 Arduino UNO Library for Proteus
 Arduino Mega Library for Proteus
 Arduino Nano Library for Proteus
 Arduino Pro Mini Library for Proteus
 Ultrasonic Sensor Library for Proteus
 PIR Sensor Library for Proteus
 Bluetooth Library for Proteus
 DS1307 Library for Proteus
 Gas Sensor Library for Proteus

Arduino Projects in Proteus


Arduino is most widely used Microcontroller board these days, which is famous for its flexibility
and ease of use. Arduino board is not available in Proteus but we have provided with Arduino
libraries using which you can quite easily use Arduino in Proteus and can test your circuits in
Proteus before implementing them in hardware. Below are the tutorials and projects in which
we have used Arduino in Proteus.

 Arduino Library for Proteus


 Arduino Lilypad / Nano Library for Proteus
 Arduino Lilypad Simulation in Proteus
 Circuit Designing of LCD with Arduino in Proteus ISIS
 Interfacing of Seven Segment Display with Arduino in Proteus
 Display ADC value on LCD using Arduino in Proteus ISIS
 Control Servo Motor with Arduino in Proteus
 Traffic Signal Control Project using Arduino in Proteus
 Intelligent Energy Saving System
 Power Factor Measurement Using Microcontroller in Proteus
 DS1307 Arduino based Digital Clock in Proteus
 Interfacing of Multiple Temperature Sensor with Arduino
 DC Motor Direction Control with Arduino in Proteus ISIS
 DC Motor Speed Control with Arduino in Proteus ISIS
 Arduino Bluetooth Communication using HC05

PIC Microcontroller Projects in Proteus


PIC Microcontroller is another microcontroller which is used by engineers in engineering
projects. This microcontroller is available in Proteus so we have designed few projects on it
which are mentioned below:

 Circuit Designing of LCD with PIC on Proteus ISIS


 Display ADC value on LCD using PIC Microcontroller in Proteus ISIS
 Electronic Door Lock using PIC Microcontroller

8051 Microcontroller Projects in Proteus


8051 Microcontroller is another microcontroller series which is quite popular and is used in
engineering projects quite a lot. 8051 Microcontrollers are also available in Proteus and most
normally used 8051 Microcontrollers are AT89C51 and AT89C52. I have shared many projects on
8051 Microcontroller, which are as follows:

 LED Blinking Project using 8051 Microcontroller


 Serial Communication with 8051 Microcontroller
 Interfacing of LCD with 8051 Microcontroller
 Interfacing of Keypad with 8051 Microcontroller
 Design a Simple Calculator with 8051 Microcontroller

Sensors simulation in Proteus


Proteus has a wide range of sensors available in its database. We have designed simulations of
few of these sensors which are mentioned below. Ultrasonic sensor is not available in Proteus so
we have provided its library so that students can easily interface and test it in Proteus. These
sensors’ simulations are mentioned below:

 Ultrasonic Sensor Library for Proteus


 Ultrasonic Sensor Simulation in Proteus
 How to Use LDR Sensor in Proteus
 Capacitive Touch Sensor in Proteus
 LM35 Sensor in Proteus
 18B20 Sensor in Proteus ISIS
 Send SMS with SIM900D Module in Proteus ISIS

555 Timer Projects in Proteus


555 Timer is known as the king of electronics projects after microcontrollers. 555 timer is used in
a lot of electronics projects where you need to do control or generate some timing or PWM
pulse. 555 Timer is available in Proteus and have designed a lot of tutorials on it, which are
mentioned below:

 LED Flashing Project with 555 Timer in Proteus ISIS


 Multiple LED Flasher Project using 555 Timer in Proteus ISIS
 LED Dimming Project Using 555 Timer in Proteus ISIS
 Angle Control of Servo Motor using 555 Timer in Proteus ISIS
 Sequential LED Blinking using 555 Timer in Proteus ISIS
 Seven Segment Display Using 555 Timer in Proteus ISIS
 Relay Control Using 555 Timer in Proteus ISIS
 Traffic Signal Control using 555 Timer in Proteus ISIS

PCB Designing Tutorials in Proteus ARES


Proteus not only provide the capability of circuit designing and testing but also provide the
facility of designing a PCB. Proteus comes with two packages one is named as Proteus ISIS in
which we design our circuits and the other one is Proteus ARES which is used for PCB designing.
Here we have post tutorials on How to design PCBs in Proteus.

 PCB Designing in Proteus ARES


 Arduino UNO PCB Design for Proteus ARES
So, these are the tutorial on which I have written. If you guys stuck at any point, feel free to ask
in comments and I will try my best to satisfy you as much as I can. Moreover, subscribe to our
mailing list so that you get these tutorials rite into your mail box. Stay blessed & take care.
Introduction to Proteus

I am
going to share a detailed Introduction to Proteus. It’s our first tutorial in Proteus series. Today’s
tutorial is for beginners but still I would suggest you to read it once, as I am going to explain why
Proteus?
Throughout our Engineering Course, we have to design a lot of electronics or embedded circuits
and it’s always a best approach to simulate these circuits first on some simulation software i.e.
Proteus, PSPice etc., before assembling them on actual hardware. Among these simulation
software, Proteus is my favourite one so let’s get started with detailed Introduction to Proteus:

Introduction to Proteus ISIS

 Proteus Design Suite (designed by Labcenter


Electronics Ltd.) is a software tool set, mainly
used for creating schematics, simulating
Electronics & Embedded Circuits and designing
PCB Layouts.
 Proteus ISIS is used by Engineering students &
professionals to create schematics &
simulations of different electronic circuits.
 Proteus ARES is used for designing PCB Layouts of electronic circuits.
 It’s available in four languages i.e. English, Chinese, Spanish & French.

Why use Proteus ?


“Our circuit is working perfectly on Proteus but when we have implemented it on hardware, it’s
not working. “. I receive a lot of such questions from engineering students, that’s why, I am
explaining what’s the real purpose of Proteus:

 Proteus is quite lenient in circuit designing and it works on ideal conditions i.e. if you
don’t add pull up resistors in Proteus simulation, then it won’t give garbage value.
 Proteus is also used for PCB designing, we use Proteus ARES for that. (We will discuss it in
upcoming lectures)
So, when I am working on some electronics circuit, then I first design the simulation on Proteus
ISIS and once I got sure that everything’s working fine then I design its circuit on either the vero
board or the bread board and again I perform some real world testing & when I got sure that my
circuit is fully working then I design its PCB in Proteus ARES.

 Proteus is also used for designing/testing programming codes for different


Microcontrollers i.e. Arduino, PIC Microcontroller, 8051 etc.
In Embedded projects, we need to design a programming code for Microcontrollers and for
designing such codes you have to perform a lot of testing, which involves uploading code to
Microcontroller. So, in such projects, Proteus is a great relief. Let’s say, you have to print some
strings on 20×4 LCD, then its quite annoying to burn the Microcontroller several times for
typographical errors. Instead, design a circuit in Proteus and test your code in the simulation and
once you are sure that you are getting perfect output then burn your PIC Microcontroller and
test it on real hardware. Quite easy and handy. In the coming classes, I will show you how to
burn code in Microcontrollers in Proteus.
Note: In code testing, there’s again a possibility that you get different results in real hardware
but its quite rare and mostly happens in delay functions.

Getting Started with Proteus


You can download Proteus software from its official website and you should also read How to
Download & Install Proteus software. So now I hope you have installed Proteus and ready to
work on it:

 Click on Proteus ISIS and it will open up as shown in below image.


 In the central area surrounded by blue lines, we design our circuit i.e. place the
components and then join them together.

 As you can see in above figure that we have a lot of icons in Proteus software, so let’s
first understand these sections one by one.
 In the below image, I have divided the Proteus font-end in four sections:
 Section 1 is a toolbar which you would have seen on many simulation software, it has
simple functionalities i.e. first icon to create a new layout, second one to open an existing
layout, next one is to save layout, then there comes few zooming options and few other
tools which we will discuss in coming tutorials.
 Section 2 has two buttons. P is used to open the components list and E is used for editing
purposes, like you want to edit the properties of any component then simply click on that
component and then click on E and it will open the properties of that component and you
can easily edit it.
 Section 3 has different tools, used for designing circuits, we will discuss them in detail, at
the end of today’s tutorial.
 Section 4 is the remote control section of Proteus, as it contains four buttons i.e. Play,
Step, Pause & Stop. In order to run the simulation, we have to click on this play button.

Component Selection in Proteus ISIS


As shown in below image, click on the icon that says Click # 1, it’s a Component Mode Icon.
After that click on P button and a new window will open up named Pick Devices.
 In this new window there’s a textbox on which Keyword is written, this text box is used
for the component search.
 Proteus database has unlimited components in it so now in order to get your desired
component, you have to search for it as I did.
 I have searched for PIC16F877A and Proteus provided me that component along with its
preview in top right corner and PCB package ( if available ). Unfortunately, my Proteus
doesn’t have the PCB preview of PIC16F877A that’s why it’s blank.
 In order to add the component in Proteus workspace, either double click on it or click on
the OK button.

Instruments in Proteus ISIS


There are few measuring instruments available in
Proteus, which you can open by clicking the Instruments
Icon, as shown in figure on right side.
First one is oscilloscope, we use it for viewing the
behaviour of different signals generated.
Another important instrument is Virtual Terminal, it is
shown on the fourth number. This Virtual Terminal is
used for checking data coming through Serial Port.
Then there’s Signal Generator, it is used to generate
signal like sine wave of desired frequency.
We also have Voltmeter & Ammeter for both AC & DC.
We will discuss them in detail in our coming lectures.
As you can see in figure on right side, Icon A is called
Graph mode, used to create graphs of voltage and
current. It has different style of graphs.
Icon B and C are voltage and current probes
respectively. Suppose you have designed some circuit in Proteus and you want to check the
value of voltage at any point in the circuit. In order to
do so, simply select this voltage probe and place it
there and when you run your circuit, the probe will
show the value of voltage above it and same for
current probe.
Icon D is used when we want to design our own
component in Proteus.
Icon E is a simple text editor, used for placing labels,
warning or components names etc.
So, that was all for today. I hope you have enjoyed
this detailed Introduction to Proteus. If you have any
question, feel free to ask in comments and also
subscribe through email to our mailing list, so that
you don’t miss any part of this tutorial series. Stay
blessed. Take care.
Simulate First Electronics Project in Proteus ISIS
In today’s tutorial, we will simulate
our First Electronics Project in
Proteus ISIS. It’s our 2nd tutorial in
Proteus series. In our previous
tutorial, we have seen a basic
Introduction to Proteus and today,
we will design a simple electronics
circuit in it and will also simulate it.
If you want to work on Proteus, then
you must have some prior
knowledge about electronics. Proteus doesn’t provide any suggestion about circuit designing so
if you don’t have electronics knowledge then you can’t work with Proteus. Throughout this
series, I will keep on explaining electronics circuits as well and will also embedded related
components’ links. So, if you are new to electronics then no need to worry and just follow these
instructions and also do read those embedded links to understand electronic components. So,
let’s Create our First Project in Proteus:

Simulate First Electronics Project in Proteus ISIS


Open your Proteus ISIS software and
then click on Components Mode in left
menu tab, as shown in the figure.
After that click on the P (Pick from
Libraries) Button, and a new window will
open up.
This new window is called Pick Devices
and is used to make search for
electronics components.
Proteus has a huge database of
electronics components in the form of
libraries. i.e. Diode Library will have all
the diode components.
So, from these millions of components,
we need to make a search for our
required components to design
electronic circuit.
You can see Pick Devices window in below figure, so let’s first discuss its layout:
Keywords textbox is used to make a search for any component and Proteus will display the
related components in Results panel. (We will search in a while )
Category Section displays all the categories available in Proteus and when you click on any
category then it’s components will be displayed in Results panel.
After that, we have Sub-category & Manufacturer, rite now I don’t have any.
On the right side we have Schematic Preview & PCB Review, so when we select any component
then its respective Previews will be shown here.
So, now let’s make a search for LED, as shown in below figure:
As you can see in above figure that Proteus has provided us with 141 Results and I have boxed
four LEDs, which I am going to use in my circuit.
Moreover, Category section is now showing only those categories which are related to searched
keyword.
Moreover, we also have a Schematic Preview but we don’t have any PCB Preview as it’s not
available for this component.
So, double click on these four LEDs and they will be added in Proteus workspace.
Moreover, we also need to add resistance so make a search for resistance, as shown in below
figure:
Dou
ble click on this RES component and then close this Pick Devices window.
You will get these selected components in the Devices section, as shown in below figure:

As
we are designing a simple project so we have selected just four components but in complex
projects, we have a long list of components in this Devices section and it proves quite helpful.
So, let’s place these components, one by one in the central work area.
You can drag & drop them OR can select by
clicking and then again click to place.
I have placed these components in the
work area, as shown in figure on right side.
So, now let’s connect them together using wires and for that, we need to click on the pin
terminal of each component.
I have combined these electronic components together using wires, as shown in below figure:

No
w we need to provide voltage supply to this
circuit and there are several voltage sources
in Proteus. (We will cover them in coming
lectures)
For now, let’s click on the Terminals Mode in
the left Toolbar and you will get Proteus
Terminals, as shown in figure on right side.
From these terminals, we are going to use
Power & Ground, so place them in the circuit,
as shown in below figure:
We will discuss all these Terminal
Components in detail in our coming lectures.
If
we place multiple Ground components in the circuit then Proteus will consider them all as
connected/short.
These Terminals are quite helpful, as in complex circuits, these wires can become too messy and
we can avoid them by using these terminals.
So, we have completely designed our circuit but we need to change the properties of these
components a little.
So, double click on resistance to open its Properties Panel, as shown in below figure:

From this Edit Component window, we can edit different properties of selected component.
As you can see, first we have Component Reference, that’s the name of our component i.e. R1. If
we have multiple resistances, then there names will be R2, R3 and so on.
We can’t have multiple items with same Component Reference, as it will create an error.
Second Property defines the resistance of the component and I have changed it from 10k to 1k.
Then we have Model Type and its analogue.
Finally, we have PCB Package, we will use it when we will be designing the PCB design of this
circuit.
So, click on the OK Button and resistance value will change from 10k to 1k.
Now, double click on first LED to open its Properties Panel, as shown in below figure:

As LED is a bit complex component as compared to resistance, that’s why it has a lot more
Properties to Edit.
As we are designing a digital circuit, so we need to change the Model Type of LED from Analog to
Digital and then click on the OK Button.
You need to change this Model Type for all these four LEDs.
So, now we have completely designed our first electronic circuit in Proteus.
Let’s run this simulation, by clicking the Play button at the bottom.
If everything goes fine, then all LEDs will glow, as shown in below figure:
We
have successfully simulated our first electronics circuit in Proteus ISIS and you can see these LEDs
have different colours as specified in their Reference Value.
So, that was all for today. I hope you have enjoyed today’s tutorial. In the next lecture, we will
have a look at How to use Relays in Proteus ISIS. Till then take care & have fun!!!

How to Increase Workspace in Proteus


Today’s post is about How to increase
Workspace in Proteus. It’s our 3rd tutorial in
Proteus series. Its quite a simple tutorial and
along with this trick, I will also share few
commonly used features or Proteus. Once, I
was working on a simulation project in which
I have to design a complete load
management system in Proteus and it was
quite messy as I have to include a lot of components and the area of Proteus got quite small for
that and then I encountered this problem i.e. where to place the components.
You have seen in Proteus software that there’s a blue rectangle which is considered as the
workspace in Proteus. This area is constant and doesn’t increase or decrease on its own. So, if
we are dealing with some messy circuit design then we have to increase this area, which we are
going to discuss today. If you have downloaded my Arduino Library for Proteus, then you must
have seen that the size of Arduino Mega 2560 is quite big and when I design Proteus simulations
in which I need to use Arduino Mega, I have to increase the Proteus workspace to embed all the
other components. So, let’s get started with how to increase Workspace in Proteus:

How to Increase Workspace in Proteus???

First of all, if you are working on some project in Proteus then simply don’t increase the area
because when you increase the area then components get too small and its quite difficult to
arrange or connect them with each other.
So, my suggestion is to keep using the default size, unless your circuit got messy and you actually
need more space.
Let’s open Proteus software and place few components in it, as an example I am just placing PIC
Microcontrollers to cover the available space, as shown in below figure:

You
can see in above figure, I have randomly placed 8 PIC Microcontrollers, just to fill the space.
Now suppose I want to add four more Microcontrollers in this Proteus file, there’s no place to
add them.
Now in order to add more components, we need to increase the size of available workspace in
Proteus.
In order to do so, click on Systems in above menu bar and then click on Set Sheet Sizes as shown
in below figure:

Now when you click it, a new pop up


window will open up, as shown in the
figure on right side.
You can see in the figure, there are six sizes
available for the user to select.
First five are fixed sizes while the sixth one
is user defined and you can set it to any
size you want.
The default size of workspace in Proteus is
A4, which is the first option i.e. 10inch by 7
inch.
So, now let’s change this selection
and I am selecting the fifth option so
now the size is 15inch by 10 inch, as
shown in below figure:
Now it’s quite obvious from the
above figure that the area has
increased.
We have the same 8 PIC
Microcontrollers but now we have
more free space.

Right Click to Delete Component

Proteus has a quick way to delete any component or wire.


You need to right click on your component/wire for 2 times and it will be removed/deleted from
the workspace.
It’s quite helpful, especially in designing complex simulations.

Default Terminal in Proteus

Let’s discuss Default Terminal as well, which is used to keep the


schematic organized & clear.
We can get them by clicking on Terminals Mode first and then click
on Default, as shown in figure on right side.
In our previous lecture, we have designed a simple LED circuit, so
let’s make small changes in it, as shown in below figure:
You can see in above figure that I have deleted the wires and placed
these default terminals on both sides.
In order to delete these wires, I have simply double right clicked on
each wire and placed these terminals.

No
w, double click on each terminal and provide it a name, as shown in below figure:
As
you can see in above figure, top two Terminals are named as Terminal1 and below two terminals
are named as Terminal2.
So, although these terminals are not connected together but Proteus considers “Terminals with
same name” as connected.
If we run our simulation now, we will get the similar results, as shown in below figure:

The
se default Terminals are too helpful, as in complex projects, adding too much wires make the
simulation quite messy. (We will use them in coming lectures)
So, that’s how you can quite easily increase workspace in Proteus ISIS.

How to use Voltmeter & Ammeter in Proteus ISIS


In today’s tutorial, we will have a
look at How to use Voltmeter &
Ammeter in Proteus ISIS. It’s our
4th tutorial in Proteus series. While
designing an electronics project,
voltage & current measurements
are essential debugging features,
as they help in understanding
circuit behaviour.
Proteus has built-in instruments for voltage & current measurement. We have their probes and
today we will discuss them in detail. First have a look at Voltmeter in Proteus ISIS.

How to use Voltmeter in Proteus ISIS

DC Voltmeter is used to measure the voltage difference across


any DC component.
In order to use DC Voltmeter, we need to click on Virtual
Instruments Mode, as shown in the figure.
In Instruments list, we have DC voltmeter, so click it and place it
in your Proteus workspace.
I am going to use the same circuit, which we have designed in
first lecture, shown in below figure:
As you can see in the figure, I have placed two voltmeters, one
at the input and second at the last LED.
Because of 100kohm resistance, there’s a slight drop in the
voltage at last two LEDs.
Moreover, Voltmeters are placed in parallel to these
components.
We can also use Voltage Probe to measure voltage at any point in
the electronic circuit.
So, click on Voltage Probe in the left toolbar and connect it to any
point in your circuit and its voltage will be displayed.
I have placed two Voltage probes on my circuit, as shown in below
figure.
Voltage Probe provides value up to five decimal points, while DC
Voltmeter provides value up to 2 decimal points.

Voltage probes are quite helpful as they are small in size and easy to place in the circuit.

So, that was all about Voltmeter in Proteus. Now, let’s have a look at How to use Ammeter in
Proteus ISIS.

How to use Ammeter in Proteus ISIS

DC Ammeter is used to measure the current passing through any DC component.


We need to click on Virtual Instruments Mode and then click on DC Ammeter.
Place this Ammeter in series, as shown in below figure:
W
e aren’t getting any value on our Ammeter as these LEDs are not drawing much current.
But you can see we have placed the Ammeter in series, we will use it a lot in coming projects.
So, that was all about How to use Voltmeter & Ammeter in Proteus.

How To Use Virtual Terminal in Proteus ISIS


In today’s tutorial, we will have a look at How to use Virtual Terminal in Proteus ISIS. It’s our 5th
tutorial in Proteus Series. I will first explain what is virtual terminal and then we will have a look
at its uses and performance in Proteus ISIS.
Virtual Terminal is an important tool available in Proteus and it comes quite in handy while
working on serial modules i.e. GSM, GPS, XBee etc. So, let’s get started with Virtual Terminal in
Proteus.

What is Virtual Terminal?

Virtual Terminal is a tool in Proteus,


which is used to view data coming
from Serial Port (DB9) and also used to
send the data to Serial Port. In
windows XP, there’s a built-in tool
named Hyper Terminal, which is also
used for the same purpose but in
windows 7 there’s no such tool, so for
windows 7 users this virtual terminal is
quite a great comfort. If you guys don’t
know about serial port then I would
suggest you to read this tutorial to get
better idea of serial port:
What is Serial Port?
I have posted many tutorials on my blog in which I have communicated over Serial port using
different software. For example, you can check this Serial communication in MATLAB and can
also have a look at Serial Communication in Visual Studio 2010. As serial communication is too
common, so almost every microcontroller supports Serial communication. Arduino UNO has
built-in single serial port at its pins 0 and 1, while Arduino Mega 2560 has built in four Serial
ports in it. Similarly, PIC Microcontroller also supports Serial port and it is also available in 8051
Microcontroller.

Uses of Virtual Terminal

Virtual Terminal in Proteus, as I explained above, is used to send or receive data to or from a
serial port. Serial port is a 9 pin port which is mostly find on the computers and is used in
Embedded System Projects for data communication. Normally in student projects, data is sent
from hardware to computer via serial port and then user design some application on their
computer to view that data in some represent-able form.
Now, in projects there are some testing steps which are quite helpful, if we use them properly,
and these testing steps require some tools in order to test the process. Like, suppose some
student have designed the hardware to send the data to the computer and have also design its
application to receive it and now when he tests it he didn’t receive any data. At that point
student got tensed and don’t know where’s the error so at that point there’s may be some error
in the hardware or may be in the software.

Now, in order to be sure he need to test both of them separately and here is the point where
virtual terminal is used. First connect your hardware with the computer and then run the
hardware and check whether you are receiving data on the virtual terminal or not. If you are
receiving it, means your hardware is okay and the problem is in software side and if you are not
means your hardware is not so good.
Whenever I start working on some projects, I always make sure that I am going in right direction
like if I have to made this project then after completing my hardware, I will first check it via this
virtual terminal and once I got sure that my hardware is okay then I will move to the software
part. If you are going to design the hardware then I think you must check Serial communication
with 8051 Microcontroller, which is also designed in Proteus ISIS software and the data is
displayed using the same virtual terminal.
There are also many other applications of this terminal like suppose you want to design some
circuit in Proteus which involves serial port then you can add this terminal on your circuit and
can test it before going to the hardware, which we will shortly see below. So, now let’s get
started with Virtual Terminal in Proteus.
How to Use Virtual Terminal in Proteus ISIS?

First of all, open the Proteus ISIS and click on the P button to search for the components, as we
seen in previous tutorials.
Now in the search box type “COMPIM”, when you search this a result will show up as shown in
the below figure:

After Selecting this, click OK to add this component in the database.


COMPIM is the serial port in Proteus and using its properties we can assign any COM pin of our
computer to it and it will behave like that pin. We will change the properties shortly.
Now, click on the Virtual Instrument Mode and then on the Virtual Terminal as shown in the
below figure and add it in the Proteus workspace.
Now join the TXD pin of COMPIM with the TXD pin of Virtual Terminal and RXD with RXD as
shown in the figure below:

Now, double click on the COMPIM to open the Properties menu and set the properties as shown
below:
I have selected COM1
and my baud rate is
9600, you can set it
whatever you want
like if you are using
the COM3 then set the
port to COM3 and
baud rate of your own
choice.
Similarly open the
properties of the
virtual terminal and
make sure that the
baud rate is same in
both the cases.
Now connect your
hardware with the
computer and play the
simulation. Again
make sure that the
port which you have
selected for the COMPIM is same port with which you have attached your hardware.
After you play the simulation a black
window will open up which will
show the data coming from your
hardware to the COM1 pin as shown
below:
This black box is actually the Virtual
Terminal which is showing data
coming from my hardware.
If you play the simulation and this
Virtual Terminal doesn’t pop up
then right click on the Virtual
Terminal Component and then click
on Virtual Terminal which will be at
the end in the options and this black
window will open up.
I think you guys have got much of
the idea of this Virtual Terminal in
Proteus ISIS. If you have any
problem anywhere, ask in
comments and also subscribe to our
newsletter via email to get these
amazing tutorials right into your mailbox. In the next tutorial, I have explained How to use
Oscilloscope in Proteus ISIS.

How To Use Oscilloscope in Proteus ISIS


In the previous post, we have seen How to use Virtual Terminal in Proteus and today I am going
to explain How to use Oscilloscope in Proteus ISIS. This oscilloscope is just the same which you
have seen in your electronic or electrical labs. Oscilloscope is basically used to monitor signals or
waveforms. Particularly when you are not much aware of the circuit and you need a little
debugging then you use oscilloscope.
In oscilloscopes, we can visualize the electrical properties of waveforms, like we can check
what’s the frequency of electrical signal, what’s its voltage or current. Digital oscilloscopes have
vast range of features in it like RMS value calculation etc. So, in short when you want to visualize
or research your available signal then oscilloscope is the first and right most option for you. In
today’s tutorial, first of all, I am going to design a simple Pure sine wave circuit and then we will
visualize its properties using oscilloscope in Proteus ISIS.

Pure Sine Wave Circuit Design

First of all, design a circuit as shown in the below figure.


This circuit is a simple pure sine wave inverter which is inverting the DC Signal into AC signal.
I have also encircled the components so first of all, find these components in the Proteus
database and then design the circuit as shown in the figure. (Right click on the image and then
open it in new tab to get the clear view).
When I was designing my Pure Sine Wave Inverter Simulation in Proteus then I had to use
oscilloscope quite a lot.
How to use Oscilloscope in Proteus ISIS???

Now in order to add the oscilloscope in the circuit, first click on the Virtual Instruments Mode as
shown in the below figure.
In that mode the first option will be the Oscilloscope which I highlighted as Click # 2 in the below
figure.
Now drag that oscilloscope and place it in the workspace, as you can see below this component
has total four legs means you can view total four different types of signals using this oscilloscope
and can also compare them, if you need to.

Now what I want to check in my circuit is, whether I am getting the pure sine wave at the output
or not.
So, in order to check that I have attached the two ends of the bulb which is acting as a load with
the two probes of oscilloscope i.e. A & B as shown in the below figure.
How to Monitor Oscilloscope

Now in order to monitor the oscilloscope, run / play the Proteus circuit and then double click on
the oscilloscope and a new window will open up as shown in the below figure.
As you can see in the below image there are total two curves are showing i.e. Channel A & B.

Now, if you check the right side of the above figure, you can see there are total four channels,
each channel represents each probe.
Like we have attached our curves with A & B now I can change settings of A & B channel and the
output curves will be changed.
Play with this tool and you will how easy it is to use. Change the position of circular know and the
amplitude unit will be changed, then change the linear know of each channel and the dc offset
will be added in the curve.

Video Tutorial

Here’s the complete video tutorial of above discussion, better for understanding.
That’s all for today, hope you guys have enjoyed today’s tutorial and have got the clear idea of
How to use oscilloscope in Proteus ISIS. In the coming tutorial, I have explained How to Design a
DC Power Supply in Proteus ISIS. So, let’s meet in the coming tutorial.

Component Designing in Proteus ISIS


Today’s tutorial is about the component designing in
Proteus ISIS. This tutorial actually deals with the
presentation of your project. Usually when students
give presentation of their projects, then it is asked
that add the circuit diagram of their project. Now when students open Proteus in order to design
their circuit, they found out that the components they have used in their project are not
available in the Proteus Directory. Now, what to do? In that case, there’s a need to design your
own component in Proteus and place it in the circuit. Although, this new designed component
won’t work as the real component but for presenting the circuit, it will be enough. For example,
we don’t have Arduino boards in Proteus software. so, I have designed some of the Arduino
boards myself for Proteus which you can download from Arduino Library for Proteus.
Similarly, it usually happens to me during my freelancing work to design some circuit and when I
don’t find the required component in the Proteus library then I simply design it on my own and
then create its PCB. We will check the PCB designing of such components in the coming posts of
this tutorial. So, now let’s get started with component designing in Proteus ISIS.

Component Designing in Proteus ISIS

Now I am going to design a simple component having 4 pins.


First of all, select the 2D Graphics Box Mode as shown in the below figure.

Now click on the workspace and drag the cursor to create a box, as shown in the below figure.

We have created the body of our component, now there’s a need to add pins in it.
For this, click on the Device Pins Mode as shown in the below figure and click on the workspace.
It will add a small pin, attach this pin with the box as I did in the below figure.

Note: The pin has a small green bubble on it. Make sure that this end is not connected with the
box as this bubble end is for the wire.
I have added four pins with the box. Now there’s a need to name these pins. For this purpose,
double click any of the attached pin and the properties box will open up as shown in the below
figure.
Mention the Pin Name and the Default Pin Number, it will appear on the component and then
click on Next.

When you click Next, it will ask for the same things for the second pin and so on.
When you fill this info for all the four pins then click OK.
Now when you click the ok button, your component will now look as shown in the below figure.
I have given my pins the names as Vcc, GND, Output, Signal.
We have completed all the info of our product, now there’s a need to add this component in our
library.
For this purpose, select the whole component and then right click and select Make Device.

When you click on this option a new dialog box will open up as shown in below figure.
In this dialog box, you just need to give info of your new component so that you can search it
easily in your Proteus library.
Just fill the Device Name in it and click Next. I have given the name Test Device to my
component.
Now click Next and go on clicking Next, unless you reach at the below page.
Here you need to place your component in the category. Choose the appropriate category for
your product and click on OK.

That’s it. Now your component has been added to the library. Open your part list and search for
the component like in my case I search for Test Device and the below component appeared in
my list. happy
That’s all for today. If you have any questions regarding this tutorial, ask in comments and I will
reply them.

Top 10 PCB Design Software


Today, I am going to share an informational
tutorial about top 10 PCB design Software. These
PCB design software are used for designing PCBs.
In all engineering projects especially related to
electronics, PCB designing is an important task
and in order to design the PCB we have to use
some software. There are many software
available in market and today, I am going to give
a complete list of PCB Design software.
Few of these software and free to use and few
have limited versions available but in order to
get their advanced features you have to buy
them. I have also mentioned their features below. If you have read my blog in detail then must
have the idea that I use Proteus software for designing my PCB boards. So, if you ask me then I
will recommend Proteus software as you can simulate your circuit design in it as well along with
PCB designing. I have also used Eagle software for PCB designing and its also quite easy and rich
with features. Anyways let’s get started with top 10 PCB Design Software

PCB Design Software – Basics

There are few things, which you must remember before starting your PCB design. When you
start your project, never jump directly to PCB designing. Instead, you must first design your
circuit on wero board or bread board and then test it out. Once you confirmed that all features
of your project are working perfectly, then you should move to designing part. If you started the
PCB design at first then there’s a chance that you miss something in your hardware and then
your PCB boards will simply go to waste. So, first design your hardware temporarily adn then test
its working and then design your PCB board. You can also simulate your circuit design on some
software before designing its PCB. Anyways its up to you. When I design any project then I first
design hardware on wero board and then once its perfect then I design its PCB board. Anyways,
now let’s have a look at top 10 PCB Designing software.

1 Altium
Altium is at first rank in my list of PCB Design software. You can
get this software from their official site. Altium is used for
designing PCB boards, you can design PCB of any layer in this
software. It’s very powerful and has a long list of tools for
editing or designing your PCB board. It’s a paid software and you
can buy it easily from their official site, whose link I have posted
above. You can also create the component list, BOM file etc in
this software. You can also design flexible PCB designs in it and
can also check their 3D simulator to know about the final shape of your PCB board.

2 Eagle
Eagle is another great PCB design software which comes after
Altium software. Its also quite powerful and has great list of tools
for designing your PCB board. Eagle is the most commonly used
PCB Design software as its easy and quite flexible in its features.
Eagle has quite a lot of support available online in forums as its
quite an old software. It also provides the component list and the
BOM file etc.

3 Proteus
This one is my favorite PCB Design software and if you
have read my blog then you must have the idea how
much i like this software. In Proteus you not only
design your PCB boards but also can simulate your
complete circuit design. When I design a PCB board
then I first design its simulation in Proteus and then I
move on to designing its PCB board. It also has quite
flexible tools using which you can design your PCB
board and then can also check its 3D design.

So, if you ask me then I will recommend you Proteus software for PCB designing. If you want to
start working in this software then you must read How to do PCB designing in Proteus ARES. I
have also shared the PCB design of Arduino UNO board which you can also download from this
link.
4 Fritzing

Fritzing is another tool used for designing PCB boards.


I like its interface. It has quite attractive and user-friendly interface and you can design your PCB
layout in it quite easily. But drawback of fritzing is that it’s not professional software, it has quite
small list of components available in it so I never thought of using this software for PCB
Designing. But if you have simple designing then give it a try, you are going to like it.

5 TinyCAD

TinyCAD is also used for PCB Designing. and is quite


famous. It also has a long list of tools for designing your PCB boards. Its quite similar to Eagle
software and is easy to learn and operate.

6 ZenitPCB
When discussing PCB Design software, then how can we forget ZenitPCB. It also a great PCB
Design software which is used for PCB designing in quite efficient way. It’s easy to use and has a
user-friendly interface.

7 ExpressPCB
ExpressPCB is also a cool tool for design your PCB boards. Its good for new users as it’s easy to
use and learn. You can learn this software just by watching its single video. It’s too easy to get
started with and have a cool and user-friendly interface.

8 KiCAD
KiCAD is an open source software which you can easily download online and is also free to use.
Using this software, you can design PCB boards up to 16 layers quite easily. It is rich with PCB
designing features and can handle complex designs quite easily.

9 DesignSpark PCB
DesignSpark PCB software is also another great tool in the list of free PCB Design software. Its
also a flexible software with a lot of tools and options for PCB designing. You are going to like this
one if you need quick and easy PCB designing.
10 EasyEDA
EasyEDA is also used for design PCB boards. It also has a user
friendly interface and is good for first time user as it has
everything in front and one can design PCB boards quite easily
in it. You can also design multi layer PCB boards in it. It has
small database of components that’s why you have to design
your components on your own while using this PCB design
software.

That’s a long list of PCB Design software. These all software are quite easy to use and anyone can
work on them just after a little training. So, you can select any of them for designing your PCB
boards. If you ask me then I will recommend Proteus and Eagle software as I use the for
designing my PCB boards.

How to Design a 5V Power Supply in Proteus?


I am going share a new and a very
important Tutorial which is How to
Design a 5V Power Supply in Proteus?
This project is very simple and of basic
level but importance of this project is
that it is used as a base in almost all large
electronics project, designed now-a-days.
When I start working on any project then
the first thing, I need to design is this DC
power supply, because without powering up the components, we can’t use them.
While designing a 5V Power Supply in Proteus ISIS, we will be using Voltage Regulator IC, which is
commonly known as 7805. This voltage regulator is used to regulate or change the voltage level
of supply voltage. As we all know, most of the batteries available in market are of 12 volts. For
example, if you have UPS at your homes then check its battery, it will be of 12V. Similarly, the
battery of car or motorcycle is also of 12V. So, 12V has become the standard of electrical
batteries. Now, we have known that all batteries are of 12V but the problem comes when we are
dealing with sensitive electronic components because they are all designed to operate on 5
volts. Now, as I described earlier that, voltage source available is 12 volts and the operating
equipment needs 5 volts to operate. So, we need an intermediate source or such type of DC
Power Supply, which can convert the source voltage (12 volts) to operating voltage (5 volts). This
problem is eliminated by using 7805 IC, and that’s why it is called Voltage Regulating IC.
So dear Friends, today we will design a 5V power supply, which will be able to change Voltage
Level and will provide us our desired voltage. But as I always say, that practice makes a man
perfect. Try to design it yourself so that, you also get to know the real application of Voltage
Regulator IC. So, let’s get started with designing of 5V power supply in Proteus ISIS.
How to Design a 5V Power Supply in Proteus

You can download the complete simulation of 5V Power Supply in Proteus by clicking the below
button:
Download Proteus Simulation
Voltage Regulating IC 7805 has 3 pins.

 Pin # 1 is used as input pin and it is connected to supply voltages. It is marked as (VI). DC
+12 volts are applied to this pin.
 Pin # 2 is called common or ground pin. It is marked as (GND). The whole circuit’s
common is applied to this pin.
 Pin # 3 is the output pin of 7805. If 12 volts are applied to its input than it automatically
generates 5 volts on this pin. This pin is marked as (VO).
Now, moving towards the designing of the hardware, first of all place all the components in
Proteus workspace, as shown in image below:

In Hardware implementation, first off all apply source voltage (12 volts) to the input pin of 7805
IC. 2 capacitors are also connected in parallel with the source voltage and their ratings are
1000μf and 100pf respectively.
On the other side of IC, we also connect 2 capacitors parallel to the gained output voltage (5
volts), and their ratings are 100pf and 100uf respectively. And a LED is also connected in parallel
on the load side.
If you have placed all the components in their perfect place and all the connections are OK, then
the resultant proteus simulation will look like as shown in the below image:
Now if you closely observe the above image then you will notice that Capacitors connected
across the 12 volts are of HIGH rating while the Capacitors connected across LED are of LOW
rating. The purpose of applying capacitors is to remove noise from our DC voltages. As, we all
know that DC voltage source available in market is not that much pure. So, to get pure DC wave
Capacitors are connected across it.
Now when you will run the final simulation then it will look like, as shown in the image given
below:

As you can see that when I ran the simulation, the LED started to glow. Now here is an important
thing to note that i have applied a resistance in series with LED. The value of resistance is very
low, and very low voltages appear across this resistor. This resistor limits the current and if we
directly connect the LED then, there will be chances that the LED may burn out.
We can justify it as: From ohms law: V=IR, and by rearranging it, we get : I=V/R .
Now if we remove resistor then R=0, which means: I=V/0 and it leads us to conclude that: I=
infinity or maximum in this case. So, the only purpose of the resistor is to limit current.
Alright friends, that’s all for today, I hope now you can design a 5V power supply quite easily in
Proteus. If you have some queries, then ask in comments. Subscribe us via email to get these
tutorials straight in your inbox. In the next tutorial, I have discussed Variable Voltage Modulation
using LM317 in Proteus ISIS.
LM317 Voltage Regulator in Proteus
In today’s post we are going to have a look at
LM317 Voltage Regulator in Proteus. In the
previous post, we have seen how to design a 5V
Power Supply in Proteus ISIS, which I have
designed using IC regulator 7805. Today I am
going to share How to design LM317 Voltage
Regulator Circuit in Proteus. This DC power
supply is a variable one means you can set its output voltage to any level you want. In order to
change its output value, we have used a variable resistor and by changing its value you can
change the output value. It is a basic level project and very simple but used as a base to design
large industrial projects. In this project, we are going to control the speed of a DC Motor and the
corresponding voltages, appearing across it. The reason for designing this variable DC power
supply is that, when you are working on some engineering project then each electronic module
has its own power level i.e. xbee module works on 3.3V while Arduino board works on 5V. So,
there’s a need to design such power supply which can provide variable voltages and we can set
them according to our demand. So, for all Microcontrollers like Arduino or PIC Microcontroller or
8051 Microcontroller, I designed 5V Power supply using 7805 but for 3.3V modules like XBee,
NRF24L01 etc I design this variable DC power supply using LM317. I hope now you got the
importance of this LM317 Voltage Regulator.
To design this, we will be using LM317k. Basically, it is a Voltage Regulator IC. It has 3 pins. Pin #
2 is for input voltages, marked as VI. Pin # 3 is for output voltages, marked as VO, and pin # 1 is
used for Regulating Voltages and it is marked as ADJ. Further, if you notice the circuit diagram,
which is given in the figure, then you will see that pin # 1 is connected to a Potentiometer.
Potentiometer is a Variable Resistor device and it is also known as Voltage Divider. The feature of
this electronic device is that, we can adjust the voltage through it according to our own choice. It
operates on 12 Volts and it gives us ease that, we can adjust its voltages from 0 to MAXIMUM
(which is 12 volts in most cases). Further if we notice the circuit, then we will see that a LED is
connected in parallel with a simple DC motor and a voltmeter is also connected in parallel with
Motor to monitor the voltages appearing across it. Above information was a little demo about
the individual components of the circuit, now let’s be practical and move towards Hardware and
see how actually Electronic components respond. You should also have a look at Introduction to
LM317, if you want to read all the basics about it. So, let’s get started with LM317 Voltage
Regulator in Proteus:

LM317 Voltage Regulator in Proteus ISIS

You can download this complete LM317 Voltage Regulator simulation by clicking the below
button but I recommend you to design it on your own so that you learn most from it.
Download Proteus Simulation
First of all, place all the components in Proteus workspace, as shown in image:
A 12-Volt DC supply is provided to input pin (# 2) of LM317 and potentiometer is connected to
Adjustable pin of LM317, which is, pin # 1.
At output pin we have connected DC Motor and a Voltmeter is also connected in parallel with
Motor.
The complete circuit, ready for simulation is shown below in image:

Stage # 1
Set the potentiometer at 0% and run the simulation, you will notice that Motor will rotate very
slowly in clock-wise direction and 1.25 volts will appear on the voltmeter across it. If all the
connections are OK, and when you will run the simulation, LM317 Voltage Regulator simulation
will look like as shown in the image below:
Note: If you don’t want to use the variable resistance, then you should use this LM317 Calculator
to get value of your second resistance.

Stage # 2
Now, set the potentiometer value to 11% and you will see that, Motor will start to rotate with a
faster rate and on voltmeter scale, we will see 6.40 volts. In this setting, the interesting thing is,
LED will start to Flash and it will turn ON & OFF automatically. This phenomenon can be seen in
images below:

Stage # 2 is our transient stage. When the potentiometers setting is below 11%, voltage appears
across the motor and it also rotates but LED doesn’t glow. On the other hand, when
potentiometers setting is above 11%, then LED glows continuously while motor also rotates as
before, and voltmeter also gives some particular values of voltages appearing across the motor.

Stage # 3
Now at final stage, set potentiometer to 100% and you will observe that motor is rotating with
full speed and voltmeter reading will be 10.6 volts while LED is glowing continuously. This stage
of the simulation can be seen in the image below:
Now, we can conclude that, LM317 is the monitoring device of this circuit. We can set the value
of potentiometer according to our own choice and by this, the speed of motor can be controlled
and also the corresponding voltages, appearing across it.
Here’s the video in which I have given the detailed introduction of LM317 and have also run its
simulation.
Alright friends, that’s all for today and I hope now you can easily design this LM317 Voltage
Regulator. In the next post, I have discussed DC Motor Drive circuit in Proteus ISIS.

DC Motor Drive Circuit in Proteus ISIS


Today we will check how to design a DC Motor Drive Circuit in Proteus ISIS.
DC motor is present in Proteus and quite easy to use. First we will simple
drive it by applying voltage on its both sides i.e. direct method and after
that we will automate it and will drive the circuit using PIC Microcontroller.
The microcontroller I am going to use will be PIC16F877A and the compiler
will be MikroC Pro For PIC.
This tutorial is not a correct method of driving any DC motor. In this
tutorial, I am just giving an overview of How to design a DC Motor Drive
Circuit in Proteus ISIS so you can say this tutorial is more about DC motor in
Proteus software. So, don’t try it in hardware. DC motor is a simple motor which needs polarity
difference at its two ends. IF this polarity is in forward direction then DC motor moves in one
direction and if we reverse the polarity then the DC motor moves in the opposite direction. So,
let’s get started with DC Motor Drive Circuit in Proteus ISIS.

Simple DC Motor Drive Circuit in Proteus ISIS

First of all, I will show you the simple control of DC Motor in Proteus so that you get an idea how
this motor works.
Add these two components from the Proteus library:
1. Motor
2. Logic State
Logic State has two states 1 and 0. When its 0 means 0V and when at 1 means 5V.
Now design the circuit as shown in the below figure:

Now I have added two Logic State on both the sides of motor. Direction of motor will depend on
this logic. So, there will be total four states:
1. When both states are at 0, motor will not move and remain stationary.
2. When both states are at 1, still the motor will not move and remain stationary.
3. The motor will move Clockwise when upper state is at 1 and lower at 0.
4. The motor will move Anti-Clockwise when upper state is at 0 and lower at 1.
DC Motor Drive Circuit Using PIC Microcontroller

Now we will drive our motor using PIC Microcontroller, add below components from the Proteus
library.

Join these components and make a circuit as shown in the below figure:
Now create a new project in the MikroC Pro For PIC and add the below code into it.

/* Code provided by www.TheEngineeringProjects.com */


#define M1 PORTB.F7
#define M2 PORTB.F6
#define B1 PORTD.F0
#define B2 PORTD.F1

void main() {
TRISB=0;
TRISD=0xFF;
PORTB = 0;

while(1){
if(B1 == 0){PortB=0xAA;}
if(B2 == 0){PortB=0x55;}
}
}

Now burn the hex file of this project in the microcontroller of the Proteus file.
If everything goes well, then when you click one button the motor will move clockwise and when
you click other button the motor will move anti-clockwise.
I have also shown the simulation in the video below.
Note: The Proteus circuit of DC motor drive and the hex file to burn in the microcontroller has
been emailed to all the subscribed members.
If you need these files, then subscribe to our newsletter and these files will be emailed to you as
well.
That’s all about DC Motor Drive Circuit in Proteus ISIS. In the coming tutorial, we will have a look
at How to drive a Stepper Motor in Proteus ISIS.

Stepper Motor Drive Circuit in Proteus ISIS


Now we are going to see How to design a
Stepper Motor Drive Circuit in Proteus ISIS.
Stepper motors are usually of two types and the
main difference between the two is in the
number of wires used to control them. Mostly
stepper motors use 6 wires to control them but
few of them also have 4 wires to control them.
Today we will have a look on the 6 wired stepper motor.
In stepper motor, there are electromagnets which get polarized when we supply voltage to them
and depolarized when we remove the voltage. These electromagnets act as a stator and when
one side get magnetize, it attracts the rotor towards it and then we need to magnetize the other
side and demagnetize the previous one and, in this way, if the sequence is right the motor starts
moving.

Stepper Motor Drive Circuit in Proteus ISIS

First of all, add the below two components from the Proteus library in the workspace.

Now design the circuit as shown in the below figure:


This circuit is just for understanding purposes. Now I have added four states in the circuit, when
I make any state one that stator got magnetize and the motor rotor will attract towards that
stator and start moving.
In the below series of images, I have shown the clockwise movement of motor.

Now, as you can see from the above sequence of images, the motor is moving in the clockwise
direction as I am supplying voltage in the clockwise direction.
Now, if I reverse the order of applied voltage the motor will also reverse its direction and will
move in the counter clockwise direction.
The speed of the motor will depend on the speed of this sequenced voltages. If you apply these
voltages with delay, the motor will move slow and if you apply them fast and continuously, the
motor will rotate quite fast i.e. rpm of motor will increase.
Stepper Motor Control with Microcontroller

Now, in order to control this motor using stepper motor, simply connect these wires with four
pins of microcontroller and apply a sequenced voltage in programming and the motor will run
quite smoothly.
I will upload the video of the stepper motor control with microcontroller soon in this post.
That’s it for today and I hope now you got the idea how to design a Stepper motor Drive Circuit
in Proteus ISIS. In the next post, we will have a look at How to design a Servo Motor Drive Circuit
in Proteus ISIS.

Servo Motor Control with PIC Microcontroller


First of all, I am quite sorry about not posting for a long
time, actually the load of work has really increased and I
don’t even have time to comb my hair. Secondly, I have a
really great news for you guys and the news is we have
officially set up our office. Now, we will be more
professional than ever and will respond to your queries
quite fast now.
Let’s come back to our topic. Previously, I have discussed
the DC Motor control in Proteus ISIS and Stepper Motor Control in Proteus ISIS. So, now we are
left with only one motor which is Servo Motor. Today’s topic, as the name suggests is about the
Servo Motor Control using PIC Microcontroller. The microcontroller, I am going to use in this
tutorial is PIC16F877A. In this tutorial, I will design a circuit for Servo Motor Control and will also
provide the code, which I have used for Servo Motor Control. If you are working on a Servo
motor then you should also check Control Servo Motor with Arduino in which I have design a
servo motor control circuit using Arduino board. The code is also given there. Moreover, you
should also check Angle control of Servo Motor with 555 Timer.

A Brief Intro About Servo Motor

Servo motor is simply another motor having a much better control system already installed in it.
The beauty of servo lies in its precise angular movement. In other words, you can move the
motor at any angle you want. Like I want to move the motor to 30 degrees then I can do it quite
easily in servo, which is not possible in DC or stepper.
Moreover, it has just 3 wires to control, one is GND, one is Vcc and the third one which is usually
the middle one is for controlling purposes.
Now when you apply signal to the middle one, it starts moving. Now, how much it will move
depends on the length of signal applied. If the signal applied is small, it will cover small distance.

Servo Motor Control Circuit in Proteus ISIS

First of all, select the below components from the Proteus library and add it in your workspace.
Components Used:
These components are used while designing this simulation:

 PIC16F877a.
 Servo Motor.
 Crystal Oscillator. (16MHz)
 Resistors. (We need 3 resistors of 10k ohm)
 Capacitors. (We need 2 capacitors of 33pF)
 Two Push Buttons.
Working Principle:
Now, design your circuit as shown in the below figure:
When I started this simulation, the motor moved to the -90-degree angle. Now when I press the
button, it will move in the opposite direction.
That’s how it works. Just a simple motor nothing much complicated.

 PIC Microcontroller Code for Servo Motor Control


Here’s the code which I have used for controlling this servo motor. Burn this code in your PIC
Microcontroller.

#define M1 PORTB.F7
#define M2 PORTB.F6
#define B1 PORTD.F0
#define B2 PORTD.F1

int a;

void main() {
TRISB=0;
TRISD=0xFF;
PORTB = 0;
a = 1;
while(1){
if((B1 == 0) && (a==1)){
PortB=0xFF;
delay_ms(100);
PortB=0x00;
delay_ms(1);
PortB=0xff;
a=0;
}
if(B2 == 0){
PortB=0x00;
}

}
}

Note: The code and the Proteus Simulation has already been emailed to all the subscribed
members. If you are new here then subscribe to our newsletter and it will be emailed to you as
well.
That’s all for today. Hope I have helped you in some ways. In the next tutorial, we are going to
have a look at Relay Simulation in Proteus ISIS.

Relay Simulation in Proteus ISIS


Now when you talk about motors control then
first thing came in mind is Relay, because relay is
the best way of controlling any motor. In today’s
post, we are going to have a look at How to
Control Relay in Proteus ISIS. Relay is a key
component of any electronics or electrical circuit
and is usually a problem for the engineers and
students. Although, it’s not as difficult as it
seems so I thought to post about it.
In today’s post, we will first simulate the Relay in a simple circuit in which when you run the
simulation, the relay will automatically got activated and after that we will go in a bit detail and
will control relay using a logic, i.e. when you provide +5V to it then the relay will go activated and
when you give Gnd then it will de-energize. I will explain it below in detail how to use it with
Microcontroller. Moreover, if you are planning to work on Relay then you should also check
What is a Relay and How to use it? and should also have a look at Relay Interfacing with
Microcontroller using ULN2003 and finally must check this one as well Relay Control using 555
timer in Proteus ISIS. If you have any questions. related to it then ask in comments and I will try
my best to reply your queries. Let’s get started with designing of control relay in Proteus ISIS.
Simple Control Relay Circuit in Proteus ISIS

First of all, we are going to simulate a simple control relay circuit in which we will manually turn
on or off the relay.
Open Proteus ISIS and select the below components, as shown in below figure, from the
component’s library of Proteus, if you don’t know how to do it then check our earlier posts on
Proteus.

Now, design a circuit as shown in below figure:

The circuit is self-explanatory, first we have used a simple 12V battery to power up the
simulation, after that there’s a small led attached, which will indicate that whether proper power
is supplied to the system or not. Next is our relay, which is named as RL1 in the above figure.
After the relay, we have placed a simple 12V lamp, so now when the relay will be energized, this
lamp will glow up and when the relay is de-energized, the lamp will remain off. As in the above
figure, the simulation is off, that’s why the lamp isn’t glowing.
After designing the circuit, now click on the run button and if everything goes fine, then the lamp
will glow as shown in below figure:
So, now you can see the small led is also ON, I have used green that’s why it’s showing green
colour indicating that power supply is working.
If you compare the off state and on state simulation then you will see that the Relay is now
connected with second terminal and thus completing the circuit for lamp and lamp is also now
glowing.

Complex Relay simulation in Proteus ISIS

Now, we are going to design a bit more complex control relay simulation in Proteus ISIS, it’s not
much complicated but needs a bit more care while simulating.
In previous section, we have seen a simple circuit which is operated manually means in order to
turn it on or off you have to turn on or off the power supply but normally, it is required that the
relay must be controlled by some microcontroller automatically.
As the microcontrollers normally work on 5V so in order to control a 12V relay using 5V
microcontroller, we need to use transistor. In that case, when you give +5V the relay got
actuated and when you give GND then relay get turned off.
So, first of all get these components from the Arduino components library.
Now, design the circuit as shown in the below figure:

As this tutorial is about relays so I haven’t used microcontroller here, instead I used this logic
state, it will work same as microcontroller. So the above circuit is quite similar to the simple
circuit we have seen in the above section. The only difference here is the NPN transistor.
Now, we are not providing the supply directly to the relay, instead we are providing it via this
transistor. So, when the logid state is zero means ground, the transistor won’t work and the
supply cant reached to the relay and when we make the logic 1 means +5V on the base of
transostor, then the relay circuit will complete and the relay will be energized.
Now run the simulation, the off state is shown below:
In the above figure, you can see that the led goes on because the power is supplied to the circuit
but the lamp is still OFF and the relay is also not energized because the logic state is a low level
i.e. 0.
Now click on the logic state to make it on high level i.e. +5V, the on state is shown in below
figure:

Now you can see that as we make the logic state high, now relay got connected and the lamp is
also ON. So by comparing both ON and OFF states, you can easily get the idea how the relay is
operating.
Note: If you are planning on using the relay with microcontroller, then simply remove this logic
state and connect the base of transistor with the output pin of microcontroller and when you
low the microcontroller pin relay will get de energized and when you make the pin high, it will
get energized.
That’s all for today, hope you have got something out of it. In the next post I will show how to
simulate a DC motor using relay.
Design a Buzzer in Proteus ISIS
Today’s post is quite a simple one and is about
designing of circuit diagram of buzzer in Proteus
ISIS. Buzzer is quite a common electrical
component which is used in almost every
Embedded Systems project. For example, you
have seen a simple UPS, it gives a beep each
time the light goes off or it has depleted its
battery. Buzzer is normally used for given some
indication and normally this indication is kind of
a warning.
Proteus has a built-in component for buzzer and
it’s an animated component means it gives a
sound (beep) when it’s turned ON. So, I am going
to use that one and will give you an actual beep
on it. So, it won’t be much difficult and quite a simple procedure. In this post, I am not going to
interface it with any Microcontroller i.e. Arduino or PIC Microcontroller but if you want then you
can quite easily control it using any of them. You simply need to give pulse to it and you can
control it. If I get time then I will post the control of buzzer with Arduino. So, let’s start with it.

Design a Buzzer in Proteus ISIS

First of all, get components from the Proteus library as shown in below figure:
Now after selecting these components, design a circuit diagram in Proteus as shown in below
figure:

In the above circuit, I have used an optocoupler PC817 in order to control the buzzer.
The optocoupler is controlled by a simple logic operator, now when you change the logic
operator from 1 to 0 the buzzer will turn on.
Note: Optocoupler is working here on inverse logic i.e. when we send 1 then it’s OFF and when
we send 0 then its ON.
If you are designing it on hardware then you can use PC817 Optocoupler.
So now if everything’s fine then simply run the simulation and then click on the logic operator
and you will get the below results:

You can see in the above figure, there are two states.
In the Buzzer ON state LED is OFF but the buzzer will be ON and you will hear a beep like sound,
which obviously can’t be heard here in the image.
While in the OFF-state LED is ON but the buzzer will be OFF and you won’t hear anything.
That’s quite a simple tutorial and quite easy to understand but still if you have any problem, then
ask in comments.

Arduino Library for Proteus


I am going to share Arduino Library for Proteus. I am
quite excited about today’s post as its my first
complete Arduino Library for Proteus. In my previous posts, I have shared these boards in
separate libraries but today I am going to combine all the boards together in single library so that
you just simple install this library in your Proteus software and you get all the boards in your
Proteus workspace. You must also give a try to Genuino Library for Proteus.
I have already posted few other Arduino Libraries on my blog but those were third party
Libraries and has nothing to do with us. We were sharing them just for the sake of knowledge
but today I am going to share our very own Arduino library for Proteus, designed by our team
after a lot of hard work. We have tested all the boards with different types of hardware and
there’s not a single bug present in it. So, now you can easily use Arduino boards in Proteus and
can simulate any kind of project in Proteus. If you got any trouble then you can ask in comments
or can use our Ask Question forum to post your questions.

This Arduino Library for Proteus is unique in its kind because there’s no such library posted
before which has as much boards as we have in our Library. We have added almost all the basics
Arduino boards in it and we are also working on advance boards like Arduino DUE and other
Arduino shields like Arduino Wifi and Ethernet etc. Once we completed those libraries and tested
as well, then I will update them in this post as well. You should also have a look at Arduino
Tutorial for Beginners. Rite now this Arduino Library for Proteus contains following boards in it in
it:

 Arduino UNO
 Arduino Mega 2560
 Arduino Mega 1280
 Arduino Nano
 Arduino Mini
 Arduino Pro Mini
So, I hope you are going to like and enjoy today’s post quite a lot. So, let’s get started with
Arduino Library for Proteus.

Note: Other Proteus Libraries are as follows:

 Genuino Library for Proteus.


 GPS Library for Proteus.
 XBee Library for Proteus.
 Ultrasonic Sensor Library for Proteus.
 PIR Library for Proteus.
 Bluetooth Library for Proteus.
 Flame Sensor Library for Proteus.

If you haven’t bought your Arduino UNO yet, then you can buy it from this reliable source:
Buy Arduino UNO

Arduino Library for Proteus

First of all, download this Arduino Library for Proteus by clicking the below button:
Download Library for Proteus
When you download it, you will get a zip file. so, unzip this file and you will get two files in it.
These two files are named as ArduinoTEP.LIB and ArduinoTEP.IDX.
Copy these two files and place them in the libraries folder of your Proteus software.
Note: If you are unable to add Library in Proteus 7 or 8 Professional, then you should have a look
at How to add new Library in Proteus 8.
Now, restart your Proteus software and in components section search for ArduinoTEP as shown
in below figure:

These are all the boards designed by our team in Arduino Library for Proteus.
In Proteus workspace, these boards will look like as shown in below figure:

So, these are the boards, which you can use in this Arduino Library for Proteus.
There’s one board missing in this figure which is Arduino Mega 1280, because its same as
Arduino Mega 2560 so I haven’t posted it here but it’s included in the library.
So, now you have all the Arduino board in your Proteus software and you can simulate them as
you want them.
Let’s design a simple Arduino UNO led blinking circuit for better understanding.
So, design a circuit as shown in below figure:

Now open your Arduino software and open the LED blinking Example and get your hex file.

Note: If you don’t know about hex file then read How to get hex file from Arduino.

Now upload your hex file in your Arduino board.


Hit the Run button on your Proteus software and you will get result as shown in below figure:
So, now in this way, you can easily simulate any of your above mentioned Arduino boards quite
easily in Proteus software using our Arduino Library for Proteus.
Below is the video in which I have described this tutorial in detail so that you can get it quite
easily.
If you are new to Arduino then you should try these Arduino Projects for Beginners, they will
help you to get your hands on this marvellous creation.

Genuino Library for Proteus


Today, I am going to share a new Genuino
Library for Proteus. Genuino boards are just the
same as Arduino boards but with slight
difference of color and shape. I have already
posted a tutorial on Arduino Library for Proteus
in which I have explained how to download the
Arduino Library and use it in Proteus. Today, I
am going to post a similar library but for
Genuino boards. Their functionality is exactly the
same as the Arduino Library but they have better
look and Genuino Color.
II hope you are going to like this library as well. Other bloggers are welcome to share this library
with their reader but do mention our link in creator section, we will be really obliged. Now, let’s
start with the Genuino Library for Proteus.

Genuino Library for Proteus

First of all, download the Genuino Library for Proteus from the below button:
Download Library Files
In the above link, you will get an rar file which will have two files, named as:

 GenuinoTEP.LIB
 GenuinoTEP.IDX
Now place these two files in the Library folder of your Proteus software.
Note: If you are using Proteus 7 or 8 Professional, then then you should have a look at How to
add new Library in Proteus 8 Professional.
Now start your Proteus software and go to Component searching section and search for
GenuinoTEP as shown in the below figure:

Now place them in your Proteus work space and they will look like as shown in below figure:

In the above figure, five of these genuino boards are visible. The sixth board is Arduino
Mega1280, which is similar to Arduino Mega 2560 in shape so that’s why I have omitted it in the
above image.
Now you can design any of your project on Genuino board quite easily in Proteus using this
Genuino Library for Proteus.
In order to upload the code in any of these boards you need to double click it to open its
properties.
For example, I double click the Arduino UNO board then the Properties panel will look like as
shown in below figure:

In the above figure, you can see a section named Program file, that’s where you are gonna
browse your hex file.
You should read How to get Hex file from Arduino, if you don’t know already.
So, get the hex file and upload here and your Genuino board will get active.
In the below video, I have explained in detail How to use this Genuino board in Proteus and have
already tested the blink example.
That’s all for today, I hope you will enjoy this Genuino Library for Proteus.

GPS Library for Proteus


I am going to share another awesome library designed
by our team for Proteus, which is GPS Library for
Proteus. It’s my second library for Proteus, the first one
was Arduino Library for Proteus which I have already
shared. I am really enjoying designing these modules in
Proteus because its a new and quite challenging thing. I
haven’t found even a single website who has designed
these modules in Proteus already. So, now for the first time, you can have the GPS Library for
Proteus using which you can easily simulate your GPS module in Proteus and can design your
code for Arduino, PIC Microcontroller or 8051 Microcontroller.
Other bloggers are welcome to share this library and it’s my humble request that do mention our
blog in credits. The GPS module, I have designed for Proteus is a simple GPS which has TX and
RX pins and when you start the simulation, this module starts sending the NMEA data on its TX
pin, which you can easily check using Virtual Terminal. I am going to show you how to check it in
today’s post. Another important thing, obviously in Proteus Simulation we can’t get the actual
values of longitude, latitude etc, so in our model, I have used the dummy values for all these
data. The benefit of this module is that you can easily design your code for GPS and can test it in
your simulation. Plus, its design is cool as well.

Note: Other Proteus Libraries are as follows:

 Arduino Library for Proteus.


 Genuino Library for Proteus.
 GPS Library for Proteus.
 GSM Library for Proteus.
 XBee Library for Proteus.
 Ultrasonic Sensor Library for Proteus.
 PIR Library for Proteus.
 Bluetooth Library for Proteus.
 DS1307 Library for Proteus.

You should also check Interfacing of GPS Module with Arduino in Proteus ISIS, in which I have
shared How to use this GPS Module with Arduino board.

GPS Library for Proteus

First of all, click on the below button and download GPS Library for Proteus.
Download Library for Proteus
After downloading, you will get a zip file containing three files in it.
Now extract all these three files named as:

 GpsTEP.LIB
 GpsTEP.IDX
 GpsTEP.HEX
Place these files in Libraries folder of your Proteus software.

Note: If you are having trouble in adding library to your Proteus 7 or 8 Professional, then you
should have a look at How to add new Library in Proteus 8.

Now open your Proteus software, if you have already opened it then restart your Proteus
software.
Now in components list search for GPS Module and place it in your workspace.
If everything’s fine then you will get your module as shown in below figure:
As you can see in the above figure, it has two pins in total which are TX and RX.
Now double click this GPS module and you will get to its properties as shown in below figure:
Now, one last thing you need to do is to upload the GpsTEP.HEX file, which you got in the
downloaded zip file, in the Program File section.
This GpsTEP.HEX file is essential for this model as its adding the functionality of GPS in this
model.
So, after adding the link of GpsTEP.HEX file in the Program File section, now your Gps module is
ready to use in your circuit.
So, now let’s add a Virtual terminal and check the output of this GPS Module. If you haven’t
worked on Virtual Terminal before then you should read How to use Virtual Terminal in Proteus
ISIS.
Design a small circuit as shown in below figure:

Note: The baud rate of this GPS Module is 9600.


The data sent by this GPS module is dummy as we can’t get these values in simulation.

Now let’s run the simulation and check the Virtual Terminal and if everything goes fine then you
will get results as shown in below figure:
The first line is just the intro for this module and after that you will start receiving data which is
in NMEA format.
NMEA data will remain constant but will keep on coming.
Now, instead of using this Virtual Terminal, you can use any microcontroller here like Arduino,
PIC Microcontroller or 8051 Microcontroller etc. and can write your code easily and test it.
In my coming tutorials, I am going to share examples for this GPS module in which I will interface
it with different Microcontroller.
In the below video, I have explained this tutorial again so if you got any trouble then watch it as
well.
That’s all for today. You should also have a look at Interfacing of GPS Module with Arduino in
Proteus ISIS. I hope you guys have enjoyed today’s post and are going to get benefit from it. Let
me know your views about today’s tutorial and also give your suggestions and help us in making
this GPS Library for Proteus smarter.

XBee Library for Proteus


Hello everyone, today I am going to share a new XBee Library for
Proteus. I am quite excited while sharing it as we are the first
developer for this XBee Library. Now you can quite easily use
XBee module in your Proteus software using this XBee Library for
Proteus.Wehave spent quite a lot of time in developing this and
that’s the reason I couldn’t share new tutorials in the past few
days. Anyways we are done with this new exciting XBee Library for
Proteus, hope you are going to enjoy this one. I have already
sharede two libraries for Proteus which are Arduino Library for
Proteus and GPS Library for Proteus. You can also interface this
XBee module with Microcontrollers like Arduino, PIC
Microcontroller and 8051 Microcontroller quite easily.
As it’s the first version of our XBee Library for Proteus so it’s not quite perfect and can’t do the
complex tasks such as analog inputs etc. It will just do the serial communication. This xbee
module has two pins TX and RX and you can do your communication with it quite easily. We
have designed this XBee Library for Proteus, after quite a lot of effort and we are quite proud
that we are presenting it first time for Proteus. Other bloggers are welcome to share this library
on their blogs to share the knowledge but do mention our blog post link in your post. You should
also have a look at XBee Arduino Interfacing. So, let’s get started with it.

XBee Library for Proteus

First of all, download this XBee Library for Proteus by clicking on the below button:
Download Library for Proteus

Now once you click it you will get a zip file to download so download this zip and open it.
In this zip file you will get two files named as:

 XBeeTEP.LIB
 XBeeTEP.IDX
So, now place these two files in the libraries folder of your Proteus software.

Note: If you are new to Proteus 7 or 8 Professional, then you should have a look at How to add
new Library in Proteus 8 Professional.

Now, start your Proteus ISIS software or restart it if it’s already running.
Go to your component’s library and search for XBee Module as shown in below figure:

Now place it in your workspace and it will look something as shown in below figure:
If you don’t know much about xbee module then you should also have a look at Introduction to
XBee Module.
As you can see in the above figure, it’s our xbee module in Proteus for the first time.
As, I mentioned earlier, it’s a first version of xbee module so it’s not very advanced and it will do
just the basic serial communication i.e. sending and receiving data.
It has two pins on it which are TX and RX and using these two pins you can send and receive data
quite easily.
So, let’s design a simple example and we will see How to do the Serial communication using this
new XBee library for Proteus.
Design a simple circuit as shown in below figure:
Now what I did is, I simply place a Virtual terminal with both of these xbee modules.
Now we need to change the Properties of one of these XBee module so double click on any one
of these and you will get the below window:
You should also have a look at Interfacing of XBee with Computer.
Now, I have simply changed the Physical Port of this module to COM2 while the other module is
at COM1.
So, now one of my XBee module is at COM1 while the second module is at COM2.
Now when I run my simulation then both XBee will start sending and receiving data on their
respective COM Ports.
So, what I need to do is to virtually combine these two ports and for that I have used a software
named as Virtual Software Driver from Eltima and I combine these two ports.
Now, run your simulation and whatever you type in the Virtual Terminal of first xbee will appear
in the virtual terminal of second xbee. as shown in below figure:
You can also interface this XBee module with other microcontrollers like Arduino, PIC
Microcontrollers or 8051 Microcontrollers etc.
I have explained this whole tutorial in below video as well.
I hope you have enjoyed it and are going to like it. Let me know if you got into any trouble and
have problems in using this library. Also share your suggestions about improvement in this XBee
Library for Proteus.

Arduino UNO Library for Proteus


In today’s post, I am going to share Arduino UNO Library for
Proteus. I have already shared two Arduino libraries for Proteus
and they are also quite good but now I have thought to design
them by myself in Proteus, which was quite difficult and literally it
took me weeks to figure out How to add functionality of a new
component in Proteus. First I have used Proteus VSM but it was
quite difficult so I left it and finally I used Microsoft Visual Studio
C++ Language to design this Arduino library for Proteus.

I am not going to discuss How I designed this library because it’s quite a lengthy process and I
will discuss it some other time. Today, I will provide you the Arduino UNO library for Proteus to
download so that you can use it easily in Proteus and can simulate your circuits easily. I am really
excited about it as its my first Proteus library and I am gonna design more in near future. Till now
I have just designed Arduino UNO board in Proteus. Soon, I will share libraries for other Arduino
boards as well.
In today’s post I will first share the Arduino UNO library for Proteus, and will explain how to use
it. After that we will also have a look at a simple blinking example so that you get complete
overview of this Arduino UNO library for Proteus. So, let’s get started with it.
I have added all the Arduino boards in a single library. This library contains six Arduino boards
which are Arduino UNO, Arduino Mega 2560, Arduino Mega 1280, Arduino Nano, Arduino Mini
and Arduino Pro Mini. You can download this complete Arduino Library by checking Arduino
Library for Proteus.

Arduino UNO Library for Proteus

First of all, download the Arduino UNO library for Proteus by clicking the below button.
Download Arduino Library for Proteus
In this downloaded zip file you will find two files, named as:

 ArduinoUnoTEP.dll
 ArduinoUnoTEP.idx.
Now extract these two files and place it in the libraries folder of your Proteus Software.

Note: If you are having problems in adding library in Proteus 7 or 8 Professional, then you should
read How to add new Library in Proteus 8 Professional.
If you haven’t bought your Arduino UNO yet, then you can buy it from this reliable source:
If you want to read its technical specifications, features and pinout then you should have a look
at Introduction to Arduino UNO.

Now, open your Proteus software and search for Arduino as shown in below figure:

Now select this Arduino board and click OK.


Now place this Arduino UNO board in your Proteus workspace and it will look as shown in below
figure:
This is our new Arduino UNO board designed in Proteus. I could have used the typical blue color
of Arduino UNO but I thought to use this color instead of dark blue to give it a new touch 🙂 Btw
its the color of Arduino Software.
So, now we have our Arduino UNO board in Proteus. Now double click this board in order to
open its Properties.
When you double click it, below window will pop up.
Now here you can set different properties of Arduino UNO board.
The main property is the Program File. You need to upload the hex file of your Arduino code in
this location.
If you don’t know how to get the hex file then read How to get hex file from Arduino software in
which I have explained in detail.
So, once you have the hex file of your code then upload it here and click OK.
You can also set the clock frequency of your Arduino board which by default is 16MHz.
The URL shows the address of our website so don’t change it.
Anyways, that’s how you can use Arduino UNO board in Proteus software.
Now let’s design a simple LED blinking project with this new Arduino UNO board in Proteus. You
should also have a look at these Arduino Projects for Beginners.
So, design a circuit as shown in below figure:
Now open the Blink example from your Arduino software and get its hex file.
Upload this hex file in your Arduino board and hit the RUN button.
If everything goes fine then you will get the results as shown in below figure:

So, that’s all, now when you are doing your project, what you need to do is to first of all create
your design in Proteus, after that design your Arduino code and get the hex file, upload that hex
file in your Arduino board in Proteus and run your simulation.
Below is given the video tutorial for this post in which I have explained visually how to download
and use Arduino UNO library for proteus.
So, that’s all for today, feel free to let us know about your experience with our Arduino UNO
library for Proteus. If you have any suggestions and comments then do let us know so that we
can enhance its capabilities. I will keep on updating this library for example, I haven’t yet added
the PCB design in this board but will add it soon and will update it. So, stay tuned and have fun!!!

Update: You can download the complete Arduino Library having six Arduino
boards by checking Arduino Library for Proteus.

Ultrasonic Sensor Library for Proteus


In today’s post I am gonna share an Ultrasonic Sensor
Library for Proteus. Few days ago I have posted a tutorial
on Arduino Library for Proteus which also has the
Ultrasonic sensor in it but that’s a quite basic library for
Ultrasonic sensor, so here comes the new Ultrasonic
Sensor Library for Proteus. Using this library you can
perform any kind of function with ultrasonic sensor, you
can also interface it with different Microcontrollers like
Arduino, PIC Microcontroller etc.
First of all, let’s have a brief introduction of ultrasonic sensor. In ultrasonic sensor, there are two
nodes in which one is transmitter while the other is receiver. The transmitter sends an ultrasonic
wave and this wave strikes to any hindrance present in front of it and then bounces back. This
bounced ultrasonic sensor is then captured by the receiver and on the basis of the time taken by
this wave to return, the sensor calculates the distance of that obstacle from that sensor.
Ultrasonic sensor is usually used for detecting the obstacle in path and also to find the distance
between sensor and the obstacle. Ultrasonic sensor normally used is HC-SR04, which is also used
here in this library. Let’s get started with Ultrasonic Sensor Library for Proteus, in this library we
have used an extra pin on ultrasonic sensor, which is analogue pin. The voltage on that pin is
used to detect how close object is because it’s a simulation and we can’t place an actual object in
front of our laptop. Moreover, you should also have a look at this Home automation Projects
using XBee & Arduino, I have used this ultrasonic sensor in that project.
I hope you are going to enjoy this library, I have also shared many other libraries which are
mentioned below, I hope you are going to enjoy them too. These libraries are designed by our
team after a lot of effort so it’s a humble request to all other bloggers that share it as much as
you can but do mention our blog post link in the description. So, let’s get started with Ultrasonic
Sensor Library for Proteus and its interfacing with Arduino.

Note: for hardware implementation of Ultrasonic Sensor with Arduino, check below posts:

 Interfacing of Single Ultrasonic Sensor With Arduino.


 Interfacing of Multiple Ultrasonic Sensor With Arduino.

I have also posted more examples on Ultrasonic Sensor Simulation in Proteus, have a look at
them and you will get complete understanding of this sensor.
Ultrasonic Sensor Library For Proteus

First of all download this Ultrasonic Sensor Library for Proteus, by clicking on the below button.
Download Ultrasonic Library for Proteus
In this ultrasonic sensor library for Proteus, you will find three files which are:

 UltrasonicTEP.IDX
 UltrasonicTEP.LIB
 UltrasonicTEP.HEX
Now, place these three files in the library folder of your Proteus software.
Note: If you are new to Proteus 7 or 8 Professional, then you should read How to add new
Library in Proteus 8 Professional.
Now start your Proteus software and in components list, search for Ultrasonic sensor and place it
in your workspace as shown in below figure:

Now we have our ultrasonic sensor in Proteus but if you run it then it won’t work as we haven’t
yet added any functionality in it.
So, in order to add the functionality double click this ultrasonic sensor and open its properties.
In properties, select the Program File section and browse to UltrasonicTEP.HEX file and upload it
as shown in below figure:
Now our ultrasonic sensor is ready to be used.
Now let’s make a simple example for ultrasonic sensor so that you get an idea how to use it in
Proteus.

Ultrasonic Simulation in Proteus

After adding the Ultrasonic Sensor Library for Proteus, open your Proteus ISIS software or restart
it if its already open.
Now search for the below components in the Proteus Components Library and add them in your
workspace as shown in below figure.
Components Used
Here’s the list of components, which I have used for designing this Proteus Simulation:

 Arduino UNO
 Ultrasonic Sensor HC-SR04
 LED
 Variable Resistor

Proteus Simulation
After adding these components, now design a simulation as shown in below figure:

Now in this example, I am receiving data from Ultrasonic Sensor and then printing this data over
Virtual Terminal in Proteus, if you are not much familiar with Virtual Terminal, then read How to
use Virtual Terminal in Proteus ISIS .
Now open your Arduino software and paste the below code in it and compile to get the hex file,
read Arduino Library for Proteus to know how to get the Arduino Simulation in Proteus.
You must also read How to get the hex file from Arduino Software.
const int pingPin = 7; // Trigger Pin of Ultrasonic Sensor
const int echoPin = 6; // Echo Pin of Ultrasonic Sensor

void setup()
{
Serial.begin(9600); // Starting Serial Terminal
}

void loop()
{
long duration, inches, cm;
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(10);
digitalWrite(pingPin, LOW);

pinMode(echoPin, INPUT);
duration = pulseIn(echoPin, HIGH);
inches = microsecondsToInches(duration);
cm = microsecondsToCentimeters(duration);

Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();

delay(100);
}
long microsecondsToInches(long microseconds)
{
return microseconds / 74 / 2;
}

long microsecondsToCentimeters(long microseconds)


{
return microseconds / 29 / 2;
}

It’s quite a simple code and is self-explanatory, if you still got some trouble then ask in
comments and I will reply them. I have simply used the ping example in Arduino Examples and
slightly modified it.
After getting the hex file, now upload it to Arduino in Proteus by clicking the properties.
Click on the Start button and if everything’s gone fine then you will see an output as shown in
below figure:

As you can see in the above figure, the virtual terminal is showing distance values, now this value
depends on the variable resistance attached to the ultrasonic sensor.
As you change the value of the variable resistance, the voltage on that particular pin will also
change and on the basis of that you will get the distance in inches and centimeters on the virtual
terminal.
Arduino code and hex file along with the Proteus Simulation for this ultrasonic example are
attached below. You can download it by clicking on the below button but I would suggest you to
design it on your own, it will help you in learning.
You should also have a look at these Arduino Projects for Beginners.
Download Code and Simulation

That’s all for today, in the coming post I am going to share some more examples of how to use
ultrasonic sensor in Proteus.

PIR Sensor Library for Proteus


Today, I am going to share a new PIR Sensor Library for
Proteus. We all know about PIR Sensor but if you don’t
know then first read Interfacing of PIR Sensor with
Arduino. I have shared the basic knowledge of PIR Sensor
in that post. So it will be quite helpful if you read that post
first. As a quick review, PIR sensor is used to detect
motion in the environment and is commonly known as
motion sensor. Its quite helpful in security projects where
you need to detect motion. For example, in some bank
vault where there’s no possibility of motion, you can place
this sensor and can check if there’s any movement. It is
also used in home automation like if there’s no movement
in some room then turn off its lights. So, in short PIR
sensor has numerous uses and is used quite a lot in
engineering projects.

PIR Sensor module is not available in Proteus so we can’t use it in our simulations until now. But
today, I am going to share a new PIR Sensor Library for Proteus using which you can quite easily
use this PIR Sensor in your Proteus software. It works quite similar to Ultrasonic Sensor Library
for Proteus and is fully compatible with Arduino Library for Proteus. You should also check our
other libraries for Proteus which are GPS module Library for Proteus and XBee Library for
Proteus. We are the first developers in history who are sharing these new Proteus Libraries.

First I am gonna show you today, How to download this PIR Sensor Library for Proteus and then
we will also design a small simulation in Proteus in which I am gonna interface this PIR Sensor
with Arduino UNO. You can interface it with any microcontroller like PIC Microcontroller or 8051
Microcontroller. But today, I will interface it with Arduino microcontroller and as a homework
you guys interface it with PIC Microcontroller or 8051 Microcontroller and share it in comments
os that others can get some benefit of it. In coming posts I am gonna share some more such
examples using this PIR Sensor. Other bloggers are requested to add our links in their blog posts
while sharing these libraries. So, let’s get started with PIR Sensor Library for Proteus.

PIR Sensor Library for Proteus

First of all, click on the below button to download PIR Sensor Library for Proteus:
Download PIR Library for Proteus
Once you download it, you will get three files in it named as:

 PIRSensorTEP.LIB
 PIRSensorTEP.IDX
 PIRSensorTEP.HEX
Place all these three files in the library folder of your Proteus software.
Now open your Proteus software and search for PIR Sensor, you will get total four models in it.
Place these models in your Proteus workspace and it will look something as shown in below
figure:
I have added four models of this PIR Sensor in Proteus Library and you can use any of them.
As working is concerned, they are all same but they differ in color just to make them more
attractive.
The first color is our normal color, which I always use for my Proteus Libraries while second one
is green, third is pinkish and fourth one is blue.
This PIR Sensor has total four Pins, among which one is Vcc so you need to give +5V at this pin
which other is GND which you need to ground.
The OUT pin is our main pin through which we will be getting our output like whether it detects
the motion or not.
Now, obviously we can’t detect real motion in Proteus Simulation that’s why I have placed a
TestPin which will be working as a simulation Pin.
If TestPin is HIGH, it means the motion is detected and if its LOW then it means the motion is not
detected.
Now we have our module in Proteus so one last thing we need to do is to add its functionality in
it.
So, in order to do so, double click this PIR sensor and in Program File section give path to the file
PIRSensorTEP.HEX which you have placed in the library folder of your Proteus software as shown
in below figure:

Now click OK and your PIR Sensor is ready to be used in the Proteus Simulation.
So, now let’s design a simple example for this PIR Sensor which will help you in understanding
this sensor.

PIR Sensor simulation in Proteus

Design a simple circuit in Proteus software as shown in below figure:


Now you can see in the above figure that I have placed a PIR Sensor along with Arduino UNO and
Virtual terminal.
PIR Sensor is connected to Pin # 2 of Arduino UNO.
Now upload the below code in Arduino software and get the hex file. You should read How to
get Hex File from Arduino, if you don’t know already.

#define pirPin 2

int calibrationTime = 30;


long unsigned int lowIn;
long unsigned int pause = 5000;
boolean lockLow = true;
boolean takeLowTime;
int PIRValue = 0;

void setup()
{
Serial.begin(9600);
pinMode(pirPin, INPUT);
}

void loop()
{
PIRSensor();
}
void PIRSensor()
{
if(digitalRead(pirPin) == HIGH)
{
if(lockLow)
{
PIRValue = 1;
lockLow = false;
Serial.println("Motion detected.");

delay(50);
}
takeLowTime = true;
}

if(digitalRead(pirPin) == LOW)
{

if(takeLowTime){lowIn = millis();takeLowTime = false;}


if(!lockLow && millis() - lowIn > pause)
{
PIRValue = 0;
lockLow = true;
Serial.println("Motion ended.");

delay(50);
}
}
}

Now run your simulation, and click the logic button to 1, which will indicate that motion is
detected and you will get something as shown in below figure:
Now let’s make the logic state to 0, which will indicate that no motion detected, as shown in
below figure:

So that’s how our PIR Sensor is going to work in Proteus. I hope you are going to like this PIR
Sensor Library for Proteus.
You can download the simulation by clicking on the below button:
Download PIR Simulation
Here’s a you tube video, in which I have explained
this PIR Sensor Library for Proteus in more details
so much check it out.

Bluetooth Library for Proteus


Today, I am going to share a new Bluetooth Library
for Proteus. Using this Library, now you can quite
easily use Bluetooth modules in Proteus ISIS. I have
designed two Bluetooth modules which are HC-05
and HC-06. We all know about these modules. We
use these modules for sending data through
Bluetooth. Till now, there’s no such Bluetooth Library designed for Proteus and we are the first
developers of this awesome Bluetooth Library for Proteus. I hope you guys are going to like it. I
have also posted a tutorial in which I have done Arduino Bluetooth Communication using HC05
in hardware. I hope that one will also be interesting to read, if you have planned to start working
on Bluetooth Module.

Other bloggers are welcome to share this Bluetooth Library for Proteus on their blogs but do
mention our link as a respect to our efforts. These Bluetooth modules are not going to accept AT
Commands rite now as we haven’t added much functionality in it but we are going to add more
soon. I will also add more Bluetooth modules in this library and will update it with time. Right
now, it just has two Bluetooth modules in it, which are:

 Bluetooth Module HC-05


 Bluetooth Module HC-06
You can do serial communication with these modules quite easily. So, let’s get started with
Bluetooth Library for Proteus an see How to install it and how to use it in Proteus.

Bluetooth Library for Proteus

So, first of all, download this Bluetooth Library for Proteus by clicking the below button:
Download Bluetooth Library
In this rar file, you will find two files which are named as:

 BluetoothTEP.IDX
 BluetoothTEP.LIB
So, download these two files and place them in the library folder of your Proteus ISIS software.

Note: If you are using Proteus 7 Professional, then the library folder link will be something like
this: C:\Program Files (x86)\Labcenter Electronics\Proteus 7 Professional\LIBRARY
If you are using Proteus 8 Professional, then the library folder link will be something like this:
C:\ProgramData\Labcenter Electronics\Proteus 8 Professional\Data\LIBRARY

Now open your Proteus software or restart it if it’s already open and search for Bluetooth and
you will get something as shown in below figure:

Now select both of these modules and place them in your workspace and it will look like
something as shown in below figure:
As, I told earlier, we have just used the basic TX and RX pins of these Bluetooth modules.
That’s why you can see in the above figure that only TXD and RXD are working while all others
are not working.
Let’s have a look at it working, so let’s design a simple circuit and do the communication
between these two Bluetooth modules.
If you haven’t worked on Virtual Terminals then you should read How to use Virtual Terminal in
Proteus.
So, design a simple circuit as shown in below figure:
Now click any HC-05 module and you will get a pop-up window.
In this window, select COM1 for first HC05 module and COM2 for second HC05 module.
Now your COM1 and COM2 should be virtually connected, I have shown how to connect the
COM ports virtually in the below video.
Now, run your simulation and whatever you send in first terminal will show in second terminal
and vice versa.
That’s all for today, hope you have liked this post and are goanna enjoy it. Let me know about
your remarks for this Bluetooth Library for Proteus.

DS1307 Library for Proteus


In today’s post, I am going to share a new DS1307 Library for
Proteus. Recently, I have shared the GSM Library for Proteus,
which was really appreciated by the readers so I got quite
excited and have designed another new Proteus Library.
Currently I am working on many Proteus Libraries. In future, I
am going to design almost all the sensors in Proteus. So, stay
tuned with us.
Anyways coming to today’s post, today we are going to have a
look at DS1307 Library for Proteus. Using this library, now you
can quite easily simulate DS1307 module in Proteus in a quite
stylish way. I have designed it in red color because its available in red color in market. DS1307
module is already available in Proteus but that one is quite basic and it looks quite dull. The one
designed by our team looks quite attractive and is also easy to use. I will post its tutorials soon in
which I will interface it with Arduino and PIC Microcontroller. You should also have a look at
DS1307 Arduino based Digital Clock in Proteus. So, let’s get started with DS1307 Library for
Proteus:

DS1307 Library for Proteus

First of all, download the DS1307 Library for Proteus, by clicking the below button:
Download Proteus Library for DS1307
Now, when you click this button you will get a rar file so unrar this file and in it you will find two
files named as:

 RTCModuleTEP.IDX
 RTCModuleTEP.LIB
Place both of these files in the library folder of your Proteus software.
Now restart your Proteus software or open it.
In the search component bx, search for RTCModuleTEP or DS1307 and place it in your
workspace.
If everything goes fine then you will get your RTC Module DS1307 as shown in below figure:

That’s it, now you have the ready to use DS1307 module in Proteus.
You need to add a crystal oscillator between X1 and X2 pins while the remaining are used for I2C
Protocol, which is a common protocol for RTC Modules.
I will also post a tutorial in which I will interface this RTC Module with Arduino or PIC
Microcontroller and then you will get a better idea of how to use it.
If you design some project using this DS1307 Library for Proteus then do share it with our
community so that others could also get benefit out of it.
Video
So, that’s all for today. You should also have a look at these New Proteus Libraries for
Engineering Students.

Gas Sensor Library for Proteus


Today, I am going to share a new Gas Sensor Library
for Proteus. I hope you guys are going to enjoy this
one. We are all well aware of Gas Sensors which are
used for detection of different gasses in the
atmosphere. These sensors are not available in
Proteus so that’s why I have designed a library using
which now you can use these different gas sensors
quite easily in Proteus software. You can interface this
Gas Sensor with any Microcontroller, for example:
Arduino, PIC Microcontroller or 8051 Microcontroller
etc.

In this Gas Sensor Library for Proteus, I have added


eight different Gas Sensors, which are used for
detection of different gases. As we all know that
Proteus is a simulating software so it won’t be able to detect the gas in real in Proteus. So, that’s
why I have placed a Test Pin in each of these sensors so when you make this pin HIGH, then it
means the gas is present and if this Test Pin goes LOW then it means there’s no gas available and
sensors will give LOW output. We will have a look at How to use these sensors below. You should
also have a look at the project LPG Gas Leak Detector using Arduino in which I have used this Gas
Sensor MQ-2 with Arduino. So, here’s the list of all eight gas sensors, I have added in this library:

 MQ-2 Gas Sensor


 MQ-3 Gas Sensor
 MQ-4 Gas Sensor
 MQ-5 Gas Sensor
 MQ-6 Gas Sensor
 MQ-7 Gas Sensor
 MQ-8 Gas Sensor
 MQ-9 Gas Sensor
So, let’s start with downloading and installing of Gas Sensor Library for Proteus.

Gas Sensor Library for Proteus

First of all, download the Gas Sensor Library for Proteus by clicking the below button:
Download Gas Sensor Library
Once you download the file, you will get a rar file so unrar it and you will find three files in it,
named as:

 GasSensorTEP.LIB
 GasSensorTEP.IDX
 GasSensorTEP.HEX
Place all these three files in the Library folder of your Proteus software.
Now open your Proteus software or restart it, if it’s already open.
In the components section, make a search for Gas sensors as shown in below figure:

Now place all of them in your work space and they will look something as shown in below figure:
So, these are all the Gas Sensors available in this Gas Sensor Library for Proteus.
You can see all of these sensors has four pins on them.
Two of these pins are Vcc and GND while third is OUT Pin.
Test Pin is used for simulation purposes, when you have HIGH on Test Pin then it means that you
have Gas in the atmosphere and your sensor will give HIGH as well on the OUT Pin.
So, let’s check it out how to use these gas sensors. So, take any of these sensors and design a
small circuit as shown in below figure:
Now before running your simulation, one thing you need to do is to double click this gas sensor
and open the Properties.
In Properties, you will find a Program file section. In this section browse for the
GasSensorTEP.HEX file, which we just downloaded above and placed in the library folder of our
Proteus software.
Now run your simulation, and when you turn logic state HIGH then you will see the OUT Pin will
also go HIGH as shown in below figure.
You can plug this OUT Pin of your Gas Sensor in your Microcontroller e.g. Arduino, PIC
Microcontroller etc.

So, that’s how you can quite easily simulate this Gas Sensor in Proteus ISIS.
Here’s the video in which I have demonstrated this library in detail:
So, that’s all for today, I hope you guys have enjoyed this Gas Sensor Library for Proteus. You
should have a look at LPG Gas Leak Detect using Arduino in which I have designed its Proteus
simulation.

Arduino Lilypad/Nano Library for Proteus


few day ago I have posted a tutorial on how to do
Arduino Simulation in Proteus. In that post, we
have used an Arduino Library for Proteus but as
this library is in its initial phases that’s why
currently it supports only three basic Arduino
boards which are Arduino UNO, Arduino
Mega2560 and Arduino Mega1280. But as we
know there are numerous Arduino boards which are used these days. So, I searched a little and I
came across this amazing Arduino Lilypad Library for Proteus which has the support for few
other arduino boards, so I thought to share it with you guys. I have tested this library myself as
always and its 100% working. I have tested it on Proteus 7 and I think it will work fine on Proteus
8 as well. As we have the support for above three boards in the previous library so the two new
boards here are Arduino Lilypad and Arduino Nano, both of them are quite used these days. I
have explained it in detail, step by step below, if you still feel problem in any step then ask in
comments.This library has the support for following boards:

 Arduino UNO
 Arduino UNO SMD
 Arduino Mega
 Arduino Nano
 Arduino Lilypad

Arduino Lilypad Library for Proteus

First of all, download this new Arduino Lilypad Library for Proteus by clicking on the button
below:
Download Arduino Lilypad Library For Proteus
Once you downloaded the rar file, extract the file named as “BLOGEMBARCADO.LIB“.
Now place this file in the library folder of Proteus, which, in my case, is “C:\Program Files
(x86)\Labcenter Electronics\Proteus 7 Professional\LIBRARY“. I hope it will give you the idea
where to place the file.
After placing the file in this folder, now open the Proteus ISIS and click on the component
selection button.
In the search box write “Arduino” and the list of all the arduino boards will be shown
immediately as shown in the below figure:

You can see all the five boards in the above figure and you can select any of them. There’s also
another components in the list which is ultrasonic sensor. Yes, this library also supports
ultrasonic sensor but I haven’t tested it yet that’s why didn’t mention it, I will test this sensor
soon and then will also explain its working.
Now you can select any of these boards and can start working on them right away. All the five
boards are shown in the below figure:
The two new Arduino boards in this library are shown below:

So, now simply design your circuit and write the code in the Arduino ide. After writing the code,
get the hex file from arduino software and upload it to these boards.
In order to upload the hex file simply double click it and the properties window will pop up. In
the Properties window, there will be an option named Program File. In this Program File, browse
for the hex file and upload it.
Now run your Proteus simulation and it will work like charm.
I will post few projects on these boards soon as soon as I get time to write them, so stay tuned
and have fun.
I have posted a small project on how to use Arduino Lilypad in Proteus which you can read and
download from Arduino Lilypad Simulation in Proteus.

Arduino Lilypad Simulation in Proteus


Yesterday, I have posted a new Arduino Lilypad /
Nano Library for Proteus in which we have seen
how to add that library into Proteus so that you
could be able to use these boards in Proteus. That
was quite easy. Today I am going to post a small
project in which we will see how to use that
library and produce an Arduino Lilypad simulation
in Proteus. In this Arduino Lilypad simulation in
Proteus, I am going to use obviously he Arduino
Lilypad board along with few LED lights and will make them blink. It’s also quite easy and you can
also download the simulation and the hex file at the end of this project but I would suggest you
to do it yourself so that you learn something out of it.
Before starting this project, you must have first integrated the Arduino Lilypad Library as without
it you won’t be able to do this project. So, if you haven’t downloaded it yet then you should read
the previous post Arduino Lilypad / Nano Library for Proteus first. Let’s get started with this
project.

Arduino Lilypad Simulation in Proteus

Now I assume that you have already downloaded the Arduino Lilypad Library for Proteus and are
ready to use it within Proteus.
So open Proteus ISIS and get these components from the Proteus components library as shown
in below figure:
After getting these components, draw a circuit in Proteus as shown in the below figure:

You can clearly see in the above figure, the Arduino Lilypad Simulation in Proteus. After that you
need to write a code for Arduino Lilypad so that you could get the hex file for it.
In this project, I have used three LED lights and make them ON and OFF using the switch button.
If the button is not pressed then the LEDs will remain ON and when you hit the button , the LEDs
will go OFF.
Copy the below code and paste it into the Arduino software and compile.

int analogPin = A0;


int ledCount = 3;

int ledPins[] = {
2, 3, 4};

void setup() {
// loop over the pin array and set them all to output:
for (int thisLed = 0; thisLed < ledCount; thisLed++) {
pinMode(ledPins[thisLed], OUTPUT);
}
}

void loop() {
// read the potentiometer:
int sensorReading = analogRead(analogPin);
// map the result to a range from 0 to the number of LEDs:
int ledLevel = map(sensorReading, 0, 1023, 0, ledCount);

// loop over the LED array:


for (int thisLed = 0; thisLed < ledCount; thisLed++) {
// if the array element's index is less than ledLevel,
// turn the pin for this element on:
if (thisLed < ledLevel) {
digitalWrite(ledPins[thisLed], HIGH);
}
// turn off all pins higher than the ledLevel:
else {
digitalWrite(ledPins[thisLed], LOW);
}
}
}

After compiling this code, get the hex file of code. The hex file and this simulation file is also
given at the end of this post so you can download it from there.
Now upload this hex file into this Arduino Lilypad and hit the RUN button
If everything’s goes fine then as youhit the run button, the LEDs will get ON as shown in the
below figure:
Now, when you press the button, these LEDs will go OFF as shown in the below figure:

That’s all, you have successfully implemented the Arduino Lilypad simulation in Proteus.
In order to download this simulation and the hex file, click on the below buttons.
Download Proteus Simulation

Circuit Designing of LCD with Arduino


Today, I am going to share Circuit Designing of
LCD with Arduino in Proteus ISIS. In my previous
tutorial, I have posted a tutorial on How to use
Arduino Library in Proteus. Using that library, we
can easily test Arduino code in Proteus to check
whether it’s working or not. If you haven’t read
that post then before starting it, first read it, as without adding the arduino library we can’t use
Arduino in Proteus.

Coming to today’s post, as we have done adding the Arduino Library in Proteus, so I thought to
do some projects on it and the first one I chose is quite simple one i.e. Circuit Designing of LCD
with Arduino in Proteus ISIS. So we will have a look on how to show some characters on LCD
using Arduino in Proteus. If you are working on LCD then you should also have a look at my new
post Scrolling Text on LCD using Arduino. Let’s get started with Circuit Designing of LCD with
Arduino in Proteus ISIS:

Circuit Designing of LCD with Arduino in Proteus ISIS

First of all, design a circuit of LCD and Arduino in Proteus ISIS, if you have already added the
Arduino Library then you won’t find any problem in finding the Arduino in components library of
Proteus.
You should also download this New LCD Library for Proteus.
Design the circuit as shown in below figure:

Now, we need to design Arduino sketch for LCD, so open Arduino software and place below code
into it.
You should have a look at How to get Hex File from Arduino.

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup()
{

lcd.begin(16, 2);
lcd.print("www.TheEngineer");
lcd.setCursor(0,1);
lcd.print("ingProjects.com");
}
void loop() {}

Note: For Arduino code, I have used Liquid Crystal Arduino Library, which you can download
from the below link and add it in the libraries folder of Arduino software.
Download LiquidCrystal Arduio Library

Now compile the code, and get the Arduino hex file which will be in the tmp folder, you can read
Arduino Library for Proteus to know in detail how to get the hex file of Arduino sketch.
Now double click the Arduino in Proteus ISIS and properties window will pop up.
In properties panel, under the Program File section, browse to Arduino hex file as shown in
below figure and upload it.
Now click Ok and Run your simulation, if everything goes fine then your LCD will start showing
the characters as shown in below figure:
You should also have a look at these Arduino Projects for Beginners.

That’s all, was it difficult??? I don’t think so. Anyways, if you got into any trouble, do ask in
comments.
In the coming posts, we will explore Arduino in Proteus ISIS more.

Interfacing of Seven Segment with Arduino in Proteus


Today we are going to have a look on how to interface Seven Segment with
Arduino in Proteus. In my last post, I have posted an Arduino Library for Seven
Segment Display, which is designed by our team and is quite basic in
functionality. So, if you haven’t checked that post then first of all check that one
and download the Arduino Library for Seven Segment Display as I am going to
use that library in today’s post. Moreover, in order to run this library, you are
also going to need to download Arduino Library for Proteus, using this library you
will be able to use Arduino board in Proteus so also read that post and download this library and
install it in your Proteus.
Again I am mentioning that its the first library designed by our team so its in basic stages, it has
few functions and will only display the numeric on the seven segment display which is normally
required. I am planning on adding more examples in the library for future use, which will
increase the functionality. Anyways that’s a future talk, let’s start today’s post.

What is Seven Segment Display?

Let’s first have a look at what is Seven Segment Display. Seven Segment display is nothing but an
electronic device used for displaying the numeric data. It’s a complex form of LED matrix and is
normally used in clocks, LCD displays, calculators etc where there’s a need to display the numeric
data. It has total seven leds in it which you can also count from above image and by turning
these LEDs ON or OFF we can display any numeric on it. For example, have a look at the below
image. In this image I have shown numeric 0 on seven segment. Now in order to do so, I just
simply turn OFF the centered LED and turn ON all the corner LEDs and it becomes 0.

How does Seven Segment Work?

Now, let’s have look at how it works. So, we have seen that Seven Segment is named seven
segments because it has total seven LEDs on it so now what we need to do is to control these
seven LEDs, also named as segments, and then we can display any character on it. There are two
types of seven segments available in the market and named as:

 Common Cathode
 Common Anode
They both work exactly the same and has only a slight difference. They both has total seven pins
and each pin is used to control each led and they have an extra pin which is named as Common
Pin. In Common Cathode you have to GND this Common Pin, while in common Anode, you have
to give +5V to this Common Pin. Have a look at this below image, we have labelled leds with
respect to the pins.

Interfacing of Seven Segment with Arduino in Proteus

Now we know all about Seven Segment Display and know how it works so let’s interface Seven
Segment with Arduino in Proteus.
Now, I am assuming that you have installed the Arduino Library for Proteus and have also
installed the Arduino Library for Seven Segment display.
So, now open your Arduino Software and go to File>Examples>SevenSegment>Counting.
Open this example, in this example I have added a counter which will start counting from 0 to 9
and once it reached 9 then it will start counting again.
If you can’t find this example then you must be making some mistake in installing the library,
anyways the code is shown below.

Note: In order to run this example you will need two libraries, the inks are given below to
download:
Arduino Library for Proteus
Arduino Library for Seven Segment Display

/*

Counting

This Arduino example is for Seven Segent display.


It will start the counter from 0 and will end up at 9
and will start again from 0.

This example code is in the public domain.

Created by Syed Zain Nasir at 14 March 2015.

You can get the explanation and latest version of this library at:
http://www.TheEngineeringProjects.com/

*/

#include “SevenSegment.h”

SevenSegment tep = SevenSegment(0,1,2,3,4,5,6);

char arr [10] = {‘0′,’1′,’2′,’3′,’4′,’5′,’6′,’7′,’8′,’9’};


int index;
void setup(){

index = 0;
}

void loop(){

tep.display(arr[index++]);
delay(1000);
if(index == 11)
index = 0;
}

Now open you Proteus Software and design the circuit in it as shown in below figure, I have also
attached the file for download at the end.

Now compile the code and gt the hex file and upload it in your Arduino Properties.
Now Run the Proteus software, and you will see the seven segment display will start counting, a
glimpse of it is shown in the below figure:
Below is attached the Proteus file and the hex file for the counting example which you simply
start and run but again I suggest that you should design it by yourself so that you get something
out of it.
Download Proteus Simulation of Seven Segment with Arduino
One last thing, any kind of contribution to this library from the readers is highly appreciated,
design your projects and share codes with us and we will post them on our blog for other
readers to get knowledge as knowledge is all about sharing.

ADC value on LCD using Arduino


In today’s project, we will see how to display ADC
value on LCD using Arduino in Proteus ISIS. Its quite a
simple project in which we are gonna measure the
voltage of ADC pins and then will display them over to
LCD. The microcontroller I am using in this project is
Arduino. The simulation is designed in Proteus ISIS. IF
you are working on PIC Microcontroller then you
should have a look at How to Display ADC value on LCD using PIC Microcontroller in Proteus ISIS.
Arduino has 10 bit ADC pins so whenever you apply voltage on these pins it will give you a value
ranging from 0 to 1023 depending on the voltage provided. One can easily get this value using a
simple function in Arduino analogRead(); but the real problem is to convert this analog value into
the actual voltage present on the pin. Suppose you are using A0 pin of arduino and you are
providing 3.3V over to this pin, now when you use this analoagRead() function then it will give
you some value say 543, but you wanna know what’s the actual voltage at this pin which is 3.3V
so now converting this 543 to 3.3 is a bit tricky part. It’s not difficult but involves a little
calculations, which I am gonna cover today in detail. Before going any further, make sure you
have already installed the Arduino Library For Proteus, if not then first do it because without this
library you won’t be able to use Arduino board in Proteus. So, let’s get started with How to
Display ADC value on LCD using Arduino.

Display ADC value on LCD using Arduino in Proteus ISIS

I have divided this tutorial on How to Display ADC value on LCD using Arduino in few steps,
follow these steps carefully and if you get into some trouble then ask in comments and I will try
my best to resolve them, all the materials are provided at the end of step 1 for download but I
suggest that you design your own so that you do mistakes and learn from them. Moreover, you
should also have a look at these Arduino Projects for Beginners. Anyways, let get started:

Step1: Circuit Designing in Proteus


First of all, I have designed a circuit in Proteus for Displaying ADC value on LCD using Arduino.
In this circuit, I have used two transformers which I have named as Potential Transformer and
Current Transformer. I am supplying 220V to these transformers which is then converted into
5V.
I have set the turn ratio of these transformers such that they give maximum 5V at the output.
Now,rest of the circuit is simple, I have just connected the LCD with Arduino so that we could
display these ADC value over to LCD.

Note:
Before connecting any pin to ADC, make sure that the output should be less than 5V. Otherwise,
there’s a chance that the pin burnt out.
If you don’t know about LCD then read Ciruit Designing of LCD with Arduino in Proteus.
You should also download this New LCD Library for Proteus.

Here’s the circuit diagram of displaying ADC value on LCD using Arduino in Proteus ISIS:
You can download the Proteus Simulation and the Arduino hex file for Displaying ADC value on
LCD using Arduino by clicking on below button:
Download Proteus Simulation and Arduino Hex File
It’s quite simple and self explanatory. After designing the circuit diagram, now let’s move to
second step, which is code designing for Displaying ADC value on LCD using Arduino.

Step 2: Arduino Code Designing


Now copy the below code and paste it into Arduino software. Compile your code and get the
Arduino hex file.
If you don’t know How to get the hex file from Arduino then read Arduino Library for Proteus, I
have explained it in detail there.

#include <LiquidCrystal.h>
#define NUM_SAMPLES 10

int sum = 0;
unsigned char sample_count = 0;
float voltage = 0.0;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int PT = A0;
const int CT = A1;
float Cur;
float Vol;
float Power;

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(20, 4);
// Print a message to the LCD.
lcd.setCursor(6,1);
lcd.print("Welcome To");
lcd.setCursor(5,2);
lcd.print("Energy Meter");
//delay(5000);
lcd.clear();

Constants();
}

void loop() {
lcd.setCursor(0, 2);
ShowVoltage(9, 0, PT);
Vol = voltage;
ShowVoltage(9, 1, CT);
Cur = voltage;
Power = Vol * Cur;
lcd.setCursor(7,2);
lcd.print(Power);
}
void Constants()
{
lcd.setCursor(0,0);
lcd.print("Voltage: ");
lcd.setCursor(0,1);
lcd.print("Current: ");
lcd.setCursor(0,2);
lcd.print("Power: ");
lcd.setCursor(14,0);
lcd.print("V");
lcd.setCursor(14,1);
lcd.print("A");
lcd.setCursor(12,2);
lcd.print("W");
}

void ShowVoltage (int x,int y, unsigned int value)


{
while (sample_count < NUM_SAMPLES)
{
sum += analogRead(value);
sample_count++;
delay(10);
}

voltage = ((float)sum / (float)NUM_SAMPLES * 5.015) / 1024.0;


lcd.setCursor(x, y);
lcd.print(voltage);
sample_count = 0;
sum = 0;
}

The code is quite simple and self explanatory, the only difficulty is in ShowVoltage function. In
this function, I have first taken an average of 10 ADC values and after that I have applied a simple
formula over it and then it will start start giving the voltage value which I have simply displayed
over the LCD.
Now everything’s done, so Get your Hex File from Arduino Software and let’s check the results
whether it displayed ADC value on LCD using Arduino or not

Step 3: Result
We have designed the electronic circuit in Proteus and have also designed our code and
uploaded the hex file in Arduino.
Now press start button and you will see something like this:

Now if you compare the voltages in voltmeter and on LCD, you can see they are exactly the
same. You can check the value of variable resistor and the values in LCD will also change as the
voltage in voltmeter change.
That’s all for today, hope I have conveyed some knowledge today and now you can easily Display
ADC value on LCD using Arduino. In the next post we will explore more Arduino features.

Control Servo Motor with Arduino in Proteus


Today’s post is about Controlling of Servo Motor with
Arduino in Proteus ISIS. Servo Motor is quite a common
motor used in engineering projects. It is normally used
where precise circular motion is required. The reason is
because we can move the servo motor at any desired
angle which is not possible in case of other motors. For
example, I want to move my antenna at precise angle of
90 degree then in that case I can use DC Motor but in DC
motor I have to use encoder if I want to move it precisely
at 90 degrees. Or I can also move DC motor with delays
but in that case it can stop at 85 of 95 something which is
not very precise. So, in such cases instead of using DC
motor, I will prefer Servo Motor. You should have a look at How to Control Servo Motor in
Proteus.
I have already posted Angle Control of Servo Motor using 555 Timer in which I have controlled
servo motor using 555 timer and another tutorial about Controlling of Servo Motor using PIC
Microcotroller in which I have controlled it with PIC microcontroller. And today we are going to
Control Servo Motor with Arduino and will design the simulation in Proteus ISIS. First of all, we
will have a look at simple control of servo motor with arduino in proteus ISIS and then we will
check the control of servo motor with arduino using buttons in which we will move the servo
motor to precise angles using buttons. So, let’s get started with it. 🙂

Simple Control of Servo Motor with Arduino in Proteus

First of all, open your Proteus ISIS software and design the below simple circuit.
You should also have a look at these Proteus Libraries of Components.

Servo Motor has three pins, one of them goes to Vcc, other one to GND while the center pin is
the controlling pin and goes to any digital pin of Arduino. I have connected the control pin to pin
# 4 of my Arduino.
Next thing we need to do is to design the code for Arduino. So, open your Arduino software and
copy paste the below code in it.

#include <Servo.h>

Servo myservo;
int pos = 0;

void setup()
{
myservo.attach(4);
}
void loop()
{
for(pos = 0; pos <= 180; pos += 1)
{
myservo.write(pos);
delay(15);
}
for(pos = 180; pos>=0; pos-=1)
{
myservo.write(pos);
delay(15);
}
}

Now compile this code and get your hex file. Its the same code as given in the Servo folder of
Examples in Arduino software.
Upload your hex file in your Proteus Arduino board.
Note: You should read How to get Hex File from Arduino, if you don’t know already.
Now, run your simulation and you will see that your Servo motor will start moving from 90
degrees to -90 degrees and then back to 90 degrees and will keep on going like this, as shown in
below figures:
Now when you start it , first of all it will show the Position A in above figure then will move
anticlockwise and pass the position B and finally will stop at Position C and then it will move
clockwise and comes back to Position A after passing Position B.
In this way it will keep on moving between Position A and C.
Till now we have seen a simple control of Servo Motor with Arduino in Prtoteus ISIS, now lets
have a look at a bit complex control of servo motor with Arduino.

Control Servo Motor with Arduino using Push Buttons

In the previous section, we have seen a simple Control of Servo Motor with Arduino in which we
simply moved Servo motor from 90 degrees to -90 degrees and vice versa. Now I am gonna
control Servo motor using five push buttons and each push button will move the Servo motor to
a precise angle.
So, first of all, design a small design as shown in below figure:

I have added five buttons with Arduino and now with these five buttons I will move Servo motor
to 90 , 45 , 0 , -45 and -90 degrees. So, each buttons has its precise angle and it will move the
motor to that angle only.
So, now next thing is the code, copy paste the below code in your Arduino software and get the
hex file:

#include <Servo.h>

Servo myservo;

int degree90 = 8;
int degree45 = 9;
int degree0 = 10;
int degree_45 = 11;
int degree_90 = 12;

void setup()
{
myservo.attach(4);
pinMode(degree90, INPUT_PULLUP);
pinMode(degree45, INPUT_PULLUP);
pinMode(degree0, INPUT_PULLUP);
pinMode(degree_45, INPUT_PULLUP);
pinMode(degree_90, INPUT_PULLUP);
}

void loop()
{
if(digitalRead(degree90) == LOW)
{
myservo.write(180);
}

if(digitalRead(degree45) == LOW)
{
myservo.write(117);
}

if(digitalRead(degree0) == LOW)
{
myservo.write(93);
}

if(digitalRead(degree_45) == LOW)
{
myservo.write(68);
}

if(digitalRead(degree_90) == LOW)
{
myservo.write(3);
}
}

Upload this hex file to your Arduino board in Proteus and run the simulation.
Now press these buttons from top to bottom and you will get the below results:

The above figure is quite self explanatory but still I explain a little.
In the first figure I pressed the first button and the motor moved to -90 degrees.
In the second figure I pressed the second button and the motor moved to -45 degrees.
In the third figure I pressed the third button and the motor moved to 0 degrees.
In the fourth figure I pressed the fourth button and the motor moved to 45 degrees.
In the fifth figure I pressed the fifth button and the motor moved to 90 degrees.
In the sixth figure all buttons are unpressed and the motor remained at the last position.
It was quite simple and hope I explained it quite simply, if you still have any questions then ask in
comments and I will try to resolve them.

Traffic Signal Control Project using Arduino


Today, I am going to share a Traffic Signal
Control using Arduino. Few days earlier, I have
posted the same tutorial but it was Traffic Light
Signal Using 555 Timer in Proteus ISIS and today
we will do the same thing but using Arduino
programming. Its quite a simple but good
starting project on Arduino. So, if you are new to
Arduino then must give it a try.
Traffic Signal Control is quite a usual thing. We see traffic signals daily on our roads and usually
engineers are asked to design such projects in their initial semesters. If we look at the traffic
signals then we can see they are simply turning ON and OFF lights at some fixed regular intervals.
and the pattern is quite simple as well. so I have simply followed that pattern and design the
code. You should also have a look at Arduino 3 Phase Inverter. So let’s start with designing this
project named as Traffic Signal Control using Arduino.

Traffic Signal Control using Arduino

First of all, design a circuit in Proteus for Traffic Signal Control using Arduino as shown in the
below figure:

It’s quite a simple project so the circuit is quite simple as well. You can see I have just placed an
Arduino board and plugged three LEDs with it and obviously they are Green, Yellow and Red in
colour.
These LEDs are attached to pins 2,3 and 4 of Arduino UNO.
Now next step is to write the Arduino Code for Traffic Signal Control using Arduino, so I have
written and it is shown below:

#define GreenLed 4
#define YellowLed 3
#define RedLed 2

void setup()
{
pinMode(GreenLed, OUTPUT);
pinMode(YellowLed, OUTPUT);
pinMode(RedLed, OUTPUT);
}

void loop()
{
digitalWrite(GreenLed, HIGH);
digitalWrite(YellowLed, LOW);
digitalWrite(RedLed, LOW);
delay(5000);delay(5000);
digitalWrite(GreenLed, LOW);
digitalWrite(YellowLed, LOW);
digitalWrite(RedLed, HIGH);
delay(5000);delay(5000);
digitalWrite(GreenLed, LOW);
digitalWrite(YellowLed, HIGH);
digitalWrite(RedLed, LOW);
delay(3000);
}

That’s the complete code for this project Traffic Signal Control using Arduino and I think it’s quite
self-explanatory plus I have also changed the colour accordingly.
First of all Green LED is ON and the rest are OFF which is shown in green colour.
Next Red LED is ON and the rest are OFF after around 10 seconds which you can change by
changing these delays.
Finally, the Yellow LED will be ON and you can see it goes OFF just after 3 sec because it has short
delay, you can change these delays quite easily.
Below is the flow chart of above programming for Traffic Signal Control using Arduino which will
clear the theme properly.

Now compile your Arduino code and get the hex file.
Now when you upload the hex file into your Arduino, it will give output as shown below:
So that’s how it will work, I hope you got this clearly as its quite simple, will meet you soon in the
next tutorial.
Intelligent Energy Saving System
Today, I am going to share a complete project with
you guys. Its an Intelligent Energy Saving System
which I designed around two years ago. So, today I
thought to share it so that others could also get
benefit. In this project, I have used Arduino UNO
board for programming purposes. Its not much
complicated project but is the basic for many
complex projects.
Energy, is a small word, but is the problem of whole
world. Particularly when we are talking about
electrical energy. IF you consume more electrical energy then you will get quite huge bill at the
end of the month. So, there’s always work done on reducing the consumption of electrical
energy. As a human, suppose you turn ON your room fan, then normally you forget to turn it OFF
and thus your bill keeps on increasing. So, in order to avoid this, automation is the only tool
which comes in handy. Like there must be such system which automatically detects whether
someone is still in the room or not and if there’s no one then lights got OFF automatically. In this
way, you can quite easily reduce your electricity cost. This same concept is presented in this
project, let’s have a complete look over it.

Overview of Intelligent Energy Saving System

In this project, we have designed a complete room and used two inductive loads i.e. bulbs and
one fan.
Now the purpose of this project was to save the energy so we used two IR sensors for counting.
Now, if there’s no one present in the room then the loads will automatically turn OFF and when
someone will enter in the room then the loads will automatically turn ON.
Moreover, we have also added a counter functionality in it i.e. the project will also count the
number of people present in the room.
All these parameters will also display on the LCD attached with Arduino.

Components Used
I am mentioning here the components used in designing this project. I am not giving the exact
values as you will get them in the circuit diagrams. Here’s the list:

 Arduino UNO
 IR Sensors
 16 x 2 LCD
 100W Bulbs
 12V Fan
 2 Relay Board
 7805 (IC Regulator)
 LED (Indication)
 Resistance
 Capacitors
Circuit Diagrams of Intelligent Energy Saving System

Suppose you are designing this project then the first thing you are gonna need is the circuit
diagrams for the project so here I am gonna show you all the circuit diagrams step by step so
let’s start:

1: Interfacing of Arduino with LCD


First thing we are gonna need is the interfacing of Arduino with LCD. LCD used in this project is
16 x 2.
I have first designed the simulation in Proteus as its always better to design the simulation
before going into real hardware.

Now upload the below code into it, just to test that whether its working fine or not:

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup()
{

lcd.begin(16, 2);
lcd.print("www.TheEngineer");
lcd.setCursor(0,1);
lcd.print("ingProjects.com");
}
void loop() {}
2: Circuit diagram of 2 Relay Board
Next thing we are gonna need is the two relay board. Using these relays we are gonna turn ON
or OFF our loads.
Here’s the circuit diagram for 2 relay board.

As you can see in the above figure, I have used two relay board, where both the relays are
controlled by simple logic operators.
Now instead of these logic operators, you need to give Arduino Pins here.
I have made the first relay ON while the second relay is OFF.
In the above figure, relay outputs are open so you can place anything here as its gonna act as
switch. So, in our case the loads will be placed after this relay.

3: Circuit Design of Buzzer


Next circuit design which we need to understand is the buzzer circuit design.
Its quite simple and similar to 2 relay board. I have also published a detailed post on How to
Design a Buzzer in Proteus ISIS, which will be quite helpful.

You can quite easily understand the above figure, where I have shown both the ON and OFF
states of buzzer.

4: Circuit Diagram of IR Sensor:


In this project, I have used two IR sensors, both are placed on the door one after another. You
can read more about the designing of IR Sensor on my post Circuit Diagram of IR Sensor using
555 Timer.
I have named them Entering IR Sensor and Leaving IR Sensor.
The logic behind these two sensors is that, when someone enters in the room then he will first
pass the Entering IR Sensor and then will hit the Leaving IR Sensor and if someone is leaving the
room then he will first pass the Leaving IR Sensor and then will cut the Entering.
So, in this way I am counting the persons if someone entering in the room I simply increment
and if someone’s leaving then I decrement.
Now, if number of people in the room becomes zero then I turn OFF all the lights and the fan,
and if there even one person in the room then I turn ON the lights and fan.
Here’s the circuit diagram of IR Sensor:

IR transmitter and Receiver are not available in Proteus so that’s why I have used the button so
when you press the button, its like someone cut the beam of IR sensor, and you will get below
result:

5: Complete Circuit Diagram of Intelligent Energy Saving System


Now that we have designed the individual circuit diagrams, next thing we are gonna do is the
assembly of complete project.
So, here’s the complete circuit diagram of this project:
As you can see in the above figure, I have used two IR Sensors. The first IR Sensor is for entering
in the room while the IR sensor is for leaving the room.
Next is the buzzer circuit which is also quite simple and I have explain in detail above.
LCD will display the no of people in a room and will also display either the bulb is ON or OFF, and
also about Fan status.
I haven’t shown the relay circuit in above figure as it will not fit in the space and I think you guys
can place it easily.

Programming Code for Intelligent Energy Saving System

The code designed for this project is developed in Arduino software.


Code is as follows:

#include <LiquidCrystal.h>
#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS 8
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

float celsius, fahrenheit;

int Sensor1 = A0;


int Sensor2 = A1;

int Bulb = A5;


int Fan = A4;
int Buzzer = A3;

int Counter = 0;
int Sen1Check = 0;
int Sen2Check = 0;

void setup(void)
{
Serial.begin(9600);
digitalWrite(Bulb, HIGH);
digitalWrite(Fan, HIGH);
digitalWrite(Buzzer, HIGH);
pinMode(Sensor1, INPUT);
pinMode(Sensor2, INPUT);
pinMode(Bulb, OUTPUT);
pinMode(Fan, OUTPUT);
pinMode(Buzzer, OUTPUT);

lcd.begin(20, 4);
lcd.setCursor(0, 1);
lcd.print("Temp = ");
lcd.setCursor(0, 0);
lcd.print("Counter = ");
lcd.setCursor(12, 0);
lcd.print("Persons");
}

void loop()
{
CheckEntry();
CheckLeaving();
lcd.setCursor(7, 1);
sensors.requestTemperatures();
lcd.println(sensors.getTempCByIndex(0));
lcd.setCursor(12, 1);
lcd.print(" degC");
lcd.setCursor(10, 0);
if(Counter >= 0){lcd.print(Counter);}
if(Counter < 0){Counter = 0;}

if(Counter > 0)
{
digitalWrite(Bulb, LOW);
digitalWrite(Fan, LOW);
digitalWrite(Buzzer, HIGH);
lcd.setCursor(0, 2);
lcd.print("Fan : ON ");
lcd.setCursor(0, 3);
lcd.print("Bulb : ON ");
}

if(Counter < 1)
{
digitalWrite(Bulb, HIGH);
digitalWrite(Fan, HIGH);
digitalWrite(Buzzer, HIGH);
lcd.setCursor(0, 2);
lcd.print("Fan : OFF");
lcd.setCursor(0, 3);
lcd.print("Bulb : OFF");

void CheckEntry()
{
if(((digitalRead(Sensor1) == LOW) || (Sen1Check == 1)) && (Sen2Check == 0))
{
while(digitalRead(Sensor1) == LOW);
Sen1Check = 1;

if(digitalRead(Sensor2) == LOW)
{
Counter++;
Sen1Check = 0;
while(digitalRead(Sensor2) == LOW);
}
}
}

void CheckLeaving()
{
if(((digitalRead(Sensor2) == LOW) || (Sen2Check == 1)) && (Sen1Check == 0))
{
while(digitalRead(Sensor2) == LOW);
Sen2Check = 1;

if(digitalRead(Sensor1) == LOW)
{
Counter = Counter - 1;
Sen2Check = 0;
while(digitalRead(Sensor1) == LOW);
}
}
}

Coding isn’t much difficult for this project, but still if you get into some trouble ask in comments
and I will check it out.
Here’s the complete video for this Intelligent Energy Saving System, which will explain all about
the project.
That’s all for today.

Power Factor Measurement Using Microcontroller


Today’s post is about Power Factor Measurement using
Microcontroller in Proteus ISIS. As usual, I have this
project simulation in which I have to simulate a power
factor measuring project using atmega microcontroller.
So, I use atmega8 microcontroller and the used Proteus
ISIS as the simulating software. Power Factor
Measurement isn’t that difficult but it’s a quite tricky
and in today’s post we are gonna cover it in full detail.
There are many ways for power factor measurement
and today’s the method we are gonna use is called zero
crossing detection. We will first detect the zero crossing
of our signal and then we are gonna do the power factor
measurement based on the detection of zero crossing of our voltage and current signal. Seems
bit difficult don’t worry we are gonna do everything and in quite full detail so stay with me and
enjoy the tutorial. But before going into the details of power factor measurement, let’s first
discuss the basics of power factor measurement because before that you won’t understand a bit.
We have designed this simulation after quite a lot of effort so its not for sale but has a quite
small cost of $20 so that engineering students can buy it easily. You can buy the simulation along
with hex file and code by clicking on the above button and it will lead you to Product page of this
product. So, let get started with it.

Basics of Power Factor

In AC circuits, there are total three types of loads which are normally bear by an AC current,
named as:

 Resistive Loads.
 Capacitive Loads.
 Inductive Loads.
We are all quite well aware of these and if you are not then I must say you wont read further and
must first get some basic knowledge about these loads. Among these three loads Resistive loads
are known as the most decent loads as they don’t mess up with the current and just simply let
the current pass through it and that’s why there’s no such power loss in these types of loads. But
when it comes to Capacitive or Inductive loads. they are quite disturbing types of loads and
hence they don’t let the current easily pass through them and slightly distort the current signals.
In case of Capactive loads, the current waveform got ahead of the voltage waveform and hence
got a lead angle. In other words, current waveform leads the voltage waveform. While in case of
Inductive loads, the scenario is quite the opposite. In Inductive loads, current waveform lags the
voltage waveform. The below figure shown the difference between these loads output.
In the above figure, Red waveform is showing the current wave, while the green waveform is
showing the voltage wave. So its quite obvious from above three figures that in case of resistive
load there’s no angle difference but in case of capacitive load, current waveform leads the
voltage waveform while in Inductive load current waveform lags the voltage waveform and in
this case I have used a constant angle of 60 degrees for both capacitive and inductive loads.
Now because of this angle difference there’s quite an energy loss which is not quite good for any
system so the best scenario for any system is that this angle should be 0 which is the case of
resistive loads.
Now question is why we are reading this stuff while we are actually interested in power factor
measurement so, yes, now I am coming towards it.
Power Factor is simply the cosine of this leading or lagging angle. In simple words, if you get this
leading or lagging angle between current and voltage waveform, which in the above figure is 60
degrees, and then take the cosine function of that angle, you will get the Power factor for your
system.
So, if we calculate the power factor for the above waveform, for which the leading or lagging
angle (both) are 60 degrees, then we get:
Power Factor = Cos ( 60 degrees )
Power Factor = 0.5
So, the power factor of our above system is 0.5 which is quite bad.
Now, what’s the meaning of this 0.5 power factor, it means that our system’s efficiency is 50%
and the energy dissipation is also 50% so our system’s efficiency is as well 50%.
So, if we want to improve our systems’ efficiency, then we need to increase the Power Factor of
our system.
So, now we have seen the basics of power factor and have got quite an idea about what is it so
now let’s start with how to measure power factor using Microcontroller in Proteus ISIS.

Power Factor Measurement with Zero Crossing Detection

There are many methods available for Power Factor measurement and in this post we are gonna
use the zero crossing detection in order to measure it .
As we all know, the voltage and current waveform are basically the sine waves so they must
cross the zero point at some time.
And what we need to do is to detect the zero crossing of both these waves. So, first of all we are
gonna do this in Proteus.
So, design a circuit in Proteus for Power Factor Measurement as shown in below figure:
In the above circuit design, I have used two voltage sources which are U2 and U3, I have
considered U2 as the voltage transformer while the U3 as the current transformer, when you are
designing the actual circuit in hardware then you need to use the current and voltage
transformer.
The reason why we need to use CT and PT is because the normal voltage is normally of 220V or
110V which we can’t directly give to our microcontroller because it will burn our microcontroller.
So, we need to lower this voltage level and need to bring it to such level which is easily operable
by microcontroller, which in normal case is below 5V.
So, now I suppose you have used the CT PT and you are getting your current and voltage
waveforms in the order of 5V but now again there’s another issue that the voltage we are getting
is AC while our microcontroller works on DC so we need to find some way to convert this AC into
DC.
So, in order to do, I have used this 8 pin amplifier LM358 as a comparator.
What LM358 is doing ?? Its simply comparing the voltage coming at its inverting pin to the
voltage at its non inverting pin and whenever both voltages match it will send a HIGH pulse to
the output.
You can see clearly that I have placed a GND on the non inverting pin of LM358 so whenever we
get zero crossing on the inverting side it will send us a HIGH pulse at output.
That’s how we are converting our AC signal into DC signal as well as detecting the zero crossing.
Let’s have a look at these waveform in Oscilloscope.
PF measurement in proteus, PF proteus simulation, power factor measurement, power factor
proteus design, how to get power factor, calculate power factor, measure power factor

The below two waveform are the current and voltage waveform, red one is current while the
green one is voltage and I have placed a lagging angle of 30 degrees that’s why current
waveform is lagging the voltage waveform.
While the above two waveform are the output of LM358 and we can see clearly they are giving
the high peaks when the lower waveform cut their zero axis.
So that’s how we are doing the zero crossing detection.
We have got the zero crossing detection and now what we are gonna do in programming is to
first detect the zero crossing of current waveform and then we will start counting the time until
we get the zero crossing of voltage waveform.
So, basically what we are gonna do is we are gonna count the time difference between current
wave and voltage wave zero crossing.
When we got the time difference between these two waves, we can get the angle quite easily
using the below formula.

We have got the time difference and we have already know the frequency of our system which is
normally 50 HZ or 60Hz.

Power Factor Measurement Using Microcontroller in Proteus

Now we have already detected the zero crossing so now next thing is to calculate the time
difference which we are gonna do in our microcontroller.
So, in order to do the time calculation, first of all we will detect the zero crossing of current
wave.
Then we will start a timer which will start counting and we will stop this counting when we get
the voltage curve.
So, in order to do these tasks, I have used the below code:

void pf_func(){
while(1)
{
if ( PINC.4==1 )
{
TCNT1=0;
TCCR1B = 0x01;
break;
}
else {
continue;
}
}
while(1){
if ( PINC.3 == 1 ){
TCCR1B = 0x00;
g=TCNT1;
break;
}
else {
continue;
}
}
}

Now, when we detect the zero crossing of current waveform, we simply start the timer and start
counting and when we get the zero crossing of voltage waveform, we simply stop the counter
and we get the total time difference between the current waveform and the voltage waveform.
Now, next thing we need to do is to calculate the power factor, which is now quite easy because
we already got the time difference.
So, what I do in order to do that is simply used the below simple code:

int powerfactor(){
k=0;
// To complete number of counts
g=g+1; //Value from the timer
//To convert into seconds
pf=(float)g/1000000;
//To convert into radians
pf=pf*50*360*(3.14/180);
//power facor
pf = cos(pf);
//power factor into percentage
k=abs(ceil(pf*100));
return k;
}

So, that’s how we are calculating the Power factor.


We have done quite a lot of effort to design this simulation and code so its not for free but you
can getit easily just for a price of $20.
Now when you get the code then make your hex file and upload it in Proteus.
Now run your Proteus simulation and you will get something like this:

In the above figure, current waveform leads the voltage waveform by 30 degrees and that’s why
we are getting a power factor of 0.87 which is 87%.
Now let me reduce the difference between current and voltage waveform to 0 and we will get a
power factor of 1 as shown below:
Now, you have seen as we reduced the distance between current and voltage waveform the
power factor has increased and as the angle between current and voltage waveform is 0 so its
100%.
That’s all for today, I hope you have enjoyed today’s post on Power Factor Measurement. You
can buy the complete simulation along with hex file and the complete code by clicking on below
button.
So, buy it and test it and hopefully you will get something big out of it. So that’s all about Power
Factor Measurement using Atmega. I will post it on Arduino as well quite soon and may be on
PIC Microcontroller as well.

DS1307 Arduino based Digital Clock in Proteus


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.

Interfacing of Multiple DS18B20 with Arduino


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 programming 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 microcontroller 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 temperature 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.

DC Motor Direction Control with Arduino in Proteus


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 board, so you should also
download this Arduino Library for Proteus so that you can use Arduino boards in Proteus
software. I have also provided 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, let’s 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 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.

DC Motor Speed Control using Arduino in Proteus


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 it’s 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.

Arduino Bluetooth Communication using HC05


Today, I am going to share a new project in
which we are going to do Arduino Bluetooth
communication. The Bluetooth module I have
used for this project is HC-05, which is a serial
Bluetooth module. We can quite easily perform
the Bluetooth communication with this module
using Arduino board. I have worked on many
projects in which I have to send the data from
sensors to my computer via Bluetooth. So, in
such projects I normally use this Bluetooth module which is connected with the sensors and then
Arduino gets the data from these sensors and then send this data to computer via Bluetooth
module. In this project, I have used Arduino board but you can use PIC Microcontroller or 8051
Microcontroller as well. Because they both have the Serial pins on them.

Note: Before reading any further, I think you must have a look at the below post from where you
can download the Bluetooth Library for Proteus, using this library you can easily simulate HC-05
or HC-06 in Proteus software:
Bluetooth Library for Proteus
I have also done Bluetooth communication with Android mobiles. In these projects I have sent
the data from this Bluetooth module to Android mobiles but in such projects I have also
designed Bluetooth app on which this data is received. Anyways, that’s a topic of another
tutorial. Today, I am gonna connect this Bluetooth module with Arduino board and then will
send some data to my computer using Bluetooth. So, let’s get started with Arduino Bluetooth
communication using HC-05 module.

Arduino Bluetooth Communication using HC-05

First of all, what you need to do is to buy the Arduino board. I have designed this project using
Arduino UNO board but you can buy any of the Arduino Microcontroller board.
Next thing you are gonna need is Bluetooth module which is HC-05. But this tutorial will also
work for HC-06 or HC-07.
Now if you have seen HC-05 then the pins are written on it so connect them with your Arduino
board as shown below:

This pin configuration is also shown in the below figure:

Now that you have connected your Arduino board with the Bluetooth module HC-05 so you are
ready to do the Arduino Bluetooth communication.
Now upload the below code in your Arduino board:
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3);

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

void loop()
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}

Its a simple software serial code in which we are sending data from our Serial terminal to
Bluetooth means whatever you write in your serial terminal will be sent over to Bluetooth and
whatever you receive on your Bluetooth will be shown in serial terminal.
Now, download this Serial monitor software, I have designed this software and its quite simple
one. You can use any other serial monitor like Virtual Terminal in Proteus or Hyper Terminal in
Windows XP.
We are gonna use this software to get the data on our computer via Bluetooth and your
computer must have the Bluetooth in your computer.
So, download this software by clicking the below button and you can read more about it
Microsoft Visual Basic 2010 – Com Port Tutorial.
Download Serial Terminal
Now turn on your Arduino and search for the Bluetooth device in your Bluetooth settings and
paired with it as shown in below figure.
The default pin code for HC-05 is 1234.
Now you can see I have paired the HC-05 device.
Now, open this software and connect with the COM port of your Bluetooth device.
The Bluetooth device generates two COM ports in my case it generated COM11 and COM12 but
COM11 worked.
So, I connected with COM11 and then whatever I entered in my software is shown on the serial
monitor of my Arduino and whatever I entered in the Serial monitor of Arduino is shown in the
serial terminal software.
It’s quite simple and you can do it quite easily.
So, that’s all for today and I hope you are going to make it work in the single attempt. If still
having problems then ask in comments and I will resolve them. So, today we have done Arduino
Bluetooth communication using HC-05 module.

Circuit Designing of LCD with PIC


Today I am posting the next part of Proteus tutorial which is Interfacing of LCD with PIC
Microcontroller. . In the previous post of this tutorial, we have seen the basics of Proteus and
discussed various functions of Proteus ISIS. If you are new to Proteus then I would recommend
that before starting this tutorial, you should first read the first part so that you get the better
idea of Proteus as I wont go in detail in today’s post. Today, we will first design a circuit of LCD
with PIC on Proteus ISIS which includes PIC Microcontroller and then we will see how to burn the
microcontroller in Proteus and at the end we will run our circuit and will display some text on the
LCD. It will be quite a fun so let’s start.
If anyone having any problem at any point, ask in comments and I will try my best to resolve
them. So, let’s get started with Interfacing of LCD with PIC Microcontroller.

Circuit Designing in Proteus


First of all, open the Proteus ISIS software.
In the start, it will look exactly the same as in below image.
Now click on button P as shown in below figure.

When you click this button a new window will pop up as shown in below figure.
This is the place where we search our components, like as I want 7805 so I searched for this
component and the Proteus has given me the related components.
Once you get your desired component, simply double click on it and it will be added in your
database so that you can use them.
The below image shows the components which we are gonna use in this project, so simply
search for all the components and then double click on them and finally you will get all the
components as shown below:

Now place these components in the Proteus workspace and connect them.
Design exactly the same circuit as shown in the below figure for interfacing of LCD with PIC
Microcontroller.

Now our circuit in Proteus is ready to use, the next step is to write a code for the PIC
Microcontroller 18F452 and then burn it into the Proteus and check its working.
Code of LCD with PIC18F452

There are different compilers to write the code for PIC Microcontroller. Here I am using MikroC
Pro for PIC. You can get it easily from the official site of MikroC.
I am not going in the details of coding as its beyond the scope of this tutorial, but still I am
posting the code.
So now create a new project in the MikroC Pro For PIC and copy the below code and paste it in
the project and compile.
When you compile the project, it will create a .hex file in the same folder where you have saved
this project. We will use this hex file shortly.

// LCD module connections


sbit LCD_RS at RD2_bit;
sbit LCD_EN at RD3_bit;
sbit LCD_D4 at RD4_bit;
sbit LCD_D5 at RD5_bit;
sbit LCD_D6 at RD6_bit;
sbit LCD_D7 at RD7_bit;

sbit LCD_RS_Direction at TRISD2_bit;


sbit LCD_EN_Direction at TRISD3_bit;
sbit LCD_D4_Direction at TRISD4_bit;
sbit LCD_D5_Direction at TRISD5_bit;
sbit LCD_D6_Direction at TRISD6_bit;
sbit LCD_D7_Direction at TRISD7_bit;
// End LCD module connections

char txt1[] = “www.TheEngineeri”;


char txt2[] = “ngProjects.com”;

char i; // Loop variable

void Move_Delay() { // Function used for text moving


Delay_ms(500); // You can change the moving speed here
}
void main(){

Lcd_Init(); // Initialize LCD


Lcd_Cmd(_LCD_CURSOR_OFF); // LCD Cursor Off
Lcd_Cmd(_LCD_CLEAR); // Clear display

Lcd_Out(1,1,txt1); // Write text in first row


Lcd_Out(2,1,txt2); // Write text in second row

Delay_ms(2000);

while(1);
}

Burn the Code in PIC Microcontroller in Proteus ISIS

Now we have the hex file, we need to burn this hex file in the microcontroller in Proteus.
So, double click on the Microcontroller in Proteus and it will open up the properties menu of PIC
microcontroller.
Now click, as shown in the below figure, and browse for the hex file and click OK.
We need to add this hex file in Proteus here and also select the oscillation frequency which I
have selected 16MHz.
Note: Make sure that the oscillation frequency remain same both in the MikroC and the Proteus.

After adding the file in the Proteus now click OK and play the simulation, ifeverything goes fine,
you will get the results as shown in below image.

Note: Proteus ISIS simulation file and the .hex file has been emailed to all the subscribed
members. If anyone need it, subscribe to our newsletter via email and it will be emailed to you
as well.

That’s all for today, I have tried my best to explain everything on Interfacing of LCD with PIC
Microcontroller, but still if someone having problem ask in comments and I will try to resolve. In
the next part, we will discuss various components of Proteus which are commonly used like
motors, serial port, hyper terminal etc.

Electronic Door Lock using PIC Microcontroller


Today, I am going to share two types of Electronic
Door Locks design using PIC Microcontroller and
simulated in Proteus ISIS software. We all know
about Electronic Door Locks as we have seen them in
many homes. In electronic door locks, there’s some
password which is only known to some persons.
Now if you enter the wrong password then the door
won’t open up and will ask for password again. And
if you keep on trying the wrong password then it will
start the buzzer or can alert the concerned person
via SMS etc. So, such electronic door locks are quite common in our society.
Today, I am going to share a similar project in which I have simulate Electronic Door lock using
PIC Microcontroller. I have used PIC-18F452 Microcontroller and the compiler I have used for
designing the code in MikroC Pro For PIC and the simulation in designed in Proteus ISIS. The code
and the Proteus simulation in given for download below. You can also design this project using
Arduino or any other microcontroller like 8051 Microcontroller. Let’s start with this project.

Note: You should also have a look at Password Protection using PIC Microcontroller, in which I
have designed exactly the same project but using keypad. The password entered is via keypad
instead of Virtual Terminal as in this project.

Electronic Door Locks using PIC Microcontroller

I have divided this Electronic Door Locks Project in few parts, and I have explained them
separately. You can download the complete project along with Proteus simulation by clicking the
below button. But as I always suggest don’t just download it, also design it on your own so that
you learn more from it:
Download Code & Simulation

Overview
In this electronic door lock project, I have used a solenoid along with relay.
We all know that in order to lock a door we have to use either DC Motor or some solenoid,
which is get connected with the manual lock of the door.
Now, all we need to do is to move that motor according to our needs automatically. Like if I
move the motor in one direction, the door goes locked and if I move it in opposite direction then
it got unlocked.
So, in my simulation, I have used solenoid valve for locking purposes and I have represented it
using Inductors in my simulation.
Moreover, I have used Serial Terminal as an communication medium, means we are gonna input
for password etc in the serial monitor.
I have also used EEPROM in this project to save the current password.
There’s an option in this project to change the password, so if user changed the current
password then the new password will be saved in EEPROM.
So, even if the device restarts, the new changed password will remain active as its saved in
EEPROM.
If the user entered the wrong password then the system will for the password again.
But if the user entered the wrong password for three consecutive times, then the system will
shut down and will start blinking the RGD lights, which I have used as an indication.

Schematics Diagram
Let’s first design the schematics diagram of Electronic Door Locks using PIC Microcontroller.
I have designed the schematic in Proteus ISIS software as its the best simulating software.
The schematic diagram is shown in the below figure:
It’s quite clear from the above figure that I have used a PIC Microcontroller as the brain of the
system.
I have serial terminal, which is used to take inputs from user.
I have used two relays and in order to drive those relays I have used transistors.
Transistors are converting 5V coming from Microcontroller into 12V which are driving relays.
Moreover, I have also used opto couplers which are just used for protection.
Finally, I have used three LEDs which are acting as RGB and will just indicate the wrong
password.
These two relays are actually actuating the solenoid which will lock or unlock the door.
There’s no active solenoid comonent available in Proteus that’s why I have used a simple
inductor just for indication.
Now, let’s have a look at the programming code for this project.

Programming Code
I have designed the programming code for PIC Microcontroller in MkiroC Pro for PIC compiler.
You should have a look at these Top 3 PIC C Compilers and can select one you like.
The PIC Microocntroller used in this Electronic door locks project is PIC18F4520. You can also use
other PIC Microcontrollers like PIC16F877a etc.
You can use any other PIC Microcontroller, if you want. You just need to change it in simulation
and in code settings.
Now here’s the complete programming code for Electronic Door Locks using PIC Microcontroller:
char Indata;
char P1 = '1';
char P2 = '2';
char P3 = '3';
int PassCheck = 0;
int WrongCheck = 0;
int CPassCheck = 0;

void Initialization()
{
UART1_Init(9600);
TRISD = 0;
PortD = 0;
P1 = EEPROM_Read(0x01);
P2 = EEPROM_Read(0x02);
P3 = EEPROM_Read(0x03);
}

void PassChange()
{
while(1)
{
if (UART1_Data_Ready())
{
Indata = UART1_Read();

if(CPassCheck == 2){CPassCheck = 3; EEPROM_Write(0x03, Indata); P3 =


EEPROM_Read(0x03);}
if(CPassCheck == 1){CPassCheck = 2; EEPROM_Write(0x02, Indata); P2 =
EEPROM_Read(0x02);}
if(CPassCheck == 0){CPassCheck = 1; EEPROM_Write(0x01, Indata); P1 =
EEPROM_Read(0x01);}
UART1_Write_Text("*");
if(CPassCheck == 3){break;}
}
}

UART1_Write(10);
UART1_Write(13);
UART1_Write(10);
UART1_Write(13);
}

void CorrectPass()
{
UART1_Write(10);
UART1_Write(13);
UART1_Write(10);
UART1_Write(13);
UART1_Write_Text("Select one of the below Options: ");
UART1_Write(10);
UART1_Write(13);
UART1_Write(10);
UART1_Write(13);
UART1_Write_Text("1) Press Y to Lock.");
UART1_Write(10);
UART1_Write(13);
UART1_Write_Text("2) Press N to Unlock.");
UART1_Write(10);
UART1_Write(13);
UART1_Write_Text("3) Press C to Change Password.");
UART1_Write(10);
UART1_Write(13);
UART1_Write(10);
UART1_Write(13);
UART1_Write_Text("Waiting for Response: ");

while(1)
{
if (UART1_Data_Ready())
{
Indata = UART1_Read();

if((Indata == 'Y') || (Indata == 'y')){UART1_Write_Text("Y"); PortD.F0 = 1; PortD.F1 =


0; UART1_Write(10); UART1_Write(13); UART1_Write(10); UART1_Write(13); break;}
if((Indata == 'N') || (Indata == 'n')){UART1_Write_Text("N"); PortD.F0 = 0; PortD.F1
= 1; UART1_Write(10); UART1_Write(13); UART1_Write(10); UART1_Write(13); break;}
if((Indata == 'C') || (Indata == 'c')){UART1_Write_Text("C"); UART1_Write(10);
UART1_Write(13); UART1_Write(10); UART1_Write(13); UART1_Write_Text("Enter New
Password: "); PassChange();break;}

}
}
}

void WrongPass()
{
int x = 0;
PortD.F5 = 1;
while(1)
{

PortD.F2 = 1;
Delay_ms(100);
PortD.F2 = 0;
PortD.F3 = 1;
Delay_ms(100);
PortD.F3 = 0;
PortD.F4 = 1;
Delay_ms(100);
PortD.F4 = 0;
x = x + 1;
if(x > 30){break;}
}
PortD.F5 = 0;
}

void main() {
Initialization();

do
{
UART1_Write_Text("Enter Password: ");
while(1)
{
if (UART1_Data_Ready())
{
Indata = UART1_Read();

if((Indata == P1) && (PassCheck == 0)){PassCheck = 1;}


if((Indata == P2) && (PassCheck == 1)){PassCheck = 2;}
if((Indata == P3) && (PassCheck == 2)){PassCheck = 3;}

if((Indata == 13) && (PassCheck == 3)){PassCheck = 0; WrongCheck = 0;


UART1_Write(10); UART1_Write(13); UART1_Write_Text("Correct
Password.");CorrectPass();break;}
if((Indata == 13) && (PassCheck != 3)){PassCheck = 0; UART1_Write(10);
UART1_Write(13); UART1_Write_Text("Wrong Password."); WrongCheck = WrongCheck + 1;
if(WrongCheck == 3){WrongPass();}UART1_Write(10); UART1_Write(13); UART1_Write(10);
UART1_Write(13);break;}
UART1_Write_Text("*");
}
}

} while(1);
}

The code is quite self-explanatory.


I have placed checks on Enter button like when user press Enter button then it will check either
password is correct or wrong and then will decide and either on or off the respective relays.
Moreover, the third option is for change password and you can see rite after the change
password, I have used EEPROM commands to save the password for later use.
Let’s now start the simulation and test our project.
Note:If you are not much familiar with relays, then you should read these tutorials on relays:

 Introduction to Relay.
 How to Control Relay in Proteus ISIS.
 Relay Control using 555 Timer in Proteus ISIS.
 Relay Interfacing with Microcontroller using ULN2003A .
 2 Relay Module Interfacing with Arduino.

Results
We have seen all the details about the project and I am quite confident that now you can quite
easily design this project on your own.
So, now let’s start the simulation and have a look at the results.
When you start your simulation then you will have such a screen:

Now you can see, its asking for password in the Virtual Terminal.
The default password set is “123”. So, I am gonna give it 123.
Now, when I gave it correct password, it asked for the correct option.
I have added total 3 options in it, which are shown in above figure.
So, if user press Y then it will lock the door and if he presses N then it will unlock the door and
last option is to change the password which is set for C.
So, that’s how this project is working.
Similarly, if I gave it wrong password the nit will ask for try again for 3 times and then will set off
the RGB lights to warn.
Complete demonstration and working of this project is given in the below video:
That’s all for electronic door locks project using PIC Microcontroller.

LED Blinking Project Using 8051 Microcontroller


In today’s tutorial, we will see LED Blinking Project Using
8051 Microcontroller. I haven’t yet posted any project or
tutorial on 8051 Microcontroller. I have posted quite a lot
of tutorials on Arduino and PIC Microcontroller, so today I
thought of posting tutorials on 8051 Microcontroller. Its
my first tutorial on it and I am gonna post quite a lot of
tutorials on 8051 Microcontroller in coming week.
So, as its our first tutorial on 8051 Microcontroller that’s
why its quite a simple one and as we did in Arduino we will
first of all have a look at LED Blinking Project Using 8051
Microcontroller. In this project, we will design a basic circuit for 8051 Microcontroller which
involves crystal oscillator etc. The basic circuit of 8051 Microcontroller is quite the same as we
did for PIC Microcontroller. After that, we will attach a small LED on any of its I/O pins and then
will make it blink. I have also given the Proteus Simulation along with Programming code
designed in keil uvision 4 for download at the end of this post. So, let’s get started with it.
LED Blinking Project Using 8051 Microcontroller in Proteus ISIS

I am gonna first design the simulation of LED Blinking Project using 8051 Microcontroller in
Proteus ISIS, as you all know Proteus is my favorite simulation software.
After designing the simulation, we will design the programming code for 8051 Microcontroller.
In order to design the code we are gonna use Keil micro vision compiler and the version I have
rite now is 4. So its keil micro vision 4 compiler for 8051 Microcontrollers.
So let’s first design the Proteus Simulation for LED Blinking PRoject Using 8051 Microcontroller.

Proteus Simulation for LED Blinking Project


So, get these components from Proteus components library and place it in your workspace,
these components are shown in below figure:

So, now I hope you have got all these components, now design a circuit in your Proteus software
as shown in below figure:
Now you can see in the above image, I have used crystal oscillator of 16MHz which is used to
provide frequency to 8051 Microcontroller.
After that we have placed a 10k resistance in path of our Reset pin.
LED is connected to first pin of Port 1 which is P1.0.
So, now let’s design the programming code for 8051 Microcontroller as we are done with the
Proteus Simulation.

Keil Programming Code for LED Blinking Project


Now as I have mentioned earlier, the compiler I have used for designing the programming code
for LED Blinking Project is Keil micro vision 4.
So I hope you have this installed on your computer and if not then must install it as otherwise
you wont be able to compile this code, but I have also placed the hex file so that you can run the
simulation easily.
You can download them easily by clicking the Download buttons present at the end of this post.
So now create a new project in your keil compiler and paste the below code in your c file.

#include<reg51.h>

sbit LED = P1^0;


void cct_init(void);
void delay(int a);

int main(void)
{
cct_init();

while(1)
{
LED = 0;
delay(30000);
LED = 1;
delay(30000);
}
}

void cct_init(void)
{
P1 = 0x00;
}

void delay(int a)
{
int i;
for(i=0;i<a;i++);
}

Now let me explain this code a bit, first of all, I declare the pin1.0 as LED so that its easy to use it
in our code in future.
After that I declared two functions. One of them is the delay function which is just adding the
delay, while the second function is for initialization of Port 1 as output port.
While in the Main function, we have used the LED blinking code in which LED is ON and then OFF
continuously and so that make it blink.
Now after adding the code in your Keil software, compile it and get the hex file.
Upload this hex file into your 8051 Microcontroller which I have used is AT89C52 and hit the RUN
button.
If everything’s goes fine then you will get results as shown in below figure:

Now click the below button to get the simulation and the programming code and let me know
did it work for you. 🙂
Download Proteus Simulation & Keil Code
That’s all for today, will come soon with new tutorial on 8051 Microcontroller so stay tuned and
have fun.

Serial Communication with 8051 Microcontroller


In today’s post, we will have a look at Serial
Communication with 8051 Microcontroller in Proteus
ISIS. In the previous post, we have seen a detailed post
on LED Blinking Project using 8051 Microcontroller in
Proteus ISIS, which was quite a simple tutorial. And I
hope if you are new to 8051 Microcontroller then from that post you must have got some idea
about C Programming of 8051 Microcontroller.
Now, today we are gonna go a little further and will have a look at Serial Communication with
8051 Microcontroller and we will also design the simulation of this project in Proteus ISIS
software. 8051 Microcontroller also supports Serial port similar to Arduino and PIC
Microcontroller. And the communication protocol is exactly the same as its a Serial Port. But
obviously the syntax is bit different as we are not working in Arduino software or MPLAB. So let’s
get started with it.

Serial Communication with 8051 Microcontroller in Proteus

Let’s first have a little recall of Serial communication. In serial communication we have two pins
which are named as TX and RX.
TX pin is used for transmitting data while the RX pin is used for receiving data.
So, our microcontroller has these two pins as it supports Serial Communication and these pins
are located at Pin no 10 and 11 in AT89C52 Microcontroller, which I am gonna use today.
First of all, we will design a Simulation of this project in which there will be 8 LEDs attached to
Port 1 and by sending characters through Serial port, we will either turn these LEDs ON or OFF.
After designing the Simulation, we will then design the programming code for 8051
Microcontroller and will test our result.
So, let’s get started with Proteus Simulation of Serial Communication with 8051 Microcontroller.

Proteus Simulation
Open your Proteus software and get these components from your Proteus Component Library:

Now, design a circuit for Serial Communication with 8051 Microcontroller in Proteus software as
shown in below figure:
Now in the above figure, I have used crystal Oscillator of 16MHz as I did in the previous post LED
Blinking Project using 8051 Microcontroller and again the reset is pull Down.
Next I have attached Virtual Terminal with TX and RX of 8051 Microcontroller, if you don’t know
about Virtual Terminal much then I suggest to read How to use Virtual Terminal in Proteus ISIS.
Finally, I have attached the 8 LEDs on Port 1 so that we could check whether we are getting
correct data or not.
Now let’s design the programming code.

Programming Code
Now open your Keil micro vision 4 software and paste the below code into it.

#include <reg52.h>

#define Baud_rate 0xFD // BAUD RATE 9600

void SerialInitialize(void);
void SendByteSerially(unsigned char);
void cct_init(void);

sbit Appliance1 = P1^0;


sbit Appliance2 = P1^1;
sbit Appliance3 = P1^2;
sbit Appliance4 = P1^3;
sbit Appliance5 = P1^4;
sbit Appliance6 = P1^5;
sbit Appliance7 = P1^6;
sbit Appliance8 = P1^7;

void main()
{
cct_init();
SerialInitialize();

EA = 1;
ES = 1;

while(1) {;}
}

void cct_init(void) //initialize cct


{
P0 = 0x00; //not used
P1 = 0x00; //Used for Appliances
P2 = 0x00; //not used
P3 = 0x03; //used for serial

void SerialInitialize(void) // INITIALIZE SERIAL PORT


{
TMOD = 0x20; // Timer 1 IN MODE 2 -AUTO RELOAD TO GENERATE BAUD RATE
SCON = 0x50; // SERIAL MODE 1, 8-DATA BIT 1-START BIT, 1-STOP BIT, REN
ENABLED
TH1 = Baud_rate; // LOAD BAUDRATE TO TIMER REGISTER
TR1 = 1; // START TIMER
}

void SendByteSerially(unsigned char serialdata)


{
SBUF = serialdata; // LOAD DATA TO SERIAL BUFFER REGISTER
while(TI == 0); // WAIT UNTIL TRANSMISSION TO COMPLETE
TI = 0; // CLEAR TRANSMISSION INTERRUPT FLAG
}

void serial_ISR (void) interrupt 4


{
//receive character
char chr;
if(RI==1)
{
chr = SBUF;
RI = 0;
}

P0 = ~P0; //Show the data has been updated

switch(chr)
{
case '1': Appliance1 = 1; SendByteSerially('k'); break;
case '2': Appliance2 = 1; SendByteSerially('k'); break;
case '3': Appliance3 = 1; SendByteSerially('k'); break;
case '4': Appliance4 = 1; SendByteSerially('k'); break;
case '5': Appliance5 = 1; SendByteSerially('k'); break;
case '6': Appliance6 = 1; SendByteSerially('k'); break;
case '7': Appliance7 = 1; SendByteSerially('k'); break;
case '8': Appliance8 = 1; SendByteSerially('k'); break;

case 'a': Appliance1 = 0; SendByteSerially('k'); break;


case 'b': Appliance2 = 0; SendByteSerially('k'); break;
case 'c': Appliance3 = 0; SendByteSerially('k'); break;
case 'd': Appliance4 = 0; SendByteSerially('k'); break;
case 'e': Appliance5 = 0; SendByteSerially('k'); break;
case 'f': Appliance6 = 0; SendByteSerially('k'); break;
case 'g': Appliance7 = 0; SendByteSerially('k'); break;
case 'h': Appliance8 = 0; SendByteSerially('k'); break;

default: ; break; //do nothing


}

RI = 0;
}

You can see in the above code that baud rate we have used is 9600and we have used a switch
case method for turning ON or OFF Leds.
So, now what it will do is when you send 1 on Serial Monitor, it will turn ON the first LED and
when you send “a” on Serial Terminal then it will turn OFF the first LED. The same will go on for 8
LEDs.
Character 1,2,3,4,5,6,7,8 will turn ON the LEDs from 1 to 8 respectively.
While the character a,b,c,d,e,f,g,h will turn OFF the LEDs from 1 to 8 respectively.
For each command it will reply us back a single character which is “k”. So in this way we are
doing the two way communication i.e. sending as well as receiving the serial data.
So, now after adding the code, get your hex file and then upload it to your Proteus Simulation
and click the RUN button on your Proteus software.
When you start your Proteus Simulation, all the LEDs will be OFF and the virtual terminal will be
open as shown in below figure:
So, now click in the Virtual Terminal and press 1 and the first LED will get ON and you will get k in
response as shown in below figure:

You can see in the above figure, I have pressed 1 and the first LED goes ON as well as we get a
response “k” in the virtual Terminal.
So, that’s how we can turn ON or OFF LEDs so in the below figure, I have turned ON all the 8
LEDs.
Now you can see in the above figure,all leds are on and the virtual terminal is showing k for 8
times as I have given 8 instructions.
You can download the Proteus Simulation along with hex file and the programming code by
clicking the below button.
Download Proteus Simulation and Code
So, that’s how we can do Serial communication with 8051 Microcontroller. I don’t think its much
difficult but still if you have problems then ask in comments and I will resolve them

Interfacing of LCD with 8051 Microcontroller in Proteus ISIS


Today’s post is about Interfacing of LCD with
8051 Microcontroller. In my previous post, we
have seen How to do Serial Communication with
8051 Microcontroller, which was quite a basic
tutorial and doesn’t need much hardware
attached to it. Now today we are going to have a
look at Interfacing of LCD with 8051
Microcontroller. LCD is always the basic step
towards learning embedded as it serves as a great debugging tool for engineering projects.
LCD is also used almost in every Engineering Project for displaying different values. For example,
if you have used the ATM machine, which you must have, then you have seen an LCD there
displaying the options to select. Obviously that’s quite a big LCD but still LCD. Similarly, all mobile
phones are also equipped with LCDs. The LCD we are going to use in this project is quite small
and basic. It is normally known as the 16×2 LCD as it has rows and 2 columns for writing
purposes. So, we are going to interface that LCD with 8051 Microcontroller. The proteus
Simulation along with hex file and the programming code in keil uvision 3 is given at the end of
this post for download. If you are working with Arduino, then you should have a look at
Interfacing of LCD with Arduino. The next level from LCD is Graphical LCD also known as GLCD, so
if you want to know more about that then you should read Interfacing of Arduino with GLCD. So,
let’s get started with it.

Interfacing of LCD with 8051 Microcontroller in Proteus ISIS

First of all, we are gonna need to design the Proteus Simulation as we always did.
After designing the simulation, we are gonna write our embedded code for 8051
Microcontroller.
I will be designing the code in Keil uvision3 compiler and the 8051 Microcontroller I am gonna
use is AT89C51.
So, let’s first get started with Proteus Simulation for interfacing of LCD with 8051
Microcontroller.

Proteus Simulation
First of all, get the below components from the Proteus components Library and place them in
your workspace.

Now design a circuit in Proteus using these above components as shown in below figure:
If you have read the previous tutorial, you have noticed a small change, which is the RESET
button.
Its a good thing to have a RESET button in your project. When you press this button, your 8051
Microcontroller will get reset and will start again.
Moreover, we have added a 20×4 LCD. The data pins of this LCD are attached with Port 2, while
the RS and enable pins are connected to 0 and 1 pins of Port 1.
So, now let’s design the programming code for interfacing of LCD with 8051 Microcontroller.

Programming Code
For programming code, I have used Keil uvision 3 software. I am going to first explain the code in
bits so let’s get started with it.
Before starting the LCD programming, let me clear few basic concepts.
In LCD, there are two types of data, we need to sent.
The first type is the command like we need to tell the LCD either to start from first column or
second column so we need to place the LCD cursor at some point from where we need to start
writing. So, this type of data is called commands to LCD.
The second type of data is the actual data we need to print on the LCD.
So first of all we send commands to the LCD like the cursor should go to second line and then we
send the actual data which will start printing at that point.
The first function, I have used is named as lcdinit() , this function will initialize the LCD and will
give the initializing commands to it.

void lcdinit(void)
{
delay(15000);
writecmd(0x30);
delay(4500);
writecmd(0x30);
delay(300);
writecmd(0x30);
delay(650);

writecmd(0x38); //function set


writecmd(0x0c); //display on,cursor off,blink off
writecmd(0x01); //clear display
writecmd(0x06); //entry mode, set increment
}
Now in this function I have used another function which is writcmd, which is as follows:
void writecmd(int z)
{
RS = 0; // => RS = 0
P2 = z; //Data transfer
E = 1; // => E = 1
delay(150);
E = 0; // => E = 0
delay(150);
}

In order to send the commands to LCD with 8051 Microcontroller, we have to make the RS pin
LOW and then we send the data and make the Enable pin HIGH to LOW which I have done in the
above writecmd() function.
Next function, we have used is writedata() function, which is as follows:

void writedata(char t)
{
RS = 1; // => RS = 1
P2 = t; //Data transfer
E = 1; // => E = 1
delay(150);
E = 0; // => E = 0
delay(150);
}

So, if you check above two functions then its quite clear that when we send command to the LCD
then we have to make RS pin 0 but when we need to send data to be printed on LCD then we
need to make RS pin 1. That’s the only thing worth understanding in interfacing of LCD with 8051
Microcontroller.
Now below is the complete code for interfacing of LCD with 8051 Microcontroller and I think
now you can get it quite easily.

#include<reg51.h>

//Function declarations
void cct_init(void);
void delay(int);
void lcdinit(void);
void writecmd(int);
void writedata(char);
void ReturnHome(void);

//*******************
//Pin description
/*
P2 is data bus
P1.0 is RS
P1.1 is E
*/
//********************

// Defines Pins
sbit RS = P1^0;
sbit E = P1^1;

// ***********************************************************
// Main program
//
void main(void)
{
cct_init(); //Make all ports zero

lcdinit(); //Initilize LCD

writecmd(0x81);
writedata('w'); //write
writedata('w'); //write
writedata('w'); //write
writedata('.'); //write
writedata('T'); //write
writedata('h'); //write
writedata('e'); //write
writedata('E'); //write
writedata('n'); //write
writedata('g'); //write
writedata('i'); //write
writedata('n'); //write
writedata('e'); //write
writedata('e'); //write
writedata('r'); //write
writedata('i'); //write
writedata('n'); //write
writedata('g'); //write

writecmd(0xc4);

writedata('P'); //write
writedata('r'); //write
writedata('o'); //write
writedata('j'); //write
writedata('e'); //write
writedata('c'); //write
writedata('t'); //write
writedata('s'); //write
writedata('.'); //write
writedata('c'); //write
writedata('o'); //write
writedata('m'); //write

ReturnHome(); //Return to 0 position

while(1)
{
}

void cct_init(void)
{
P0 = 0x00; //not used
P1 = 0x00; //not used
P2 = 0x00; //used as data port
P3 = 0x00; //used for generating E and RS
}

void delay(int a)
{
int i;
for(i=0;i<a;i++); //null statement
}
void writedata(char t)
{
RS = 1; // => RS = 1
P2 = t; //Data transfer
E = 1; // => E = 1
delay(150);
E = 0; // => E = 0
delay(150);
}

void writecmd(int z)
{
RS = 0; // => RS = 0
P2 = z; //Data transfer
E = 1; // => E = 1
delay(150);
E = 0; // => E = 0
delay(150);
}

void lcdinit(void)
{
delay(15000);
writecmd(0x30);
delay(4500);
writecmd(0x30);
delay(300);
writecmd(0x30);
delay(650);
writecmd(0x38); //function set
writecmd(0x0c); //display on,cursor off,blink off
writecmd(0x01); //clear display
writecmd(0x06); //entry mode, set increment
}

void ReturnHome(void) //Return to 0 location


{
writecmd(0x02);
delay(1500);
}

So, place this code in your keil software and get the hex file.
Upload this hex file in your Proteus software and Run it.
If everything goes fine then you will get something as shown in below figure:

Now, you can see we have printed our website address on the LCD with 8051 Microcontroller.
You can print anything you want to print on this LCD instead of our address.
You can download the Proteus Simulation along with hex file and the programming code in keil
uvision 3 by clicking on below button.
Download Proteus Simulation & Code
That’s all for today, in the next post I am going to share how to display custom characters on LCD
with 8051 Microcontroller, because till now you can just display the simple characters like
alphabets and numbers on it but can’t display the custom characters like arrowhead etc. You
should have a look at LCD Interfacing with Microcontrollers, where I have combined all tutorials
related to LCD.
Interfacing of Keypad with 8051 Microcontroller in Proteus
in today’s post we are gonna have a look at Interfacing of
Keypad with 8051 Microcontroller in Proteus ISIS. In the
previous project, we have seen the Interfacing of LCD with
8051 Microcontroller and I have told there that LCD is a
great debugging tool as we can print our data on it and can
display different values and that’s what is gonna done in
today’s post. Today, I will get the values from keypad and
then question is how to know that we are getting the
correct values. So in order to do so, we will display these
values over LCD. So, that’s how we are gonna use LCD as a debugging tool. As the debugging is
concerned, there’s another great tool for debugging which is called Serial port, we can also
display these values over to Serial port. So, you should also read Serial communication with 8051
Microcontroller in Proteus ISIS, and try to display these keypad characters over to Serial port as a
homework.
Anyways, let’s come back to keypad, if you wanna read the keypad details then you should read
Interfacing of keypad with Arduino in Proteus ISIS as I have mentioned all the basic details about
keypad in that tutorial and I am not gonna repeat it. But as a simple recall, keypad works on
matrix system like it has 4 columns and 4 rows so we will have total 8 pins through which we are
gonna control these 16 buttons. So, let’s get started with it.

Interfacing of Keypad with 8051 Microcontroller in Proteus ISIS

Keypad is quite an easy and basic tool in embedded projects which is used in almost every kind
of engineering project.
Today, we will first design the Proteus Simulation and after that we will design the programming
code for 8051 Microcontroller.
The 8051 Microcontroller I have used is AT89C51 while the compiler I used for this
microcontroller is keil uvision 3 and the simulation is designed in Proteus ISIS.
So, let’s get started with Proteus simulation:

Proteus Simulation
Get the below components from Proteus components library and place it in your workspace.
Now design a circuit in Proteus software as shown in below figure:

Now as you can see in the above figure, I have used 4×4 keypad which has 4 rows and 4 columns
and that’s why there are total 16 buttons on it.
So, I have connected 8 pins of keypad with Port 1 of 8051 microcontroller.
LCD data pins are connected with Port 2 while the RS and E pins are connected to Port 3.
So, now let’s move to the programming code for Interfacing of keypad with 8051
Microcontroller.
Programming Code
For programming purposes I have used Keil uvision 3 Compiler.
Most of the code is quite similar to that for Interfacing of LCD with 8051 Microcontroller, so if
you wanna read about that then read this post.
The new code added in this post is about keypad which is as follows:

char READ_SWITCHES(void)
{
RowA = 0; RowB = 1; RowC = 1; RowD = 1; //Test Row A

if (C1 == 0) { delay(10000); while (C1==0); return '7'; }


if (C2 == 0) { delay(10000); while (C2==0); return '8'; }
if (C3 == 0) { delay(10000); while (C3==0); return '9'; }
if (C4 == 0) { delay(10000); while (C4==0); return '/'; }

RowA = 1; RowB = 0; RowC = 1; RowD = 1; //Test Row B

if (C1 == 0) { delay(10000); while (C1==0); return '4'; }


if (C2 == 0) { delay(10000); while (C2==0); return '5'; }
if (C3 == 0) { delay(10000); while (C3==0); return '6'; }
if (C4 == 0) { delay(10000); while (C4==0); return 'x'; }

RowA = 1; RowB = 1; RowC = 0; RowD = 1; //Test Row C

if (C1 == 0) { delay(10000); while (C1==0); return '1'; }


if (C2 == 0) { delay(10000); while (C2==0); return '2'; }
if (C3 == 0) { delay(10000); while (C3==0); return '3'; }
if (C4 == 0) { delay(10000); while (C4==0); return '-'; }

RowA = 1; RowB = 1; RowC = 1; RowD = 0; //Test Row D

if (C1 == 0) { delay(10000); while (C1==0); return 'C'; }


if (C2 == 0) { delay(10000); while (C2==0); return '0'; }
if (C3 == 0) { delay(10000); while (C3==0); return '='; }
if (C4 == 0) { delay(10000); while (C4==0); return '+'; }

return 'n'; // Means no key has been pressed


}

In the above function, which is READ_SWITCHES(), what we are doing is we are first checking the
rows and after that for each row we are checking the columns.
For example, if you have pressed the button “1” then it will detect that first ROW and the first
COLUMN has gone LOW and it will print out 1 as shown in above code.
That’s how its reading all the 16 buttons, first detecting the Rows and then for each row
detecting all the columns and then printing out the respective character.
Quite simple, isn’t it?
So now, here’s the complete code for the Interfacing of Keypad with 8051 Microcontroller:

#include<reg51.h>

//Function declarations
void cct_init(void);
void delay(int);
void lcdinit(void);
void writecmd(int);
void writedata(char);
void Return(void);
char READ_SWITCHES(void);
char get_key(void);

//*******************
//Pin description
/*
P2 is data bus
P3.7 is RS
P3.6 is E
P1.0 to P1.3 are keypad row outputs
P1.4 to P1.7 are keypad column inputs
*/
//********************
// Define Pins
//********************
sbit RowA = P1^0; //RowA
sbit RowB = P1^1; //RowB
sbit RowC = P1^2; //RowC
sbit RowD = P1^3; //RowD

sbit C1 = P1^4; //Column1


sbit C2 = P1^5; //Column2
sbit C3 = P1^6; //Column3
sbit C4 = P1^7; //Column4

sbit E = P3^6; //E pin for LCD


sbit RS = P3^7; //RS pin for LCD

// ***********************************************************
// Main program
//
int main(void)
{
char key; // key char for keeping record of pressed key

cct_init(); // Make input and output pins as required


lcdinit(); // Initilize LCD

writecmd(0x95);
writedata('w'); //write
writedata('w'); //write
writedata('w'); //write
writedata('.'); //write
writedata('T'); //write
writedata('h'); //write
writedata('e'); //write
writedata('E'); //write
writedata('n'); //write
writedata('g'); //write
writedata('i'); //write
writedata('n'); //write
writedata('e'); //write
writedata('e'); //write
writedata('r'); //write
writedata('i'); //write
writedata('n'); //write
writedata('g'); //write

writecmd(0xd8);

writedata('P'); //write
writedata('r'); //write
writedata('o'); //write
writedata('j'); //write
writedata('e'); //write
writedata('c'); //write
writedata('t'); //write
writedata('s'); //write
writedata('.'); //write
writedata('c'); //write
writedata('o'); //write
writedata('m'); //write
writecmd(0x80);
while(1)
{
key = get_key(); // Get pressed key
//writecmd(0x01); // Clear screen
writedata(key); // Echo the key pressed to LCD
}
}

void cct_init(void)
{
P0 = 0x00; //not used
P1 = 0xf0; //used for generating outputs and taking inputs from Keypad
P2 = 0x00; //used as data port for LCD
P3 = 0x00; //used for RS and E
}

void delay(int a)
{
int i;
for(i=0;i<a;i++); //null statement
}

void writedata(char t)
{
RS = 1; // This is data
P2 = t; //Data transfer
E = 1; // => E = 1
delay(150);
E = 0; // => E = 0
delay(150);
}

void writecmd(int z)
{
RS = 0; // This is command
P2 = z; //Data transfer
E = 1; // => E = 1
delay(150);
E = 0; // => E = 0
delay(150);
}

void lcdinit(void)
{
///////////// Reset process from datasheet /////////
delay(15000);
writecmd(0x30);
delay(4500);
writecmd(0x30);
delay(300);
writecmd(0x30);
delay(650);
/////////////////////////////////////////////////////
writecmd(0x38); //function set
writecmd(0x0c); //display on,cursor off,blink off
writecmd(0x01); //clear display
writecmd(0x06); //entry mode, set increment
}

void Return(void) //Return to 0 location on LCD


{
writecmd(0x02);
delay(1500);
}
char READ_SWITCHES(void)
{
RowA = 0; RowB = 1; RowC = 1; RowD = 1; //Test Row A

if (C1 == 0) { delay(10000); while (C1==0); return '7'; }


if (C2 == 0) { delay(10000); while (C2==0); return '8'; }
if (C3 == 0) { delay(10000); while (C3==0); return '9'; }
if (C4 == 0) { delay(10000); while (C4==0); return '/'; }

RowA = 1; RowB = 0; RowC = 1; RowD = 1; //Test Row B

if (C1 == 0) { delay(10000); while (C1==0); return '4'; }


if (C2 == 0) { delay(10000); while (C2==0); return '5'; }
if (C3 == 0) { delay(10000); while (C3==0); return '6'; }
if (C4 == 0) { delay(10000); while (C4==0); return 'x'; }

RowA = 1; RowB = 1; RowC = 0; RowD = 1; //Test Row C

if (C1 == 0) { delay(10000); while (C1==0); return '1'; }


if (C2 == 0) { delay(10000); while (C2==0); return '2'; }
if (C3 == 0) { delay(10000); while (C3==0); return '3'; }
if (C4 == 0) { delay(10000); while (C4==0); return '-'; }

RowA = 1; RowB = 1; RowC = 1; RowD = 0; //Test Row D

if (C1 == 0) { delay(10000); while (C1==0); return 'C'; }


if (C2 == 0) { delay(10000); while (C2==0); return '0'; }
if (C3 == 0) { delay(10000); while (C3==0); return '='; }
if (C4 == 0) { delay(10000); while (C4==0); return '+'; }

return 'n'; // Means no key has been pressed


}
char get_key(void) //get key from user
{
char key = 'n'; //assume no key pressed

while(key=='n') //wait untill a key is pressed


key = READ_SWITCHES(); //scan the keys again and again

return key; //when key pressed then return its value


}

So, now upload this code to your keil and get the hex file.
Upload this hex file to your Proteus software and run the simulation.
Now if everything goes fine then you will get first screen as shown in below figure:

Obviously our website link at the bottom, now when you press the buttons on Keypad then it will
start displaying on the first row of LCD.
Now I have pressed all the 12 buttons of keypad and they are shown on LCD as shown in below
figure:
Now you can see the keypad buttons are displayed on the LCD.
Now you can download the Proteus Simulation along with hex file and code by clicking the below
button.
Download Proteus Simulation with Code
That’s all about Interfacing of Keypad with 8051 Microcontroller. Its not that difficult but if you
have problems then ask in comments and I will try to resolve them.

Design a Simple Calculator with 8051 Microcontroller


today’s post is about designing a simple calculator
with 8051 Microcontroller. In our previous post, we
have seen How to Interface keypad with 8051
Microcontroller in Proteus ISIS. Moreover, we have
also worked on Interfacing of LCD with 8051
Microcontroller in Proteus ISIS. If you haven’t read
these two posts then my suggestion is to read them
first before going into the details of this post, as we
are going to use both keypad and LCD in order to
design the simple calculator with 8051
Microcontroller.
Actually, we have already understood the working of both keypad and LCD so I thought to share
this small project as it will give you the practical application of both keypad and LCD. And if you
are new to 8051 Microcontroller then it’s always better to first design a small project and then
move to pro one. The Simulation file along with hex file and complete code is given at the end
for download. But my suggestion is to design it by yourself as it will help you in learning. You will
do mistakes but obviously it will help you in learning so make mistakes and learn with it. So, let’s
get started with it.

Design a Simple Calculator with 8051 Microcontroller

The calculator we are going to design in this post is quite basic calculator, it will only perform 4
tasks, which are as follows:
When you press the (+) button then it will add the two digits. For example, you want to add 2
and 3 then you need to press 2 + 2 = these four buttons in sequence and when you press the =
button it will automatically will give you the sum.
When you press (-) button it will subtract the two digits like 3 – 2 = and it will give you the result.
When you press (x) button it will multiply the two digits.
When you press the (/) button it will simply divide the two digits.
Whenever you press the (=) button, it will give you the output depending on the function you
used before and if you press (=) in the start then it will give “Wrong Input”.
Finally, there’s (ON/C) button on the Calculator, when you press this it will simply reset the code
and will clear the LCD.
So, that’s how this calculator is gonna work. Moreover, it will always reset when you try to
calculate new value.
As its a simple calculator, so its only limited to 1 digit, means it will only apply the operation on
single digit input like 2+3 but it won’t work on more than 1 digit like 12 + 13.
I will soon design a more complicated calculator but for this one its only limited to single digit.
So, now let’s design this calculator, so first we are gonna have a look at the Proteus simulation of
Simple calculator with 8051 Microcontroller.
After that, we will do the coding part for calculator with 8051 Microcontroller.
So, now let’s get started with Proteus Simulation.

Proteus Simulation
The Proteus Simulation of this Calculator with 8051 Microcontroller is same as we used for
Interfacing of Keypad with 8051 Microcontroller and is shown in below figure:
So, you can see we have used the same LCD which is 20×4 and have used the same keypad as did
in previous tutorial.
You can see this keypad has all the required operations for this project which are (+), (-), (x) and
(/).
So, now let’s have a look at the programming code for calculator with 8051 Microcontroller.

Programming Code
We have already seen the programming code for keypad and LCD and I am assuming that you
have also read those posts so I am not going into the details of those posts.
So, we know that how to print data on LCD and we are also aware of how to get key press from
keypad and then display it on LCD.
So, now let’s move on to adding these functions.

while(1)
{
//get numb1
key = get_key();
writecmd(0x01); //clear display
writedata(key); //Echo the key pressed to LCD
num1 = get_num(key); //Get int number from char value, it checks for wrong input as
well
if(num1!=Error) //if correct input then proceed, num1==Error means wrong input
{
//get function
key = get_key();
writedata(key); //Echo the key pressed to LCD
func = get_func(key); //it checks for wrong func

if(func!='e') //if correct input then proceed, func=='e' means wrong


input
{
//get numb2
key = get_key();
writedata(key); //Echo the key pressed to LCD
num2 = get_num(key); //Get int number from char value, it checks
for wrong input as well

if(num2!=Error) //if correct input then proceed, num2==Error


means wrong input
{
//get equal sign
key = get_key();
writedata(key); //Echo the key pressed to LCD

if(key == '=') //if = is pressed then proceed


{
switch(func) //switch on function
{
case '+': disp_num(num1+num2); break;
case '-': disp_num(num1-num2); break;
case 'x': disp_num(num1*num2); break;
case '/': disp_num(num1/num2); break;
}
}
else //key other then = here means
error wrong input
{
if(key == 'C') //if clear screen is pressed then clear
screen and reset
writecmd(0x01); //Clear Screen
else
DispError(0); //Display wrong input error
}
}
}
}
}

As you can see in the above function, I have first check for the first key press.
When you pressed the first key on keypad then I get this key and converter it to integer.
After that I waited for the next key which must be some operation key like + – X or / otherwise it
will generate the error message.
After that code is waiting for the third key which should be some numerical digit and then I
converter it to integer again and if you entered some invalid key then it will generate the error.
Finally waiting for the = sign. When you press the = sign it will automatically perform the
required operation which I placed in the switch case loop.
It will calculate the value and then print out the result and on next key press it will first clear the
screen and then get the value and will continue.
Below is the detailed code for the project with comments and I hope you wont get into any
trouble and will get it clearly.

#include<reg51.h>
#include<string.h>

//Define Macros
#define Error 13 // Any value other than 0 to 9 is good here

//Function declarations
void cct_init(void);
void delay(int);
void lcdinit(void);
void writecmd(int);
void writedata(char);
void writeline(char[]);
void ReturnHome(void);
char READ_SWITCHES(void);
char get_key(void);
int get_num(char);
char get_func(char);
void DispError(int);
void disp_num(int);
void WebsiteLogo();

//*******************
//Pin description
/*
P2 is data bus
P3.7 is RS
P3.6 is E
P1.0 to P1.3 are keypad row outputs
P1.4 to P1.7 are keypad column inputs
*/
//********************
// Define Pins
//********************
sbit RowA = P1^0; //RowA
sbit RowB = P1^1; //RowB
sbit RowC = P1^2; //RowC
sbit RowD = P1^3; //RowD

sbit C1 = P1^4; //Column1


sbit C2 = P1^5; //Column2
sbit C3 = P1^6; //Column3
sbit C4 = P1^7; //Column4

sbit E = P3^6; //E pin for LCD


sbit RS = P3^7; //RS pin for LCD

// ***********************************************************
// Main program
//
int main(void)
{
char key; //key char for keeping record of pressed key
int num1 = 0; //First number
char func = '+'; //Function to be performed among two numbers
int num2 = 0; //Second number

cct_init(); //Make input and output pins as required


lcdinit(); //Initilize LCD
WebsiteLogo();
while(1)
{
WebsiteLogo();
//get numb1
key = get_key();
writecmd(0x01); //clear display
WebsiteLogo();
writedata(key); //Echo the key pressed to LCD
num1 = get_num(key); //Get int number from char value, it checks for wrong input as
well

if(num1!=Error) //if correct input then proceed, num1==Error means wrong input
{
//get function
key = get_key();
writedata(key); //Echo the key pressed to LCD
func = get_func(key); //it checks for wrong func

if(func!='e') //if correct input then proceed, func=='e' means wrong


input
{
//get numb2
key = get_key();
writedata(key); //Echo the key pressed to LCD
num2 = get_num(key); //Get int number from char value, it checks
for wrong input as well

if(num2!=Error) //if correct input then proceed, num2==Error


means wrong input
{
//get equal sign
key = get_key();
writedata(key); //Echo the key pressed to LCD

if(key == '=') //if = is pressed then proceed


{
switch(func) //switch on function
{
case '+': disp_num(num1+num2); break;
case '-': disp_num(num1-num2); break;
case 'x': disp_num(num1*num2); break;
case '/': disp_num(num1/num2); break;
}
}
else //key other then = here means
error wrong input
{
if(key == 'C') //if clear screen is pressed then clear
screen and reset
{
writecmd(0x01); //Clear Screen
WebsiteLogo();
}
else
{
DispError(0); //Display wrong input error
WebsiteLogo();
}
}
}
}
}
}
}

void WebsiteLogo()
{
writecmd(0x95);
writedata('w'); //write
writedata('w'); //write
writedata('w'); //write
writedata('.'); //write
writedata('T'); //write
writedata('h'); //write
writedata('e'); //write
writedata('E'); //write
writedata('n'); //write
writedata('g'); //write
writedata('i'); //write
writedata('n'); //write
writedata('e'); //write
writedata('e'); //write
writedata('r'); //write
writedata('i'); //write
writedata('n'); //write
writedata('g'); //write

writecmd(0xd8);

writedata('P'); //write
writedata('r'); //write
writedata('o'); //write
writedata('j'); //write
writedata('e'); //write
writedata('c'); //write
writedata('t'); //write
writedata('s'); //write
writedata('.'); //write
writedata('c'); //write
writedata('o'); //write
writedata('m'); //write
writecmd(0x80);
}

void cct_init(void)
{
P0 = 0x00; //not used
P1 = 0xf0; //used for generating outputs and taking inputs from Keypad
P2 = 0x00; //used as data port for LCD
P3 = 0x00; //used for RS and E
}

void delay(int a)
{
int i;
for(i=0;i<a;i++); //null statement
}

void writedata(char t)
{
RS = 1; // This is data
P2 = t; //Data transfer
E = 1; // => E = 1
delay(150);
E = 0; // => E = 0
delay(150);
}

void writecmd(int z)
{
RS = 0; // This is command
P2 = z; //Data transfer
E = 1; // => E = 1
delay(150);
E = 0; // => E = 0
delay(150);
}

void lcdinit(void)
{
///////////// Reset process from datasheet /////////
delay(15000);
writecmd(0x30);
delay(4500);
writecmd(0x30);
delay(300);
writecmd(0x30);
delay(650);
/////////////////////////////////////////////////////
writecmd(0x38); //function set
writecmd(0x0c); //display on,cursor off,blink off
writecmd(0x01); //clear display
writecmd(0x06); //entry mode, set increment
}

void ReturnHome(void) /* Return to 0 cursor location */


{
writecmd(0x02);
delay(1500);
WebsiteLogo();
}

void writeline(char Line[])


{
int i;
for(i=0;i<strlen(Line);i++)
{
writedata(Line[i]); /* Write Character */
}

ReturnHome(); /* Return to 0 cursor position */


}

char READ_SWITCHES(void)
{
RowA = 0; RowB = 1; RowC = 1; RowD = 1; //Test Row A
if (C1 == 0) { delay(10000); while (C1==0); return '7'; }
if (C2 == 0) { delay(10000); while (C2==0); return '8'; }
if (C3 == 0) { delay(10000); while (C3==0); return '9'; }
if (C4 == 0) { delay(10000); while (C4==0); return '/'; }

RowA = 1; RowB = 0; RowC = 1; RowD = 1; //Test Row B

if (C1 == 0) { delay(10000); while (C1==0); return '4'; }


if (C2 == 0) { delay(10000); while (C2==0); return '5'; }
if (C3 == 0) { delay(10000); while (C3==0); return '6'; }
if (C4 == 0) { delay(10000); while (C4==0); return 'x'; }

RowA = 1; RowB = 1; RowC = 0; RowD = 1; //Test Row C

if (C1 == 0) { delay(10000); while (C1==0); return '1'; }


if (C2 == 0) { delay(10000); while (C2==0); return '2'; }
if (C3 == 0) { delay(10000); while (C3==0); return '3'; }
if (C4 == 0) { delay(10000); while (C4==0); return '-'; }

RowA = 1; RowB = 1; RowC = 1; RowD = 0; //Test Row D

if (C1 == 0) { delay(10000); while (C1==0); return 'C'; }


if (C2 == 0) { delay(10000); while (C2==0); return '0'; }
if (C3 == 0) { delay(10000); while (C3==0); return '='; }
if (C4 == 0) { delay(10000); while (C4==0); return '+'; }

return 'n'; // Means no key has been pressed


}

char get_key(void) //get key from user


{
char key = 'n'; //assume no key pressed

while(key=='n') //wait untill a key is pressed


key = READ_SWITCHES(); //scan the keys again and again

return key; //when key pressed then return its value


}

int get_num(char ch) //convert char into int


{
switch(ch)
{
case '0': return 0; break;
case '1': return 1; break;
case '2': return 2; break;
case '3': return 3; break;
case '4': return 4; break;
case '5': return 5; break;
case '6': return 6; break;
case '7': return 7; break;
case '8': return 8; break;
case '9': return 9; break;
case 'C': writecmd(0x01); return Error; break; //this is used as a clear screen and
then reset by setting error
default: DispError(0); return Error; break; //it means wrong input
}
}

char get_func(char chf) //detects the errors in inputted function


{
if(chf=='C') //if clear screen then clear the LCD and reset
{
writecmd(0x01); //clear display
WebsiteLogo();
return 'e';
}

if( chf!='+' && chf!='-' && chf!='x' && chf!='/' ) //if input is not from allowed funtions
then show error
{
DispError(1);
WebsiteLogo();
return 'e';
}

return chf; //function is correct so return the correct function


}

void DispError(int numb) //displays differet error messages


{
writecmd(0x01); //clear display
WebsiteLogo();
switch(numb)
{
case 0: writeline("Wrong Input"); break;
case 1: writeline("Wrong Function"); break;
default: writeline("Wrong Input"); break;
}
}

void disp_num(int numb) //displays number on LCD


{
unsigned char UnitDigit = 0; //It will contain unit digit of numb
unsigned char TenthDigit = 0; //It will contain 10th position digit of numb
if(numb<0)
{
numb = -1*numb; // Make number positive
writedata('-'); // Display a negative sign on LCD
}

TenthDigit = (numb/10); // Findout Tenth Digit

if( TenthDigit != 0) // If it is zero, then don't display


writedata(TenthDigit+0x30); // Make Char of TenthDigit and then display it on
LCD

UnitDigit = numb - TenthDigit*10;

writedata(UnitDigit+0x30); // Make Char of UnitDigit and then display it on LCD


}

The above code is quite self explanatory and the main part I have already explained but still if
you get into any troubled then ask in comments and I will resolve them.
Now copy this code in your keil uvision 3 and get the hex file.
Upload your hex file in Proteus ISIS and run your simulation.
The first screen you will get is as follows, which obviously displays our website address 😛
Now, let’s add 3 + 5 and we will get as shown in below figure:

Next operation, we are gonna do is the subtract one, so lets do this operation 3-9 = , shown
below:
Now, lets do the third operation which is multiplication, so let’s do this operation 9×9, shown
below:

Now, finally do the last operation which is division, so I did 6/3 and result is shown below:
So, all the operations are shown in above figures, now if you give it wrong number like 2 digit
number then it will display error message, as shown below:

It has become quite a lengthy post, so let’s have the ending part.
You can download the Proteus Simulation along with hex file and code by clicking the below
button.
Download Proteus Simulation and Code
So, that’s all with the designing of simple Calculator with 8051 Microcontroller. I will try to work
on advanced calculator, if I got time but I am not sure of that.

Ultrasonic Sensor Library for Proteus


In today’s post I am gonna share an Ultrasonic
Sensor Library for Proteus. Few days ago I have
posted a tutorial on Arduino Library for Proteus
which also has the Ultrasonic sensor in it but
that’s a quite basic library for Ultrasonic sensor,
so here comes the new Ultrasonic Sensor Library
for Proteus. Using this library, you can perform
any kind of function with ultrasonic sensor, you
can also interface it with different
Microcontrollers like Arduino, PIC
Microcontroller etc.
First of all, lets have a brief introduction of ultrasonic sensor. In ultrasonic sensor, there are two
nodes in which one is transmitter while the other is receiver. The transmitter sends an ultrasonic
wave and this wave strikes to any hindrance present in front of it and then bounces back. This
bounced ultrasonic sensor is then captured by the receiver and on the basis of the time taken by
this wave to return, the sensor calculates the distance of that obstacle from that sensor.
Ultrasonic sensor is usually used for detecting the obstacle in path and also to find the distance
between sensor and the obstacle. Ultrasonic sensor normally used is HC-SR04, which is also used
here in this library. Let’s get started with Ultrasonic Sensor Library for Proteus, in this library we
have used an extra pin on ultrasonic sensor, which is analog pin. The voltage on that pin is used
to detect how close object is because its a simulation and we can’t place an actual object in front
of our laptop. Moreover, you should also have a look at this Home automation Projects using
XBee & Arduino, I have used this ultrasonic sensor in that project.
I hope you are gonna enjoy this library, I have also shared many other libraries which are
mentioned below, I hope you are gonna enjoy them too. These libraries are designed by our
team after a lot of effort so its a humble request to all other bloggers that share it as much as
you can but do mention our blog post link in the description. 🙂 So, let’s get started with
Ultrasonic Sensor Library for Proteus and its interfacing with Arduino.
I have also posted more examples on Ultrasonic Sensor Simulation in Proteus, have a look at
them and you will get complete understanding of this sensor.

Ultrasonic Sensor Library For Proteus

First of all download this Ultrasonic Sensor Library for Proteus, by clicking on the below button.
Download Ultrasonic Library for Proteus
In this ultrasonic sensor library for Proteus, you will find three files which are:

 UltrasonicTEP.IDX
 UltrasonicTEP.LIB
 UltrasonicTEP.HEX
Now, place these three files in the library folder of your Proteus software.
Now start your Proteus software and in components list, search for Ultrasonic sensor and place it
in your workspace as shown in below figure:

Now we have our ultrasonic sensor in Proteus but if you run it then it won’t work as we haven’t
yet added any functionality in it.
So, in order to add the functionality double click this ultrasonic sensor and open its properties.
In properties, select the Program File section and browse to UltrasonicTEP.HEX file and upload it
as shown in below figure:
Now our ultrasonic sensor is ready to be used.
Now let’s make a simple example for ultrasonic sensor so that you get an idea how to use it in
Proteus.

Ultrasonic Simulation in Proteus

After adding the Ultrasonic Sensor Library for Proteus, open your Proteus ISIS software or restart
it if its already open.
Now search for the below components in the Proteus Components Library and add them in your
workspace as shown in below figure.

Components Used
Here’s the list of components, which I have used for designing this Proteus Simulation:

 Arduino UNO
 Ultrasonic Sensor HC-SR04
 LED
 Variable Resistor

Proteus Simulation
After adding these components, now design a simulation as shown in below figure:
Now in this example, I am receiving data from Ultrasonic Sensor and then printing this data over
Virtual Terminal in Proteus, if you are not much familiar with Virtual Terminal, then read How to
use Virtual Terminal in Proteus ISIS .
Now open your Arduino software and paste the below code in it and compile to get the hex file,
read Arduino Library for Proteus to know how to get the Arduino Simulation in Proteus.
You must also read How to get the hex file from Arduino Software.

const int pingPin = 7; // Trigger Pin of Ultrasonic Sensor


const int echoPin = 6; // Echo Pin of Ultrasonic Sensor

void setup()
{
Serial.begin(9600); // Starting Serial Terminal
}

void loop()
{
long duration, inches, cm;
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(10);
digitalWrite(pingPin, LOW);

pinMode(echoPin, INPUT);
duration = pulseIn(echoPin, HIGH);
inches = microsecondsToInches(duration);
cm = microsecondsToCentimeters(duration);

Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();

delay(100);
}

long microsecondsToInches(long microseconds)


{
return microseconds / 74 / 2;
}

long microsecondsToCentimeters(long microseconds)


{
return microseconds / 29 / 2;
}
Its quite a simple code and is self explanatory, if you still got some trouble then ask in comments
and I will reply them. I have simply used the ping example in Arduino Examples and slightly
modified it.
After getting the hex file, now upload it to Arduino in Proteus by clicking the properties.
Click on the Start button and if everything’s gone fine then you will see an output as shown in
below figure:

As you can see in the above figure, the virtual terminal is showing distance values, now this value
depends on the variable resistance attached to the ultrasonic sensor.
As you change the value of the variable resistance, the voltage on that particular pin will also
change and on the basis of that you will get the distance in inches and centimeters on the virtual
terminal.
Arduino code and hex file along with the Proteus Simulation for this ultrasonic example are
attached below. You can download it by clicking on the below button but I would suggest you to
design it on your own, it will help you in learning.
You should also have a look at these Arduino Projects for Beginners.
Download Code and Simulation
That’s all for today, in the coming post I am gonna share some more examples of how to use
ultrasonic sensor in Proteus.
Send SMS with SIM900D in Proteus ISIS

Today, I am going to share a new exciting post


on Send SMS with SIM900D in Proteus ISIS. In my previous post, I have shared the new GSM
Library for Proteus, which is the first ever designed library for Proteus, and I am quite excited
while sharing its features. So, today, we will use this GSM Lirbary for Proteus and we are gonna
send sms with Sim900D module available in that library. We are gonna design this whole project
in Proteus ISIS.
If you wanna implement it on hardware then you must have a look at Send SMS with SIM900D
module with Arduino which is designed in real hardware but today we are gonna just do the
simulation part. Iam not gonna use any Microcontroller today. Instead I will just send the AT
commands through virtual Terminal and we will make it work.So, let’s get started with Send
SMSM with Sim900D in Proteus ISIS.

Send SMS with SIM900D in Proteus ISIS

First of all, I assume that you have already installed the GSM Library for Proteus. If you haven’t
then first install it because without this library you can’t use GSM module in Proteus ISIS.
Next thing you need to do is to design a circuit as shown in the below figure:

Now we need to run the simulation, so run it and in your virtual terminal, send these commands
as shown in below figure:
The first AT command is for testing our GSM module and as it has given OK in reply so it means
its working correctly.
The second command AT+CMGF=1 is for converting our GSM module to text messages, which it
has accepted correctly and has given us OK in reply.
Now we are ready to send our SMS.
So, in order to do that we have to send it the command, as shown in below figure:

Now you can see, when I have given it the command which is AT+CMGS=”+923326062060″ , it
has accepted it and replied back with this sign “>” , now the GSM module is actually asking for
the message body.
So, let me write some text and then when I enter the Cntrl+Z command then it will send the
message as shown in below figure:

So, I have given it the text of my blog link and then when I entered Ctrl+Z then it has sent the
SMS and replied me back with +CMGS: 01 means its the first SMS sent from this GSM module.
So, that’s how you can send any number of messages as you want from this module.
AS its a simulation, so obviously you are not gonna get the actual message on your mobile
number but you can use it for testing your codes.
In the next post, I am gonna hopefully implement it using Arduino board or PIC Microcontroller.
Video
So, that’s all for today, I hope you have enjoyed the Send SMS with Sim900D in Proteus ISIS
software.

How to use 18B20 in Proteus ISIS ???


In today’s post we are gonna have a look at How to
use Temperature Sensor 18B20 in Proteus ISIS. I
will use Arduino board as a microcontroller and
will connect the temperature sensor with it and
then will display the code on LCD. I have already
posted the same tutorial in which I have done
Interfacing of Temperature Sensor 18B20 with
Arduino but in that project I have used the real
components and designed the hardware. But
today, I will just show you the simulation so that
you could test the simulation first and then design
it in hardware.
Temperature Sensor 18B20 is the most commonly used temperature sensor. It’s a one wire
sensor means it sends data through a single wire and we can connect multiple sensors with a
single wire, that’s why its quite efficient and easy to use as well. I have also posted a tutorial on
How to Interface LM35 sensor with Arduino in Proteus ISIS which is another temperature sensor
so give it a try as well and let me know which one you think is better. Anyways let’s get started
with temperature sensor 18B20 in Proteus ISIS.

How to use 18B20 in Proteus ISIS ???

First of all, get these components from Proteus components list as shown in below figure:

Now design the circuit as shown in below figure:


As you can see in above simulation, we have used Arduino UNO board along with LCD and 18B20
temperature sensor.
18B20 in Proteus can’t detect the real temperature but we can change the temperature by
pressing + and – buttons.
So, now we have interfaced the temperature sensor and the LCD with Arduino. Next we are
gonna design the code for Arduino and will upload it in Arduino baord.
Now download these three libraries, one is “one wire” library which is the protocol for 18B20
temperature sensor, next is the Dallas Temperature sensor library which is the actua library for
temperature sensor 18B20 and uses one wire library. Third library is the Crystal LCD library which
is used for displaying character on LCD.
So, download all these three libraries by clicking on below buttons and then paste them in your
libraries folder of Arduino software.
Download One Wire Library
Download Dallas Temperature Library
Downlaod Liquid Crystal Library
Now after adding these libraries, open your Arduino software and paste the below code into it.

#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>

#define ONE_WIRE_BUS 6
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup(void)
{
Serial.begin(9600);
Serial.println("Welcome to TEP !!!");
Serial.println("www.TheEngineeringProjects.com");
Serial.println();
sensors.begin();

lcd.begin(20, 4);
lcd.setCursor(5,0);
lcd.print("Welcome to:");
lcd.setCursor(1,2);
lcd.print("www.TheEngineering");
lcd.setCursor(4,3);
lcd.print("Projects.com");
delay(5000);
}

void loop(void)
{
sensors.requestTemperatures();
Serial.print("Temperature : ");
Serial.println(sensors.getTempCByIndex(0));
//lcd.clear();
lcd.setCursor(0,0);
lcd.print("Temperature: ");
lcd.print(sensors.getTempCByIndex(0));
lcd.print("C");
delay(1000);
}

Now get your hex file from Arduino and upload it to your Proteus Arduino board and hit the RUN
button.
If everything goes fine then you will something like this at the start:

After a delay of around 5 sec you will start receiving the Temperature sensor 18B20 values on
your LCD as shown in below figure:
Now you can see the value shown in the temperature sensor is the same as in LCD.
So, now by clicking the + and – buttons on temperature sensor, you can increase and decrease
the value of temperature and same will be changed in LCD.
That’s how you can do simulation of Temperature sensor 18B20 in Proteus ISIS. Its quite simple
and easy to use.

Interfacing of LM35 with Arduino in Proteus ISIS


Today i am going to share a new project which is
Interfacing of temperature sensor LM35 with Arduino
UNO in Proteus ISIS. Up till now i have worked on a
number of projects regarding temperature sensor
devices and i have been using 18B20 IC for temperature
measurements and i have also uploaded a tutorial on
Interfacing of Temperature Sensor 18B20 with Arduino.

Recently i got a chance to work on a project regarding


temperature sensing but the condition of this project
was that to use only LM35 for temperature detection. Then i get to know much about LM35, its
operating conditions and features. So i thought i should also upload its tutorial as it will also be
advantageous for you people. Because learning new things is always a charm. Another excellent
thing about LM35 is that its quite cheap as compared to other temperature sensors like 18B20.
And as its cheap that’s why its not very reliable, if you personally ask me then I will prefer 18B20
over LM35 because of its accurate readings. Now lets move towards its interfacing and its
practical applications. First of all, let’s have a quick look on introduction of LM35 and then we
will design it in Proteus ISIS.

Introduction of LM35 Temperature Sensor

LM35 is an electrical sensor which is used to measure temperature of its surrounding. It’s output
is generated in the form of Electrical signal and this electrical signal is proportional to the input
temperature, which it detects. Lm35 is much more sensitive then other temp measuring devices
(not accurate) and that’s why it is most widely used temp detection device now-a-days. The
internal circuitry of this IC is sealed and the external conditions will have no effect on the
operation of LM35 and also its output is not effected under any conditions.LM35 is a 3 pin IC and
it is used for temperature detection. The physical appearance of LM35 is shown in the image
given below:

As you can see in the above image that LM35 is a 3 pin IC.
The first pin is used for supply from source. Since this IC operates on 5 volts so 5 volts from
source are applied at this pin.
The middle pin is its data pin and through this pin LM35 gives its output and when it measures a
temerature then it generates a electrical signal proportional to that temperature and through
this pin data is send to the external circuit.
The last pin is for GND and through this pin GND is provided to LM35 IC.
Interfacing of temperature sensor LM35 with Arduino

As my today’s tutorial is about interfacing of LM35 with Arduino so let’s start it. I have connected
LM35 with Arduino micro controller and it is shown in the image given below:

As you can see in the above image, i have connected a LM35 IC with Arduino UNO micro
controller.
The VCC pin of LM35 is connected to +5V of Arduino board.
Since LM35 generates Analogue value at its output pin that’s why I have connected this pin to
‘A0’ pin of Arduino board. This pin of Arduino board is used to receive analog data from external
source.
And the last pin is connected to the GND pin of Arduino board.
After connecting the circuit, now upload the below code in your Arduino board.

#define TempPin A0

int TempValue;

void setup()
{
Serial.begin(9600); // Initializing Serial Port
}
void loop()
{
TempValue = analogRead(TempPin); // Getting LM35 value and saving it in variable
float TempCel = ( TempValue/1024.0)*500; // Getting the celsius value from 10 bit analog value
float TempFarh = (TempCel*9)/5 + 32; // Converting Celsius into Fahrenhiet

Serial.print("TEMPRATURE in Celsius = "); //Displaying temperature in Celsius


Serial.print(TempCel);
Serial.print("*C");
Serial.print(" | ");

Serial.print("TEMPRATURE = "); // Displaying Temperature in Fahrenheit


Serial.print(TempFarh);
Serial.print("*F");
Serial.println();

delay(1000);

Interfacing of temperature sensor LM35 with Arduino in Proteus ISIS

Now let’s do this project in Proteus. Proteus also has LM35 sensor in its database which we are
gonna use here.
Moreover, we also know about Arduino Library for Proteus, so using that library we are gonna
interface LM35 with Arduino in Proteus ISIS.
First of all, design the same circuit as shown in above figure in Proteus software as shown below:
Its the same circuit as we designed before, the only addition is the virtual terminal. We are using
it to check the values. Its simply like the Serial Monitor we use in Arduino software.
So, now using the above code, create the hex file and upload it in Proteus.
Now hit run and if everything goes fine then you will get results as shown in below figure:

You can see the Virtual Terminal is showing the same value as shown on the sensor which is 33
in Celsius and later, I converted it to Fahrenheit.
How to use Capacitive Touch Sensor in Proteus?
Today i am going to share my new project’s tutorial
which is How to use Capacitive Touch Sensor in
Proteus ISIS. It is a very interesting project, and we
will be using a 555 Timer while designing this
project. If you recall our previous project tutorial
which was Angle Control of Servo Motor using 555
Timer in Proteus ISIS, in which 555 timer was
generating PWM and was controlling the rotating
angle of servo motor.
Now in this project, we have a little different context and now we will be using a 555 Timer in
collaboration with Capacitive Touch Sensor. First of all, lets have a little introduction of
Capacitive Touch Sensor. Well, if we talk broadly then, in Electrical Engineering Capacitive Touch
Sensing is a Technology used in Capacitive Coupling. Capacitive Coupling is a technology which
takes Human Body’s Capacitance as an input and it measures anything which has a potential
difference or which is conductive or any static object which has a dielectric difference from that
of air. While designing this technology, one side of the insulator is coated with the conductive
material and a very small voltage is applied to this conductive layer. Now after applying the
voltages to the conductive layer, a uniform electrostatic field is formed. After that if any
conductor (suppose human finger) will come within the vicinity of this field or it touches the
other non coated layer of the insulating material then a capacitor will be dynamically formed and
if potential difference between both bodies is HIGH then the current will start to flow. That was a
little introduction of Capacitive Touch Sensor, and now lets be practical and move towards the
Hardware of the Above described tutorial.
You can download the complete simulation of above described project by simply clicking on the
button given below:
Download Simulation Files

How to use Capacitive Touch Sensor in Proteus

In this project, we are using 555 Timer in collaboration with Capacitive


Touch Sensor. A 555 timer is an 8 pin IC. Pin # 6 is called threshold pin and
for 555 timer threshold level is 5 volts.
So, 555 timer will trigger above 5 volts and it will generate output which can
be collected from pin # 3 represented as ‘Q’ which is output pin of 555
timer.
While moving toward the simulation of project, first of all place all the
components in the proteus workspace, as shown in the image given below:

First of all we have place Capacitive Touch Sensor and after that we have
placed a NPN transistor, then 555 Timer will come and at the output of 555
Timer we have added a LED. The complete circuit diagram ready for
simulation is shown in the image given below:
As long as the finger is out of the vicinity of the electrostatic field, no potential difference occurs
and the LED remains in the OFF state.
Now if we move the finger towards Capacitive Touch Sensor, then and when the potential
difference reaches up to 0.6 volts, then 555 triggers and it generates output voltages across LED
which are 5 volts but in some cases voltages are lost due to series connected resistances. This
phenomenon is shown in below image:

Now if we further move the finger and take it completely near the sensor, then at this point max
potential difference will occur between both point (finger and conductive layer). An important
thing to note here is that, we have change the location of our interrupt ( finger) but, same
voltages are appearing across LED which are 4.91 volts in this case. It can also seen in the figure
given below:
Now, if we summarize the whole project, then we have seen that the movement of finger is in
fact controlling our output. When the finger was out of vicinity of the sensor, then LED was OFF.
When we moved the finger in forward direction and came in the vicinity of Electrostatic field,
then Sensor gives signal to 555 Timer and Timer makes LED to glow.
Here’s a video demonstrating Capacitive Touch Sensor in Proteus ISIS.

Applications Of Capacitive Touch Sensor

Capacitive sensing touchscreens are now a days commonly used in Digital Audio Players, Mobile
Phones and Tablet Computers. Capacitive touch sensors also have the ability to replace
Mechanical Buttons. Back in 1928 Russians invented a music instrument known as “Theremin” ,
in which The Instrument Player was able to control the volume and pitch of the sound without
physically touching the instrument. Capacitive Touch Sensors are of basic level but they are back
bone of large industrial projects and are widely used in designing some other sensors like:

 Position sensor.
 Humidity sensor.
 Fluid or Water level sensor.
 Proximity sensor etc..

How to use LDR Sensor in Proteus


In today’s post, I am gonna share how to use LDR
sensor in Proteus. Proteus, as we all know, is a
very handy software and is used for circuit and
PCB designing. It is also used for circuit and
programming testing. It is normally used by
engineers in their projects and contains a vast list
of built-in components. I have posted a lot of
tutorials on Proteus and I have got quite a positive
feedback from the reader about these tutorials.
So, I thought to share another component in Proteus which is quite hidden and I haven’t seen
much posts on it available online.
So, in today’s post, first I am gonna explain what is LDR sensor? and we will see where it is used
and how it is used. After that I will design a simple circuit in Proteus in which I will turn control a
LED using LDR sensor andwill make it ON and OFF. So, as usual let’s start from the beginning so
that the newcomers could also get benefit from it.

What is LDR Sensor?

LDR is an abbreviation of Light dependent resistor. It is also known as photoresistor or photocell.


Its symbol is shown in the below figure:

LDR Sensor is used for the detection of light, internally it has a resistance which is sensitive to
light as shown in the symbol.
Whenever light falls on the LDR sensor, its resistance start decreasing and when it comes to dark
then its resistance start increasing. Using the value of resistance one can easily detect whether
there’s light or not.
It is normally used in light activated switches.For instance, you have seen the automatic street
lights, which go ON when its night and automatically go OFF when its day time. In those street
lights, LDR sensors are used.

Working of LDR Sensor

As I explained above, it has an internal resistance which is very sensitive to light intensity and
varies according to it.
So, one thing is quite clear that LDR sensor is an analog sensor. It gives us different values
depending on the light intensity falling on it.
Let’s have a look on the simplest circuit of LDR sensor, which is shown in the below figure:
Now if you check the above image you can see we have placed a resistor in series with the LDR
sensor and have applied a voltage source across them.
Now when the light will fall on the LDR sensor, its resistance will go LOW and in return the
voltage across the LDR will also go LOW and as the LDR will come in dark, the resistance will go
HIGH and in return the voltage will also go HIGH.
Its the simplest working phenomena of LDR sensor. Now if you are using the LDR sensor with
some microcontroller then what you need to do is simply give this intermediate connection of
resistor and LDR to microcontroller.

Circuit Designing of LDR Sensor in Proteus

Now we know the basics of LDR sensor and have also seen how it works so now let’s design its
circuit in Proteus.
There are two types of LDR sensors available in Proteus which are exactly the same in
functioning but are different in operating. Both are shown in the below figure:

The first one has a digital display along with it on which the voltage value is displayed while the
second one a bit more animated and has a torch with it, so when you press the up arrow the
torch will come closer and in other words the light is falling on the LDR and when you press the
down arrow the the torch will go away and your LDR is in dark now.
Both of these states are shown in below figure:
Now you can see both the states quite clearly, in the first state torch is away so LDR is in dark
while in second state, torch is close so LDR is ON.
So, now let’s design their circuit to control a LED with LDR Sensor in Proteus. In order to do so,
design this simple circuit in Proteus as shown in below figure:

Its a very simple circuit in which I am using a comparator and then giving output to LED. When
the LDR is in dark then the LED will remain OFF and when the LDR will go into light then the LED
will turn ON.
Both of these states are shown in below figure:
Now you can see when the voltage on the digital display of LDR were LOW then the LED was OFF
and when increased the voltage then the LED went ON.
Now let’s check both of these states with the second LDR sensor in Proteus, which are shown in
the below figure:
Again quite obvious, when the torch was away then LDR was in dark and the LED was OFF but in
second state when I moved the torch close the LED went ON.
Here’s the Proteus Simulation of LDR sensor attached below, download and play with it. 🙂
Download LDR Sensor in Proteus Simulation

Ultrasonic Sensor Simulation in


Proteus
few days ago I have posted an Ultrasonic
Sensor Library for Proteus, using which one
can easily simulate ultrasonic sensor in
Proteus. The post was highly praised by the
reader and I have received quite good feedback from the followers. So, I thought of sharing
some more examples related to it so that user can get a complete understanding of how to use
Ultrasonic Sensor in Proteus. Today, we are gonna have a look on different Ultrasonic Sensor
Simulation in Proteus. If you haven’t read the previous post then first have a look at it because
without the installation of Ultrasonic Sensor Library in Proteus, you won’t be able to use these
examples. Ultrasonic Sensor is used widely in Embedded Systems.
Today, I am gonna share three examples of Ultrasonic Sensor Simulation in Proteus, which will
be enough for you guys to get the overview of this sensor. I have also attached these simulations
below and you can easily download them but as I normally advise, its better to design these
simulations by yourself and write your own code as it will help you in understanding it more
clearly. If you don’t make mistakes, you won’t learn from it. I am gonna share below three
examples of Ultrasonic Sensor:

 Button
 Proximity
 Switch

Ultrasonic Sensor Simulations in Proteus using Button

In this tutorial, we are gonna use three buttons and using these buttons we will control our
ultrasonic sensor.
Think of these buttons as three obstacles, which are placed at different distances, if we hit the
first button then first obstacle is reached, if we hit second then second obstacle and same as for
third.
So, open your Proteus ISIS and if you have already installed ultrasonic library for Proteus then
design your Ultrasonic Sensor Simulation in Proteus as shown in below figure:
Now open your Arduino software and paste below code in it and get your hex file to upload in
this simulation.

Note: You should read How to get Hex File from Arduino first.
Don’t forget to upload the UltrasonicTEP.HEX file in your Ultrasonic Sensor as we done in
Ultrasonic Library for Proteus.

const int pingPin = 7;


const int echoPin = 6;

void setup()
{

Serial.begin(9600);

void loop()
{
long duration, inches, cm;
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(10);
digitalWrite(pingPin, LOW);
pinMode(echoPin, INPUT);
duration = pulseIn(echoPin, HIGH);
inches = microsecondsToInches(duration);
cm = microsecondsToCentimeters(duration);
Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();

delay(100);
}

long microsecondsToInches(long microseconds)


{
return microseconds / 74 / 2;
}

long microsecondsToCentimeters(long microseconds)


{
return microseconds / 29 / 2;
}

After adding the hex file in this simulation, hit the RUN button and if everything goes as expected
then you will get a simulation as shown in the below figure:
You can download this simulation along with Arduino code and the hex file by clicking below
button:
Download Ultrasonic Sensor simulation in Proteus Using Button

Ultrasonic Sensor Simulations in Proteus as Proximity Switch

I have explained the first example in detail so I am not gonna much explain this one.
In this example, we are using the Ultrasonic Sensor as a Proximity Switch, whenever any obstacle
comes in the way of ultrasonic sensor, it will automatically give an indication.
As you can see from the figure below that we are using a variable voltage source for the analog
pin of ultrasonic sensor.
So, first of all design a simulation as shown in the below figure:
Now upload the Arduino hex file for this example, which is attached below along with the code
and this simulation.
After uploading the hex file, hit the RUN button and if everything is in your favor, then you will
see results similar to below figure:

As you can see in the above figure, we are sending a Ping from Ultrasonic Sensor and in the
programming code we have placed an alarm at a specified distance, so whenever any object
comes in that range, our program will give us Alarm, you could also use Buzzer in Proteus.
You can download this Proteus Simulation along with Arduino Code and hex file by clicking on
this below button:
Download Ultrasonic Sensor Simulation in Proteus As Proximity

Ultrasonic Sensor Simulations in Proteus using Switch

Here’s the third and last example of Ultrasonic Sensor simulation in Proteus.
In this simulation, we are using a switch and controlling the Ultrasonic with that Switch.
There are total four states for that Switch, which determines what should be the voltage on the
analog pin of Ultrasonic Sensor.
I have also placed a oscilloscope in this simulation which will give you the voltage state for this
switch, to get you an idea what’s the voltage pattern coming to ultrasonic sensor, its mainly just
for understanding and testing.
Now upload your Arduino hex file in it and hit the RUN button and you will see something like
this:
As you can see above, the virtual terminal is showing the distances while the oscilloscope is
giving us state of switch, play with it and you will learn more and if still confused then ask in
comments.
You can download the Proteus simulation of this example along with Arduino hex file and code
by clicking on the below button.
Download Ultrasonic Sensor Simulation in Proteus Using Switch

LED Flashing Project with 555 Timer in Proteus


I am going to show how to do LED Flashing Project with
555 Timer in Proteus ISIS. Its quite a simple project and
usually done by engineers in their first or second
semester. I have done this project in my first semester
and have learned quite a lot from it. I recently done it
on Proteus so thought of sharing it with you guys. It
will also work on hardware as I have tested it.
In this tutorial, we will first have a look at How to do
single LED Flashing with 555 Timer in Proteus ISIS. And
afterwards, we will also see how to flash two LEDs with
555 Timer in Proteus ISIS. It’s quite simple and anyone
one with basic knowledge of electronics can design it in
his first attempt. Still if you get into any trouble, then
ask in comments and I will try my best to resolve your
issues, but I don’t think it’s going to happen as its quite
basic. So, let’s start with this project:
Single LED Flashing Project with 555 Timer in Proteus ISIS

First of all, copy these components from the Proteus components library:

After selecting these components, now design a circuit in Proteus as shown in the below figure:

Now when you click on RUN button in PRoteus ISIS, the LED will kep on flashing,it will go ON for
1 sec and then go OFF as shown in below figures.
State # 1 is showing the OFF state of LED while the State # 2 is showing the ON state of LED.

So, it will keep on flashing unless you Stop the Proteus ISIS simulation.
You can download this simulation by clicking on the below button.
Download Single LED Flashing with 555 Timer in Proteus

Double LED Flashing Project with 555 Timer in Proteus ISIS

In the above portion, we have seen how to flash a single LED with 555 Timer in Proteus ISIS, now
let’s flash two LEDs with 555 Timer in Proteus ISIS.
First of all design a circuit as shown in below figure:
As you can see its quite similar to the above project for single LED flashing with 555 timer in
Proteus ISIS but has small changes in the values of resistor.
So, now when you hit RUN button on Proteus ISIS then these LEDs will start flashing one after
another, means when first LED is ON then the second one will be OFF and vice versa.
Below figures are showing their ON OFF states:

State # 1 is showing the OFF state for both the LEDs, while State # 2 is showing the ON state for
first LED and OFF state for second and in third State first LED is OFF while the second LED is ON.
So, this simulation will work in this way, if first LED is ON then the second one will be OFF and
vice versa.
You can download this second simulation by clicking on the below button:
Download 2 Led Flashing Project with 555 Timer in Proteus
That’s all for today, in the coming post we will have a look how to design a traffic signal flasher
with 555 timer in Proteus ISIS, which is going to be quite exciting tutorial, so let’s meet in the
next tutorial.

Multiple LED Flasher Project using 555 Timer in Proteus ISIS


In today’s tutorial, we are gonna see How to
design a Multiple LED Flasher Project using
555 Timer in Proteus ISIS. In our previous
tutorial we have seen How to design a LED
Flasher Project with 555 Timer in Proteus ISIS,
in which we have flashed single and double
LEDs. In today’s post, I am gonna extend that
previous tutorial and will see How to flash
multiple LEDs with 555 Timer in Proteus ISIS.
It’s quite a quick tutorial, as I don’t have much
material on it and its also quite simple so no much explanation is required. The complete project
is given at the end for download but again as I always mention, try to design it by yourself, so
that you get some knowledge out of it.This type of projects are normally designed by
engineering students in their first or second semesters and are really a good start in learning
electronics. IF you have any questions related to this project then ask in comments and I will try
my best to resolve them. So, let’s get started with implementation of multiple LED Flasher
Project using 555 Timer in Proteus ISIS.

Multiple LED Flasher Project using 555 Timer in Proteus ISIS

555 Timer is well known IC used in timing projects and its the most widely used IC before
microcontrollers.
In our previous project we have flashed one and two LEDs using 555 Timer which was quite
simple and easy and today we are gonna go a little advance and will flash multiple LEDs using
555 Timer.
So first of all, open your Proteus software and include the below components into its workspace.
After adding these components, now we need to design the circuit diagram.
So, design a circuit diagram of Multiple LED FLasher Project using 555 Timer as shown below:

If you have a look at the above figure closely and compare it with the previous project of 2 LED
Flasher with 555 Timer in Protes ISIS then you can have the idea that its simple an extended
version of that project.
I haven’t done anything but simply added LEDs in parallel to those 2 LEDs and give it a beutiful
form so that it look attractive.
These kinds of projects are normally used for decoration where you need to set some pattern for
LEDs and make them blink.
So, now we are done with the designing of our project so let’s run the PRoteus Simulation.
When you run the Proteus Simulation, and if everything’s gone fine then these LEDs will start
flashing as shown in the below figure:

The above figure shows the three states of this project.


State # 1 shows the OFF state of this project while State # 2 and 3 are the ON states, these LEDs
will keep on flashing as long as the simulation is running.
You can download the Proteus simulation of Multiple LED Flasher Project using 555 Timer by
clicking on the below button:
Download LED Flasher Project using 555 Timer
That’s all for today, I hope I have conveyed some knowledge and helped in some way. It was a
quite an easy project that’s why I haven’t explained much but if you have some querries then ask
in comments.

Traffic Signal Control using 555 Timer in Proteus


Now i am going to share my new project tutorial
which is Traffic Signal Control using 555 Timer.
Up till now i have uploaded a no. of projects
using 555 timer and i have got much appreciation
from my friends, for some 555 timer based
projects like How to use Capacitive Touch Sensor
in Proteus ISIS, Sequential LED Blinking using 555
Timer and many more.
Now i am going to share another application of
555 Timer and here we will be using a shift register (4017) next to 555 timer to implement Traffic
Signal Control circuit. 4017 is a SERIAL IN PARALLEL OUT shift register. Data enters in a serial
manner into register and it leaves the register in parallel manner. 4017 is a 10-bit shift register
and it needs a clock pulse to shift data from serial input pin to parallel output pins. Now we need
a device which can provide continuous clock pulse to Shift Register. Clock pulse is generated
either from Micro-controllers or some sort of timers. Here we will be using 555 Timer to
generate clock pulse. It is a very easy project to understand and also very simple to implement.
These type of projects are generally designed by the Engineering students in their First or Second
semester. Now i am done with the theory of the circuit and now lets move towards the designing
of the project.
You can also download the complete simulation of the above described project by simply clicking
on the button given below:
Download Traffic Signal Control Project using 555 Timer
Traffic Signal Control using 555 Timer in Proteus ISIS

First of all place all the components in your proteus workspace,as shown in the image below:

Threshold voltage for 555 Timer is 5 volts, and when voltages


exceeds this level, 555 timer triggers and it generates a output pulse
at its output pin which is ‘Q’ pin.
In this project, we will be using a battery of 12 volts as supply
voltages.Positive pin (+) of source is connected to Vcc pin of 555
Timer and the Negative pin (-) is connected to GND pin of 555 timer.
Pin#3 of 555 timer is connected to CLK pin of shift register and this
pin is the data input pin of shift register. Through this pin, 555 timer
send data to shift register.
At output pins of shift register we have connected 3 Leds, RED,
YELLOW and GREEN. Same colors which are used in Traffic Signals.
RED led is connected to output pin#12. YELLOW LED has 2 parallel
inputs that are pined at pin#10 and pin#11 respectively. Diodes are
connected the way of inputs to block reverse currents. YELLOW led
will glow if any of the input will be HIGH.
GREEN led has 4 parallel inputs connected at pin# 1,5,6,9
respectively. GREEN led has to blink for longer time, that’s why we
have connected multiple inputs to it. GREEN led will keep on
glowing as along as any of the input will be HIGH.
If you connected all the components in their exact position and all the connections are OK, then
the final circuit will look like as shown in the image below:
Now if you look the above circuit closely then, you will observe that we have connected high
valued capacitor (47uf) in the way of trigger pin of 555 timer.
The purpose of capacitor is to produce lag in the clock generated by 555 Timer.
Now when you will play the simulation then LED will start to glow in periodic manner. First RED
led will blink, then YELLOW led will glow and in the end GREEN led will start to glow.
All these stages are shown in the image given below:

As you can see that state#1 represents the “STOP” state, which means that traffic has to stop.
State#2 represents “GET READY” state and it means get ready to GO but you are not allowed to
go yet.
State#3 represents “GO” state, in which traffic is allowed to Go.
Alright friends that was all for today’s project. It was a very simple tutorial and most of its
portion have been explained in previous tutorials. So i haven’t explain it in much detail.

Relay Control Using 555 Timer in Proteus ISIS


Today I am going to share my new project
tutorial which is Relay Control Using 555
Timer in Proteus ISIS. We all know about
relays which are used for automatic switching
and are magnetically connected while
electrically insulated. If you don’t know much
about relay then I think you should first read
What is a Relay? in which I have given a
detailed overview of relays and where are
relays used? After reading this post you will
have a good grip over relay and today’s post will be piece of cake for you. Relays are mostly used
with some microcontroller like Arduino or PIC Microcontroller. You might also want to have a
look at traffic Signal Control using 555 Timer, which is good if you are interested in learning 555
Timer.
Now in today’s project, it can be understood from it’s name (Relay Control Using 555 Timer in
Proteus ISIS), that we are going to operate and control a Relay through 555 Timer. First of all, if
we define the relay, then we can say that, ‘Relay is a Electrical switch which operates
Mechanically’. You should also check this Relay Simulation in Proteus to know how it works.
Although some relays operate automatically but since we are working on a very basic project and
we will be controlling the relay from an external mean and for this we will use a mechanical
switch. Mechanical switch is in fact a button and we can turn it ON or OFF according to our own
choice. It is a very simple and easy project and most of its contents have been described in the
earlier tutorials. So, i am not going into much detail and without wasting any time, let’s move
towards the Hardware of the circuit. But its my personal advice, try to do design this relay
control using 555 timer project yourself and get to know the practical applications of 555 Timer
in person. You can also Download the complete simulation of above described tutorial by simply
clicking on the button given below:
Download Relay Control Project Using 555 Timer

Relay Control Using 555 Timer in Proteus ISIS

First of all place all the components in your Proteus workspace as shown in the image given
below:

Now connect supply voltage (+5 volts) to Vcc pin of 555 Timer.
At output pin of 555 Timer, which is pin # 3, we will connect our load. By load we mean a 5 volts
relay and a simple DC motor is connected next to the relay.
As i told earlier that we are using a manual relay, so a simple push Button is also connected
between pin # 3 and relay.
If you have connected all the electronic components in their exact place, then the final
simulation will look like as shown in the image given below:
If you notice the image closely, then you will observe that a Diode is also connected in parallel
with the relay coil.
A Relay contains a coil. When voltage source is applied across one end of the Relay and the other
end is connected to the ground, then relay gets energized. And when we remove the source
voltages then, it still remains energized and the stored charge tends to flow the reverse current.
The reason to connect the Diode is that it blocks the reverse current and only allows the forward
current to pass through it.
Now run the simulation, if button is kept in OFF state then, voltage will appear across the Relay
but it will not operate. To run the load, which is Motor in this case, we will have to turn the
switch ON. Which can be seen in the image given below:

As you can see in the above image, when the switch was in ON state, then relay gets no signal
and doesn’t operate. As we move the switch from ON state to OFF state, then relay gets the
signal and it starts to operate the load.
Now after reading today’s post, you must have a look at Relay Interfacing with Microcontroller
which is an advanced tutorial and the benefit of microcontroller is that now you can control your
relay any way you want.
Other exciting tutorials on 555 Timer includes Seven segment Control using 555 timer and Servo
Motor Control using 555 Timer.
I have created a small video for this tutorial in which I have shown how to do relay control using
555 Timer, I hope you are going to like it:
Alright Friends that was all for today’s tutorial about relay control using 555 timer.

Seven Segment Display Using 555 Timer


I am going to share my new project tutorial which is Seven Segment
Display using 555 Timer in Proteus ISIS. It is a very simple project to
understand Modern Digital Electronics.
As you all know, now a days all the Digital Display’s uses Seven Segment
Display. So first of all let’s have a little introduction about Seven
Segment Display. How they are fabricated and how their LED’s glow in
such a beautiful manner? Seven Segment Display (SSD) is the form of
electronic device, used to display decimal numbers. Seven Segment
Displays are commonly designed in Hexagonal shape but according to our project’s requirement
we can also design them in some other shapes like rectangle, triangle, trapezoid etc. Seven
Segment Displays may uses LIQUID CRYSTAL DISPLAY (LCD) or LIGHT EMITTING DIODE (LED) for
each display segment. In Seven Segment Display all the positive terminals (Anode) or all the
negative terminals (Cathode) are brought together to a common pin and such arrangements are
known as “Common Anode” or “Common Cathode” arrangement. In this project we will be using
Common Cathode arrangement and Hexagonal shape of Seven Segment Display. A simplest form
of Seven Segment Display is shown in the image below:

From the above shown image, we can see that we have total 7 LEDs and we will make them glow
in such a scheme that the final image will look like a Numerical number. Now if you recall one of
our previous project tutorial which was Sequential LED Blinking using 555 Timer, In that project,
we are using a 555 Timer in collaboration with a Shift Register. 555 timer continuously provides
clock to the Shift Register and Shift Register gives data to its output pins in parallel manner. In
today’s project, we are also going to use the same concept. We will use a 555 Timer which will
continuously provide clock to Shift Register it will enable it’s pin accordingly. We can gather this
whole information into a single table and also the sequence in which LED’s will blink. Such table
is called TRUTH TABLE and it is shown in the image given below:
In the above image, ‘1’ means ON state and ‘0’ means OFF state of a particular LED of Seven
Segment Display. Above was a little introduction of Seven Segment Display and now, lets move
towards Hardware and see How this beautiful display is actually formed.
You can download the complete simulation of above project by simply clicking on the image
given below:
Download Seven Segment Display Project Using 555 Timer

Seven Segment Display Using 555 Timer

First of all place all the components in your proteus workspace, as shown in the image given
below:

First of all 555 Timer is installed, after that a Shift Register is added. 555 Timer will give clock to
the Shift Register. Since we are using common cathode arrangement. So, the 7 input pin of SSD
are connected to the output pins of Shift Register and the common cathode pin is connected to
circuit’s main cathode. If you have placed all the components in their exact positions and all the
connections are OK. then, the resultant simulation will look like as shown in the image below:

Now if you look closely at the upper portion of the image then, you will notice that i have added
2 buttons in the circuit. Left Button in Button # 1 and Right Button is Button # 2.
If both the Buttons are kept open and when you will run the simulation then, numerical values
will start to come on seven segment display. you can also see it in the below image:

Now the switching of button # 1 includes a very interesting feature. First of all play the
simulation and Digits will start to run on Seven Segment Display and at any stage when you will
press Button # 1 then Seven segment display will vanish but counting will keep on going in the
back. And when you will open the Button#1 again then it will show that digit, up-to which
counting have reached. Below is a very interesting feature included:

During State#1 when Seven Segment Display was showing digit no.2 , we pressed button#1 then,
display vanished which can be seen in the state#2. After that when we re-opened the switch#1
then, Seven segment display didn’t show the digit no.3 but it shows digit # 8. and this thing can
be seen at state#3.
Now moving forward, the function of switch # 2 is very simple and easy. During simulation
running, when we will press the Button # 2 at any instant then, display will immediately stop at
that point. So, we can say that this project can also be used as stop watch and button # 2
controls the stop watch. It can also be seen in the image below:

Seven Segments Displays have a large no of applications. Some of them are listed below:
1. Digital Clocks.
2. Electronic Meters.
3. Basic Calculators.
4. Electronic Devices to Display Numerical Values. (Generally 14-segments or 16-segments
display is used to display full alphanumeric values).

LED Blinking using 555 Timer


I am going to share my new tutorial which is
Sequential LED Blinking Using 555 Timer in
Proteus ISIS. If you recall our one of previous
tutorials, which was ‘Multiple LED Flashing
Project Using 555 Timer in Proteus ISIS’, but in
today’s tutorial we are going to take the same
concept to a next level and we are going to
make the LEDs blink in either ascending or
descending order.
It is a very simple tutorial like the previous one, but the only change is, in this project we have
added a Shift Register (4017) next to 555 Timer. 4017 is a Serial IN Parallel OUT Shift Register,
which means, at input port it takes data in Serial manner and at output port it will give data in
Parallel manner. All types of register needs a clock pulse to operate and this clock is provided by
Timers or Micro controllers. In this project we will be using 555 Timer to generate clock pulse.
555 Times gives clock pulse at pin # 3 abbreviated as ‘Q’ pin. And this clock pulse is given at pin #
14 of Shift Register abbreviated as ‘CLK’ pin. Shift Register (4017) has total 15 pins. 2 input pins,
10 output pins. Input data is given at pin # 13, which is called ‘Enable’ pin and register shifts the
data sequentially at its output pins. Shift register has 10 output pins which means it is a 10-bit
shift register, which means it executes 10-bit data simultaneously. Now dear friends, let’s move
towards the hardware of the project but as you know, practice makes a man perfect. Try to do it
with your own hand so that, you get to know the practical applications of electrical components
in person.
Dear friends, you can also Download the complete simulation of the Sequential LED Blinking
Project using 555 Timer, by pressing on the button given below. So, let’s get started with
Sequential LED Blinking using 555 Timer in Proteus ISIS.
Download Sequential LED Blinking Project Using 555 Timer

Sequential LED Blinking using 555 Timer in Proteus ISIS

We are going to design a Project named LED Blinking using 555 Timer so let’s first have a look at
its block diagram.
Threshold voltage for 555 Timer is 5 volts, and when voltages exceeds this level, 555 timer
triggers and it generates a output pulse at its output pin which is ‘Q’ pin.
While designing the circuit, first of all 555 Timer will come, secondly Shift Register (4017) will be
connected with it and at the end we will plug LED’s. The complete circuit flow diagram is shown
in figure below:

Now coming towards the designing of the project, first of all, place the components in your
Proteus workspace, as shown below in image:
Now Output pulse from 555 Timer is connected to input ‘CLK’ pin of Shift Register.
Since the register being used is 10-bit, and its outputs are Q0~Q9. The pins Q0~Q5 are connected
to LED’s D6~D1 respectively.
After that Register output pin Q6 is also connected to LED (D2) and it becomes parallel with Q4.
Now LED, (D2) has 2 parallel inputs and it becomes HIGH (turns ON) if any of the two Inputs is
HIGH.
Next we connect the Register output pin Q7 to LED (D3) and then it becomes in parallel with Q3.
After doing that LED, (D3) has 2 parallel inputs and it becomes HIGH, if any of the 2 inputs is
HIGH.
After doing that, now we connect register’s output pin (Q8) to LED (D4) and then it also becomes
in parallel with Q2, and LED will start glowing if any of the 2 inputs will be HIGH.
Now at the end, we connect Q9 to LED (D5), and then it becomes in parallel with Q1. Now D5 has
2 inputs (Q9 &Q1) and LED will glow if any of the 2 inputs will be HIGH.
Now at the end, If you have connected all the components in exact order, and all the
connections are OK then, the exact simulation will look like as shown below:
Now if we run the Proteus simulation and observe it closely, then we will see that, 555 Timer is
continuously generating PWM and the Shift Register set’s its output ports HIGH from Q0~Q9
respectively.
First of all Register’s output pin # Q0 becomes HIGH and it send signal to LED (D6) and LED will
start glowing. You can also observe this phenomenon in the image given below:

Then pin # Q1 becomes HIGH and it send signal to LED (D5) and D5 starts glowing. This can be
observed in the figure given below:

Then register’s output pin Q2 becomes HIGH and sends signal to LED (D4) and D4 starts glowing.
This can also be observed in the figure given below:
Then Register’s output pin Q3 becomes HIGH and send signal to LED (D3) and this LED starts
glowing. This stage can be seen in the figure given below:

Then Register’s pin Q4 becomes HIGH and sends signal to LED (D2) and this LED (D2) starts
glowing. This process is shown in the image given below:
And in the next step, Register gets its pin # Q5 HIGH and send signal to LED (D1) starts to glow.
This process can be seen in this figure:

This process keeps on going and when the Register;s next pin becomes HIGH, which is Q6, then it
again sends signal to LED (D2) and it starts to glow, and so D3,D4,D5 will glow respectively, and
this sequence of LED’s blinking will continue, until you stop it manually or by yourself.
In the beginning, when LED’s Started to blink from Left to Right which was (D6 to D1) , this
sequence is called Forward Sequence.
After that, LED’s started to blink from Right to Left which was (D1 to D6), this sequence is called
Reverse or Backward Sequence.
We can summarize this whole sequence into a tabular shape, and this table is given in the figure
below:
This process keeps on going and LED’s keeps on glowing in a beautiful sequence. These type of
projects are generally used for decoration purposes.

So, that’s all about Sequential LED Blinking Using 555 timer.
Alright friends, that’s all from this post. I hope now you can easily design LED Blinking using 555
timer Project.

Angle Control of Servo Motor using 555 Timer


Today we are going to share our new project’s
tutorial which is Angle Control of Servo Motor
using 555 Timer in Proteus ISIS. It is a very simple
but a bit technical project. This project has various
applications both in industry and in small
educational projects.
Servo motor is a DC operated motor and it is
available in various sizes and powers. Generally the
servo motor used in basic projects, is named as
micro servo motor. It is of small size and low power
rating. But as I stated earlier that it needs dc supply to operate but it also needs a continuous
pulse train to operate and this pulse is commonly generated by some sort of timers or micro
controllers. Since my today’s project tutorial (Angle Control of Servo Motor using 555 Timer in
Proteus ISIS) is of basic level so, we will be using 555 timer to generate the continuous pulse
train or PWM. Now let’s move towards hardware but dear friends, always remember that to
become a technical person, you must have to perform technical work by yourself.

Angle Control of Servo Motor using 555 Timer in Proteus ISIS

First of all, place the components in your Proteus workspace, as shown below in image.
A 555 timer is an 8 pin IC. Pin # 6 is called threshold pin and for 555 timer threshold level is 5
volts.
So, 555 timer will trigger above 5 volts and it will generate output which can be collected from
pin # 3 represented as ‘Q’ which is output pin of 555 timer.
After that the output pulse is sent to servo motor through a Transistor which is BC547.
BC547 is basically a NPN transistor and the pulse signal is sent to servo motor through its
Emitter.
The full angle deflection of servo motor is from -180 degrees to +180 degrees. It can’t rotate
through full 360 degrees. Now it’s your own choice that either you want to rotate the motor at
one particular angle or at multiple angles or to get full rotation.
Since in this tutorial (Angle Control of Servo Motor using 555 Timer), we are going to get full
deflection of motor so, we have inserted 2 switches in the circuit. The complete circuit will look
like:
Switch # 1 will rotate the servo motor to 180 degrees in anti-clockwise direction. We will press
the button only once and when the motor completes its rotation, it will automatically stop.
After that if we press the switch # 2, then it will rotate the servo motor in clockwise direction and
again after completing the angle, motor will again stop.
If you have connected the components in correct order and when you will run it, the exact
simulation will look like as shown:

Sonow, if you have a close look on the above two iages then you can see in theState # 1 image I
have pressed the left button and the servo motor is moved to -90 degree, this -90 is also
mentioned in the green LEDbox just below servo motor.
And in State # 2, I have pressed the right button and thus the motor is moved to +90 degrees.
That’s how it will work.
You can Download the simulation of Angle Control of Servo Motor Project Using 555 Timer in
Proteus ISIS, by clicking on below button:
Download Angle Control of Servo Motor Project using 555 Timer
LED Dimming Project Using 555 Timer in Proteus
In today’s tutorial we are gonna see how to design
a LED Dimming Project using 555 Timer in Proteus
ISIS. In our previous tutorials we have seen how to
design Multiple LED Flasher Project using 555 Timer
in Proteus ISIS and also Single and Double LED
Flasher Project using 555 Timer in Proteus ISIS, in
which we have seen how to flash Single and
Multiple LED’s using 555 Timer in Proteus ISIS. In
today’s post i am gonna extend the same concept
and we will see how to design a LED Dimming
Project Using 555 Timer in Proteus ISIS.
It is a quick and very simple tutorial and it elaborates how to control the Intensity of LED using
555 Timer in Proteus ISIS. It’s a very simple project and the complete project is given at the end
for download but again as i always say try to design it by yourself so that you get some
knowledge out of it. It’s a very simple project and these type of projects are designed by
Engineering students in their First semester and are really a good start in learning electronics. If
you have any queries regarding this project then feel free to ask and i will try me best to resolve
them. So, let’s get started with implementation of LED Dimming Project using 555 Timer in
Proteus ISIS.

LED Dimming Project Using 555 Timer in Proteus ISIS

555 timer is a well known IC used in timing Projects and it is the most widely used IC before
micro controllers.
In our previous projects we have seen how to flash a single or multiple LED’s but today we are
going one step ahead and we are gonna learn How to Control the Intensity of LED using 555
timer in Proteus ISIS.
So. first of all, open your Proteus software and include the below components into its work
space.

After adding these components, now we need to design the circuit diagram.
So, design a circuit diagram of LED Dimming Project using 555 Timer as shown below:

If you look closely at the project then you will see that it is similar to one of our project titled
Sequential LED Blinking Project with 555 Timer in Proteus ISIS.
In this project we will control the intensity of LED through 555 timer.
These kind of projects are also used for Decoration purpose and the beauty of this system is that
we can change the Dimming rate of LED and we can control it our self.
Now we are done with the Designing of the project and let’s run its Proteus simulation.
When you run the Proteus simulation and if everything is alright then the LED pattern will be like:

The above figure shown the three states of the project.


State # 1 shows the OFF state of LED, State # 2 shows that LED has started to glow and State # 3
shows that LED is glowing with full intensity.
After that the loop starts again from State #1 to State # 3, unless you keep running the Proteus
Simulation.
You can download the simulation of LED Dimming project using 555 Timer by clicking on below
button:
Download Project Simulation

PCB Designing in Proteus ARES


Hello friends, today’s the last post
of this Proteus tutorial. I have tried
my best to explain everything but
knowledge is limitless so explore
this software, play with it and you
will know many new things. Today’s
topic is about the PCB designing in
Proteus. When you install Proteus,
you have seen that along with ISIS
there’s also another package
named as Proteus ARES. This
Proteus ARES is used for PCB
designing. You should also check
the Arduino UNO PCB Design for
Proteus ARES.
In order to design the PCB in Proteus ARES, first you need to make the circuit of that PCB in
Proteus ISIS. You can also make PCB directly but I recommend that use Proteus ISIS first, its quite
the easy approach as you don’t need to do anything in it and the software intelligence helps you
throughout the designing. Here’s the list of Top 10 PCB Design Software. So let’s get started with
PCB Designing in Proteus ARES:

PCB Designing in Proteus ARES

As in this tutorial, I just want to give you an idea of How to design PCB that’s why I haven’t taken
difficult circuit, just a simple PIC basic circuit.
First design your circuit in Proteus ISIS as shown in below figure:
Components Used:
These components are used while designing this simulation:

 PIC16F877a.
 Resistors. ( We need 1 resistor of 10k ohm )
 Capacitors. ( We need 2 capacitors of 33pF )
 Crystal Oscillator. ( 16MHz )

Working Principle:
After you got sure that your circuit is perfect and ready for designing, then click on the Tools and
then Netlist to ARES as shown below:
After clicking, Proteus ARES will be opened.
Now in Proteus ARES, select the block option from left toolbar and also make sure that you
selected Board Edge in the below drop down menu as shown in below figure:

Now make a rectangular block in the workspace, this block is actually the boundary of your PCB.
You can set its proper dimensions and can also re-size it manually using the mouse.
Now select the component option from the left toolbar, it will show all the components used in
your circuit.

Place all these components in the workspace one by one as shown below. These green lines
shown in the below image is actually the software intelligence.
Using the circuit, it gives us the routes automatically and we don’t need to panic any more just
need to follow these routes, if we are doing manually routing.
Now there are two ways of adding routing, first method is auto routing.
To do auto routing, click on Tools and then Auto Router and a property box will open where you
can set many different option for routing like the width of route and the PCB layers etc.
After selecting your properties just click on Begin Routing.

And then a magic will start and you PCB will become ready as shown in below figure:
Second method is manual routing, you can do manual routing by clicking the edges just like we
connect wires in Proteus ISIS. For manual routing select the option shown in below figure and
start routing.
Arduino UNO PCB Design for Proteus ARES

Hello friends, hope you all are fine and having fun with your lives. Today’s post, as the name
suggests, is about Arduino UNO PCB Design in Proteus ARES. I have already posted Arduino
Library for Proteus on my blog using which one can quite easily run Arduino simulation in
Proteus.but what if you wanna do the Arduino UNO PCB design in Proteus, then you are lucky
that you are reading this post. 🙂

In one of my projects, I have to design the PCB for Arduino in Proteus so I thought to also post it
here so that others can download it as well. Normally PCB design is not required for Arduino and
I usually get Atmega328 out of Arduino and use it separately but sometimes, depending on the
requirements of your project, you may also need to place Arduino itself on the PCB so in such
cases Arduino UNO PCB Design is required. Using this design you can place the Arduino on the
PCB in upside down direction and then can take pins out and can use them as you want them to
use. You should also have a look at How to do PCB Designing in Proteus ARES.

Let me give you a little introduction about Proteus ARES as I haven’t posted much tutorials on it.
When you install Proteus software in your computer then you get two exe files one is named as
Proteus ISIS while the other one is named as Proteus ARES. If you need to test some electronic
circuit i.e. need to design the simulation then you use Proteus ISIS and when you need to design
the PCB design then its done in Proteus ARES. As here we are talking about the Arduino UNO PCB
design so that’s why we are using Proteus ARES. Here’s the list of Top 10 PCB Design software.
So, let’s get started with it.
Arduino UNO PCB Design for Proteus ARES

First of all, download this Arduino UNO PCB design, which I have designed in Proteus ARES.
[dt_button size=”medium” style=”default” animation=”none” color_mode=”default” icon=””
icon_align=”left” color=””
link=”https://www.theengineeringprojects.com/Examples/ArduinoPCBDesign.rar”
target_blank=”true”]Arduino UNO PCB for Proteus ARES[/dt_button]

Once downloaded, then open the file and unrar it on your desktop.
Now double click the file to open it, make sure you already installed the Proteus software.
When you open it, it will look something as shown in below figure:

Now select the whole PCB design, right click it and select Make package as shown in below
figure:
When you click on Make Package, a new pop up window will open up, as shown in below figure:
Now in the New Package Name, you can give any name to it, as I have given Arduino Shield to it
and can select any Package Category.
After selecting these options, hit the OK button and this Arduino UNO PCB design will save in
your Proteus ARES library as the name you gave it. Like mine is saved as Arduino shield.
Now whenever you wanna use it, you simply need to search for it and it will come up.
You can also attach it to your Arduino package in Proteus ISIS so that you simply design the
circuit in Proteus ISIS and then design the PCB in Proteus ARES. That’s it.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy