Complete Guide On Proteus ISIS
Complete Guide On Proteus ISIS
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.
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
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.
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:
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.
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.
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!!!
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:
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.
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.
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:
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.
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.
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.
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
5 TinyCAD
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.
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:
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.
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.
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.
First of all, add the below two components from the Proteus library in the workspace.
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 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.
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.
#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.
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.
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.
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.
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.
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.
If you haven’t bought your Arduino UNO yet, then you can buy it from this reliable source:
Buy Arduino UNO
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.
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.
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.
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:
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.
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.
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.
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:
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.
Note: for hardware implementation of Ultrasonic Sensor with Arduino, check below posts:
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.
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;
}
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 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.
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.
#define pirPin 2
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)
{
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.
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:
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.
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.
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 UNO
Arduino UNO SMD
Arduino Mega
Arduino Nano
Arduino Lilypad
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.
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 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);
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
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:
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.
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.
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.
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
You can get the explanation and latest version of this library at:
http://www.TheEngineeringProjects.com/
*/
#include “SevenSegment.h”
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.
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:
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.
#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");
}
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.
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.
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.
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.
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:
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.
You can quite easily understand the above figure, where I have shown both the ON and OFF
states of buzzer.
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:
#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);
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.
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.
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.
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;
}
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.
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:
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);
}
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.
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>
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;
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.
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:
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.
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_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.
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.
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:
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>
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.
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.
Delay_ms(2000);
while(1);
}
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.
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.
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();
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();
}
}
}
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();
} while(1);
}
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.
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.
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.
#include<reg51.h>
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.
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>
void SerialInitialize(void);
void SendByteSerially(unsigned char);
void cct_init(void);
void main()
{
cct_init();
SerialInitialize();
EA = 1;
ES = 1;
while(1) {;}
}
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;
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
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);
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
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
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
}
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.
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
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
// ***********************************************************
// Main program
//
int main(void)
{
char key; // key char for keeping record of pressed key
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
}
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.
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
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
// ***********************************************************
// 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
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
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
}
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 '/'; }
if( chf!='+' && chf!='-' && chf!='x' && chf!='/' ) //if input is not from allowed funtions
then show error
{
DispError(1);
WebsiteLogo();
return 'e';
}
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.
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.
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.
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);
}
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
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.
First of all, get these components from Proteus components list as shown in below figure:
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
#define ONE_WIRE_BUS 6
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
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.
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
delay(1000);
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
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.
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..
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.
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.
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
Button
Proximity
Switch
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.
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);
}
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
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
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
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
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.
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:
First of all place all the components in your proteus workspace,as shown in the image 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.
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.
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
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).
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.
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.
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:
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.