PCB Designing in Proteus ARES
Hello friends, today's the last post of this Proteus tutorial. I have tried my best to explain everything but knowledge is limitless so explore this software, play with it and you will know many new things. Today's topic is about the PCB designing in Proteus. When you install Proteus, you have seen that along with ISIS there's also another package named as Proteus ARES. This Proteus ARES is used for PCB designing. You should also check the Arduino UNO PCB Design for Proteus ARES.
In order to design the PCB in Proteus ARES, first you need to make the circuit of that PCB in Proteus ISIS. You can also make PCB directly but I recommend that use Proteus ISIS first, its quite the easy approach as you don't need to do anything in it and the software intelligence helps you throughout the designing. Here's the list of Top 10 PCB Design Software. So let's get started with PCB Designing in Proteus ARES:
PCB Designing in Proteus ARES
- As in this tutorial, I just want to give you an idea of How to design PCB that's why I haven't taken difficult circuit, just a simple PIC basic circuit.
- First design your circuit in Proteus ISIS as shown in below figure:
Components Used:
These components are used while designing this simulation:
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 route, 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.
That's it. I don't think its much difficult. I am gonna stop this tutorial here. I have tried my best to share my knowledge about Proteus. IF you guys having any problem in part of this tutorial, feel free to contact me. Take care.
Component Designing in Proteus ISIS
Hello friends, hope you all are having fun in your life.
Today's tutorial is about the component designing in Proteus ISIS. This tutorial actually deals with the presentation of your project. Usually when students give presentation of their projects, then it is asked that add the circuit diagram of their project. Now when students open Proteus in order to design their circuit, they found out that the components they have used in their project are not available in the Proteus Directory. Now what to do ?
In that case, there's a need to design your own component in Proteus and place it in the circuit. Although, this new designed component won't work as the real component but for presenting the circuit, it will be enough. ofr example, we don't have Arduino boards in Proteus software. so, I have designed some of the Arduino baords myself for Proteus which you can download from
Arduino Library for Proteus.
Similarly, it usually happens to me during my freelancing work to design some circuit and when I don't find the required component in the Proteus library then I simply design it on my own and then create its PCB. We will check the PCB designing of such components in the coming posts of this tutorial. So, now let's get started with component designing in Proteus ISIS.
Component Designing in Proteus ISIS
- Now I am going to design a simple component having 4 pins.
- First of all select the 2D Graphics Box Mode as shown in the below figure.
- Now click on the workspace and drag the cursor to create a box, as shown in the below figure.
- We have created the body of our component, now there's a need to add pins in it.
- For this, click on the Device Pins Mode as shown in the below figure and click on the workspace.
- It will add a small pin, attach this pin with the box as I did in the below figure.
Note:
- The pin has a small green bubble on it. Make sure that this end is not connected with the box as this bubble end is for the wire.
- I have added four pins with the box. Now there's a need to name these pins. For this purpose, double click any of the attached pin and the properties box will open up as shown in the below figure.
- Mention the Pin Name and the Default Pin Number, it will appear on the component and then click on Next.
- When you click Next, it will ask for the same things for the second pin and so on.
- When you fill these 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.
That's all for today. If you have any questions regarding this tutorial, ask in comments and I will reply them. Take care.
Servo Motor Control with PIC Microcontroller
Hello friends, hope you all are healthy, wealthy and wise.
First of all, I am quite sorry about not posting for a long time, actually the load of work has really increased and I don't even have time to comb my hair.
Secondly, I have a really great news for you guys and the news is we have officially set up our office. Now, we will be more professional than ever and will respond to your queries quite fast now. I will update the photos of my new office soon INSHAHLLAH.
Let's come back to our topic. Previously, I have discussed the DC Motor control in Proteus ISIS and Stepper Motor Control in Proteus ISIS. So, now we are left with only one motor which is Servo Motor. Today's topic, as the name suggests is about the Servo Motor Control using PIC Microcontroller. The microcontroller, I am going to use in this tutorial is PIC16F877A. In this tutorial, I will design a circuit for Servo Motor Control and will also provide the code, which I have used for Servo Motor Control. If you are working on a Servo motor then you should also check Control Servo Motor with Arduino. in which I have design a servo motor control circuit using Arduino board. The code is also given there. Moreover, you should also check Angle control of Servo Motor with 555 Timer.
A Brief Intro About Servo Motor
- Servo motor is simply another motor having a much better control system already installed in it.
- The beaut of servo lies in its precise angular movement. In other words, you can move the motor at any angle you want. Like I want to move the motor to 30 degrees then I can do it quite easily in servo, which is not possible in DC or stepper.
- Moreover, it has just 3 wires to control, one is GND, one is Vcc and the third one which is usually the middle one is for controlling purposes.
- Now when you apply signal to the middle one, it starts moving. Now, how much it will move depends on the length of signal applied. If the signal applied is small, it will cover small distance.
Servo Motor Control Circuit in Proteus ISIS
- First of all select the below components from the Proteus library and add it in your workspace.
Components Used:
These components are used while designing this simulation:
- PIC16F877a.
- Servo Motor.
- Crystal Oscillator. ( 16MHz )
- Resistors. ( We need 3 resistors of 10k ohm )
- Capacitors. ( We need 2 capacitors of 33pF )
- Two Push Buttons.
Working Principle:
- Now, design your circuit as shown in the below figure:
- When I started this simulation the motor moved to the -90 degree angle. Now when I press the button, it will move in the opposite direction.
- That's how it works. Just a simple motor nothing much complicated.
PIC Microcontroller Code for Servo Motor Control
- Here's the code which I have used for controlling this servo motor. Burn this code in your PIC Microcontroller.
#define M1 PORTB.F7
#define M2 PORTB.F6
#define B1 PORTD.F0
#define B2 PORTD.F1
int a;
void main() {
TRISB=0;
TRISD=0xFF;
PORTB = 0;
a = 1;
while(1){
if((B1 == 0) && (a==1)){
PortB=0xFF;
delay_ms(100);
PortB=0x00;
delay_ms(1);
PortB=0xff;
a=0;
}
if(B2 == 0){
PortB=0x00;
}
}
}
Note:
- The code and the Proteus Simulation has already been emailed to all the subscribed members. If you are new here then subscribe to our newsletter and it will be emailed to you as well.
That's all for today. Hope I have helped you in some ways. In the next tutorial, we are gonna have a look at
Relay Simulation in Proteus ISIS. Till then, Take care, Stay Blessed.
Stepper Motor Drive Circuit in Proteus ISIS
Hello friends, hope you all are healthy, wealthy and wise. Today's topic is about the control of stepper motor. In the last post we have seen
How to control DC motor in Proteus, and now we are gonna see How to design a Stepper Motor Drive Circuit in Proteus ISIS. Stepper motors are usually of two types and the main difference between the two is in the number of wires used to control them. Mostly stepper motors use 6 wires to control them but few of them also have 4 wires to control them. Today we will have a look on the 6 wired stepper motor.
In stepper motor, there are electromagnets which gets polarized when we supply voltage to them and depolarized when we remove the voltage. These electromagnets act as a stater and when one side get magnetize, it attracts the rotor towards it and then we need to magnetize the other side and demagnetize the previous one and in this ways if the sequence is right the motor starts moving.
Stepper Motor Drive Circuit in Proteus ISIS
- First of all, add the below two components from the Proteus library in the workspace.
- Now design the circuit as shown in the below figure:
- This circuit is just for understanding purposes. Now I have added four states in the circuit, when I make any state one that stator got magnetize and the motor rotor will attract towards that stator and start moving.
- In the below series of images, I have shown the clockwise movement of motor.
- Now, as you can see from the above sequence of images, the motor is moving in the clockwise direction as I am supplying voltage in the clockwise direction.
- Now, if I reverse the order of applied voltage the motor will also reverse its direction and will move in the counter clockwise direction.
- The speed of the motor will depend on the speed of this sequenced voltages. If you apply these voltages with delay, the motor will move slow and if you apply them fast and continuously, the motor will rotate quite fast i.e. rpm of motor will increase.
Stepper Motor Control with Microcontroller
- Now, in order to control this motor using stepper motor, simply connect these wires with four pins of microcontroller and apply a sequenced voltage in programming and the motor will run quite smoothy.
- 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. So, we will meet in the next post hopefully. Take care.
DC Motor Drive Circuit in Proteus ISIS
Hello friends, hope you all are fine and enjoying good health. In the previous posts, we have seen How to
design a 5V DC power supply in Proteus ISIS and after that we have also discussed How to
design a variable DC Power supply using LM317.So, now today we will check how to design a DC Motor Drive Circuit in Proteus ISIS. DC motor is present in Proteus and quite easy to use. First we will simple drive it by applying voltage on its both sides i.e. direct method and after that we will automate it and will drive the circuit using PIC Microcontroller. The microcontroller I am gonna use will be PIC16F877A and the compiler will be MikroC Pro For PIC.
This tutorial is not a correct method of driving any DC motor. In this tutorial, I am just giving an overview of How to design a DC Motor Drive Circuit in Proteus ISIS so you can say this tutorial is more about DC motor in Proteus software. So, don't try it in hardware. DC motor is a simple motor which needs polarity difference at its two ends. IF this polarity is in forward direction then DC motor moves in one direction and if we reverse the polarity then the DC motor moves in the opposite direction. So, let's get started with DC Motor Drive Circuit in Proteus ISIS.
Simple DC Motor Drive Circuit in Proteus ISIS
- First of all I will show you the simple control of DC Motor in Proteus so that you get an idea how this motor works.
- Add these two components from the Proteus library:
- Motor
- 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 these logic. So, their will be total four states:
- When both states are at 0, motor will not move and remain stationary.
- When both states are at 1, still the motor will not move and remain stationary.
- The motor will move Clockwise when upper state is at 1 and lower at 0.
- The motor will move Anti-Clockwise when upper state is at 0 and lower at 1.
DC Motor Drive Circuit Using PIC Microcontroller
- Now we will drive our motor using PIC Microcontroller, add below components from the Proteus library.
- Join these components and make a circuit as shown in the below figure:
- Now create a new project in the MikroC Pro For PIC and add the below code into it.
/* Code provided by www.TheEngineeringProjects.com */
#define M1 PORTB.F7
#define M2 PORTB.F6
#define B1 PORTD.F0
#define B2 PORTD.F1
void main() {
TRISB=0;
TRISD=0xFF;
PORTB = 0;
while(1){
if(B1 == 0){PortB=0xAA;}
if(B2 == 0){PortB=0x55;}
}
}
- Now burn the hex file of this project in the microcontroller of the Proteus file.
- If everything goes well, then when you click one button the motor will move clockwise and when you click other button the motor will move anti-clockwise.
- I have also shown the simulation in the video below.
Video Tutorial
- A complete video demonstration of the above tutorial is as follows:
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.
How To Use Oscilloscope in Proteus ISIS
Hello friends, today I am going to post the next lecture of Proteus Tutorial. I am receiving quite a positive response about this Proteus tutorial. In the previous post, we have seen
How to use Virtual Terminal in Proteus and today I am going to explain How to use Oscilloscope in Proteus ISIS. This oscilloscope is just the same which you have seen in your electronic or electrical labs. Oscilloscope is basically used to monitor signals or waveforms. Particularly when you are not much aware of the circuit and you need a little debugging then you use oscilloscope.
In oscilloscopes, we can visualize the electrical properties of waveforms, like we can check whats the frequency of electrical signal, what's its voltage or current. Digital oscilloscopes have vast range of features in it like RMS value calculation etc. So, in short when you want to visualize or research your available signal then oscilloscope is the first and right most option for you. In today's tutorial, first of all, I am gonna design a simple Pure sine wave circuit and then we will visualize its properties using oscilloscope in Proteus ISIS.
Pure Sine Wave Circuit Design
- First of all, design a circuit as shown in the below figure.
- This circuit is a simple pure sine wave inverter which is inverting the DC Signal into AC signal.
- I have also encircled the components so first of all, find these components in the Proteus database and then design the circuit as shown in the figure. (Right click on the image and then open it in new tab to get the clear view).
- When I was designing my Pure Sine Wave Inverter Simulation in Proteus then I have to use oscilloscope quite a lot.
How to use Oscilloscope in Proteus ISIS ???
- Now in order to add the oscilloscope in the circuit, first click on the Virtual Instruments Mode as shown in the below figure.
- In that mode the first option will be the Oscilloscope which I highlighted as Click # 2 in the below figure.
- Now drag that oscilloscope and place it in the workspace, as you can see below this component has total four legs means you can view total four different types of signals using this oscilloscope and cal 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 represent 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.
Note:
- This Proteus file has been emailed to all the subscribed members, if someone needs it kindly Subscribe to our Newsletter and it will be emailed to you.
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 nad 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. :)
How To Use Virtual Terminal in Proteus ISIS
Hello everyone, I hope you all are doing great. In today's tutorial, we will have a look at How to use
Virtual Terminal in Proteus ISIS. It's our 5th tutorial in Proteus Series. I will first explain what is virtual terminal and then we will have a look at its uses and performance in Proteus ISIS.
Virtual Terminal is an important tool available in Proteus and it comes quite in handy while working on serial modules i.e. GSM, GPS, XBee etc. So, let's get started with Virtual Terminal in Proteus.
What is Virtual Terminal ?
Virtual Terminal is a tool in Proteus, which is used to view data coming from
Serial Port (DB9) and also used to send the data to Serial Port. In windows XP, there's a built in tool named
Hyper Terminal, which is also used for the same purpose but in windows 7 there's no such tool, so for windows 7 users this virtual terminal is quite a great comfort. If you guys don't know about serial port then I would suggest you to read this tutorial to get better idea of serial port:
I have posted many tutorials on my blog in which I have communicated over Serial port using different software. For example, you can check this
Serial communication in MATLAB and can also have a look at
Serial Communication in Visual Studio 2010. As serial communication is too common, so almost every microcontroller supports Serial communication. Arduino UNO has builtin single serial port at its pins 0 and 1, while Arduino Mega 2560 has built in four Serial ports in it. Similarly,
PIC Microcontroller also supports Serial port and it is also available in
8051 Microcontroller.
Uses of Virtual Terminal
Virtual Terminal in Proteus, as I explained above, is used to send or receive data to or from a serial port. Serial port is a 9 pin port which is mostly find on the computers and is used in
Embedded System Projects for data communication. Normally in student projects, data is sent from hardware to computer via serial port and then user design some application on their computer to view that data in some represent-able form.
Now, in projects there are some testing steps which are quite helpful, if we use them properly, and these testing steps require some tools in order to test the process. Like, suppose some student have designed the hardware to send the data to the computer and have also design its application to receive it and now when he tests it he didn't receive any data. At that point student got tensed and don't know where's the error so at that point there's may be some error in the hardware or may be in the software.
Now, in order to be sure he need to test both of them separately and here is the point where virtual terminal is used. First connect your hardware with the computer and then run the hardware and check whether you are receiving data on the virtual terminal or not. If you are receiving it, means your hardware is okay and the problem is in software side and if you are not means your hardware is not so good.
Whenever I start working on some projects, I always make sure that I am going in right direction like if I have to made this project then after completing my hardware, I will first check it via this virtual terminal and once I got sure that my hardware is okay then I will move to the software part. If you are gonna 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 wanna design some circuit in Proteus which involves serial port then you can add this terminal on your circuit and can test it before going to the hardware, which we will shortly see below. So, now let's get started with Virtual Terminal in Proteus.
How to Use Virtual Terminal in Proteus ISIS?
- First of all open the Proteus ISIS and click on the P button to search for the components, as we seen in previous tutorials.
- Now in the search box type "COMPIM" , when you search this a result will show up as shown in the below figure:
- After Selecting this, click OK to add this component in the database.
- COMPIM is the serial port in Proteus and using its properties we can assign any COM pin of our computer to it and it will behave like that pin. We will change the properties shortly.
- Now, click on the Virtual Instrument Mode and then on the Virtual Terminal as shown in the below figure and add it in the Proteus workspace.
- Now join the TXD pin of COMPIM with the TXD pin of Virtual Terminal and RXD with RXD as shown in the figure below:
- Now, double click on the COMPIM to open the Properties menu and set the properties as shown below:
- I have selected COM1 and my baud rate is 9600, you can set it whatever you want like if you are using the COM3 then set the port to COM3 and baud rate of your own choice.
- Similarly open the properties of the virtual terminal and make sure that the baud rate is same in both the cases.
- Now connect your hardware with the computer and play the simulation. Again make sure that the port which you have selected for the COMPIM is same port with which you have attached your hardware.
- After you play the simulation a black window will open up which will show the data coming from your hardware to the COM1 pin as shown below:
- This black box is actually the Virtual Terminal which is showing data coming from my hardware.
- If you play the simulation and this Virtual Terminal doesn't pop up then right click on the Virtual Terminal Component and then click on Virtual Terminal which will be at the end in the options and this black window will open up.
I think you guys have got much of the idea of this Virtual Terminal in Proteus ISIS. If you have any problem anywhere, ask in comments and also subscribe to our newsletter via email to get these amazing tutorials right into your mailbox. In the next tutorial, I have explained
How to use Oscilloscope in Proteus ISIS. Thanks, take care.
Knowing About Components Available in Proteus ISIS
Hello friends, hope you all are fine and enjoying good health. In this tutorial, my actual plan was to cover the mostly used components in Proteus like to give users an overview of component selection as there are many components in Proteus which are quite hidden and hence quite difficult to find. But, now I have changed my mind as I have received a lot of emails regarding this tutorial in which mostly have asked to elaborate this tutorial and explain other circuits as well just like the LCD one. So after that I thought of making separate tutorial for many different circuits.
These are the parts in which I have divided this tutorial and as you can see I have added the news topics as well which are requested by the readers. If you guys need any tutorial then let me know via
Contact Form, and I will try to post that as well.
So, now in this tutorial, we are gonna see different circuits designed in Proteus. I will explain them step by step so that the users get the better idea of them and also there are many different components in Proteus which are very handy but users mostly don't know about them and I will also explain them to you. I have divided this part of the tutorial into following different parts:
- How To Use Virtual Terminal in Proteus ISIS.
In this tutorial, I will design a simple serial port circuit and then get the data on the Virtual Terminal. Virtual Terminal is quite same as the Hyper Terminal in the windows XP. It shows the data coming from serial port and also sends the data to the serial port.
- How To use Oscilloscope in Proteus ISIS.
Oscilloscope is great functionality in Proteus and it works as same as the oscilloscope you have seen in your electronics lab. It shows waveforms and using it you can make variations in your model and can get the desired output.
- DC Motor Drive Circuit in Proteus ISIS.
In this tutorial, we will check the DC Motor circuit with microcontroller and will drive it.
- Stepper Motor Circuit in Proteus ISIS.
In this tutorial, we will check the Stepper Motor circuit with microcontroller and will drive it.
- Servo Motor Circuit Design in Proteus ISIS.
In this tutorial, we will check the Servo Motor circuit with microcontroller and will drive it.
- How to use Serial Registers in Proteus ISIS.
In this tutorial, we will use serial registers with microcontroller. Microcontrollers have limited I/O pins but what if you need 50 pins, which happens mostly in LEDs, then there's a need to increase the pins of microcontroller and for that purpose we use serial registers.
That's what I have planned so far, I may add few more tutorial in it depends on the suggestions os keep inform me with your suggestions. Thanks.
Circuit Designing of LCD with PIC
Hello friends, hope you all are fine and enjoying good health. Today I am posting the next part of Proteus tutorial which is Interfacing of LCD with PIC Microcontroller. . In the previous post of this tutorial, we have seen the basics of Proteus and discussed various functions of Proteus ISIS. If you are new to Proteus then I would recommend that before starting this tutorial, you should first read the first part so that you get the better idea of Proteus as I wont go in detail in today's post. Today, we will first design a circuit of LCD with PIC on Proteus ISIS which includes
PIC Microcontroller and then we will see how to burn the microcontroller in Proteus and at the end we will run our circuit and will display some text on the LCD. It will be quite a fun so let's start.
If anyone having any problem at any point, ask in comments and I will try my best to resolve them. So, let's get started with Interfacing of LCD with PIC Microcontroller.
Circuit Designing in Proteus
- First of all, open the Proteus ISIS software.
- In the start, it will look exactly the same as in below image.
- Now click on button P as shown in below figure.
- When you click this button a new window will pop up as shown in below figure.
- This is the place where we search our components, like as I want 7805 so I searched for this component and the Proteus has given me the related components.
- Once you get your desired component, simply double click on it and it will be added in your database so that you can use them.
- The below image shows the components which we are gonna use in this project, so simply search for all the components and then double click on them and finally you will get all the components as shown below:
- Now place these components in the Proteus workspace and connect them.
- Design exactly the same circuit as shown in the below figure for interfacing of LCD with PIC Microcontroller.
Now our circuit in
Proteus is ready to use, the next step is to write a code for the PIC Microcontroller 18F452 and then burn it into the Proteus and check its working.
Code of LCD with PIC18F452
- There are different compilers to write the code for PIC Microcontroller. Here I am using MikroC Pro for PIC. You can get it easily from the official site of MikroC.
- I am not going in the details of coding as its beyond the scope of this tutorial, but still I am posting the code.
- So now create a new project in the MikroC Pro For PIC and copy the below code and paste it in the project and compile.
- When you compile the project, it will create a .hex file in the same folder where you have saved this project. We will use this hex file shortly.
// LCD module connections
sbit LCD_RS at RD2_bit;
sbit LCD_EN at RD3_bit;
sbit LCD_D4 at RD4_bit;
sbit LCD_D5 at RD5_bit;
sbit LCD_D6 at RD6_bit;
sbit LCD_D7 at RD7_bit;
sbit LCD_RS_Direction at TRISD2_bit;
sbit LCD_EN_Direction at TRISD3_bit;
sbit LCD_D4_Direction at TRISD4_bit;
sbit LCD_D5_Direction at TRISD5_bit;
sbit LCD_D6_Direction at TRISD6_bit;
sbit LCD_D7_Direction at TRISD7_bit;
// End LCD module connections
char txt1[] = "www.TheEngineeri";
char txt2[] = "ngProjects.com";
char i; // Loop variable
void Move_Delay() { // Function used for text moving
Delay_ms(500); // You can change the moving speed here
}
void main(){
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CURSOR_OFF); // LCD Cursor Off
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Out(1,1,txt1); // Write text in first row
Lcd_Out(2,1,txt2); // Write text in second row
Delay_ms(2000);
while(1);
}
Burn the Code in PIC Microcontroller in Proteus ISIS
- Now we have the hex file, we need to burn this hex file in the microcontroller in Proteus.
- So, double click on the Microcontroller in Proteus and it will open up the properties menu of PIC microcontroller.
- Now click, as shown in the below figure, and browse for the hex file and click OK.
- We need to add this hex file in Proteus here and also select the oscillation frequency which I have selected 16MHz.
Note: Make sure that the oscillation frequency remain same both in the MikroC and the Proteus.
- After adding the file in the Proteus now click OK and play the simulation, ifeverything goes fine, you will get the results as shown in below image.
Note:
- Proteus ISIS simulation file and the .hex file has been emailed to all the subscribed members. If anyone need it, subscribe to our newsletter via email and it will be emailed to you as well.
That's all for today, I have tried my best to explain everything on
Interfacing of LCD with PIC Microcontroller, but still if someone having problem ask in comments and I will try to resolve. In the next part, we will discuss various components of Proteus which are commonly used like motors, serial port, hyper terminal etc. So stay tuned and also subscribe us via email so that you get all the tutorials straight into your mail box. Have fun. Take care.
Interfacing of EasyVR with Arduino
Hello friends, I hope you all are fine and having fun with your lives. In today's post we are gonna see Interfacing of EasyVR with Arduino UNO. In the previous post, we have seen Getting Started with EasyVR Commander. It was quite simple and if you follow the steps carefully you wont stuck anywhere but still if you into some trouble i am here.
Now this tutorial is quite a quick and important one as it contains the real code using which we will control our robot. After adding the voice commands, now close the EasyVR Commander and open the Arduino Software. Connect the arduino board with computer and double check that your jumper J12 in on position SW. You should also read
Training Error: Recognition Failed in EasyVR, if you got such error while working on EasyVR. So, let's get started with
Interfacing of EasyVR with Arduino UNO.
Interfacing of EasyVR with Arduino UNO
- First of all, download the Arduino Libraries for EasyVR Shield, you can easily find them from the official website of EasyVR.
- Simply connect your Arduino UNO with computer.
- Open the Arduino Software and copy paste the below code into it.
- Burn your code in the Arduino Board.
- Now open your Serial Monitor of ARduino UNO, and you will first see the message saying EasyVR Detected.
- Now speak any of the command you saved in the board on mic and you will see when the command match the serial terminal will send a specific character.
- You can change this character if you want to by make a simple change in the code.
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#include "SoftwareSerial.h"
SoftwareSerial port(12,13);
#else // Arduino 0022 - use modified NewSoftSerial
#include "WProgram.h"
#include "NewSoftSerial.h"
NewSoftSerial port(12,13);
#endif
#include "EasyVR.h"
EasyVR easyvr(port);
//Groups and Commands
enum Groups
{
//GROUP_0 = 0,
GROUP_1 = 1,
};
enum Group0
{
G0_ARDUINO = 0,
};
enum Group1
{
G1_FORWARD = 0,
G1_REVERSE = 1,
G1_LEFT = 2,
G1_RIGHT = 3,
G1_STOP = 4,
};
EasyVRBridge bridge;
int8_t group, idx;
void setup()
{
// bridge mode?
if (bridge.check())
{
cli();
bridge.loop(0, 1, 12, 13);
}
// run normally
Serial.begin(9600);
port.begin(9600);
if (!easyvr.detect())
{
Serial.println("EasyVR not detected!");
for (;;);
}
easyvr.setPinOutput(EasyVR::IO1, LOW);
Serial.println("EasyVR detected!");
easyvr.setTimeout(5);
easyvr.setLanguage(EasyVR::ENGLISH);
group = EasyVR::TRIGGER; //<-- start group (customize)
pinMode(2, OUTPUT);
digitalWrite(2, LOW); // set the LED off
pinMode(3, OUTPUT);
digitalWrite(3, LOW);
pinMode(4, OUTPUT);
digitalWrite(4, LOW);
pinMode(5, OUTPUT);
digitalWrite(5, LOW);
pinMode(6, OUTPUT);
digitalWrite(6, LOW);
}
void action();
void loop()
{
easyvr.setPinOutput(EasyVR::IO1, HIGH); // LED on (listening)
Serial.print("Say a command in Group");
Serial.println(group);
easyvr.recognizeCommand(group);
do
{
// can do some processing while waiting for a spoken command
}
while (!easyvr.hasFinished());
easyvr.setPinOutput(EasyVR::IO1, LOW); // LED off
idx = easyvr.getWord();
if (idx >= 0)
{
// built-in trigger (ROBOT)
// group = GROUP_X; <-- jump to another group X
return;
}
idx = easyvr.getCommand();
if (idx >= 0)
{
// print debug message
uint8_t train = 0;
char name[32];
Serial.print("Command: ");
Serial.print(idx);
if (easyvr.dumpCommand(group, idx, name, train))
{
Serial.print(" = ");
Serial.println(name);
}
else
Serial.println();
easyvr.playSound(0, EasyVR::VOL_FULL);
// perform some action
action();
}
else // errors or timeout
{
if (easyvr.isTimeout())
Serial.println("Timed out, try again...");
int16_t err = easyvr.getError();
if (err >= 0)
{
Serial.print("Error ");
Serial.println(err, HEX);
}
group = GROUP_1;
}
}
void action()
{
switch (group)
{
// case GROUP_0:
// switch (idx)
// {
// case G0_ARDUINO:
// write your action code here
// group = GROUP_1; //<-- or jump to another group X for composite commands
// break;
// }
// break;
case GROUP_1:
switch (idx)
{
case G1_FORWARD:
Serial.print("9");
digitalWrite(2, HIGH);
break;
case G1_REVERSE:
Serial.print("Q");
digitalWrite(3,HIGH);
break;
case G1_LEFT:
Serial.print("X");
digitalWrite(4,HIGH);
break;
case G1_RIGHT:
Serial.print("Y");
digitalWrite(5,HIGH);
break;
case G1_STOP:
Serial.print("Z");
digitalWrite(6,HIGH);
break;
}
break;
}
}
So, that's all for today. I hope now you can easily Interface
EasyVR with Arduino UNO. Have fun and take care !!! :)