pcbway

Display ADC value on LCD using PIC Microcontroller, ADC value on PIC Microcontroller, PIC ADC tutorial, PIC with ADC and LCd,PIC LCD ADCHello friends, hope you all are fine and having fun. In today’s post, we are gonna Display ADC value on LCD using PIC Microcontroller in Proteus ISIS. In the previous post, we have done exactly the same thing on Arduino, we have displayed ADC value on LCD using Arduino in Proteus ISIS. As I explained before, getting the value of ADC isn’t difficult but getting the value of voltage s the main thing. Suppose, you have applied 4.5V on the ADC pin then when you read ADC it will give something like 677 which is the 10 bit value, now there’s a need to convert this value into 4.5V to displayed on LCD. That’s what I am gonna in this post and will Display ADC value on LCD using PIC Microcontroller in Proteus ISIS.

I am using PIC16F877A and the compiler is MikroC Pro for PIC Microcontroller. I have simulate it in Proteus but have also tested it on hardware and it works perfectly fine. If you stilll got into any trouble then ask in comments and I will try my best to resolve them. So, let’s get started with How to Display ADC value on LCD using PIC Microcontroller in Proteus ISIS.

Display ADC value on LCD using PIC Microcontroller in Proteus ISIS

I have divided this project in few steps in which we will step by step do the implementation and at the end we will have the complete project in hand. So follow the steps carefully. I have also provided the download link from where you can download the complete simulation along with the hex file of PIC Microcontroller for this project How to Display ADC value on LCD using PIC Microcontroller in Proteus ISIS, but its better if you do it by yourself as it will help you in learning.

Step 1: Proteus Simulation for PIC & LCD
  • The circuit design used in this project is exactly the same as we done in the previous project Display ADC value on LCD using Arduino, but the only difference is that here I am using PIC Microcontroller instead of Arduino.
  • I have designed Current Transformer and Potential Transformer in this project just to get the analog values.
  • So, design a circuit in Proteus as shown in below figure:

Display ADC value on LCD using PIC Microcontroller, ADC value on PIC Microcontroller, PIC ADC tutorial, PIC with ADC and LCd,PIC LCD ADC

  • Here’s an additional thing done in this  design which is the supply section. In arduino, we don’t need the supply section as we can directly plug the Adapter into Arduino, but in PIC Microcontroller we need to convert the 12V into 5V which is then provided to PIC Microcontroller.
  • If you are using 5Vbattery then there’s no need to use supply section but normally you will find 12V adapters, its kind of standard so that’swhy I have converted 12V into 5V.
  • Another thing is the crystal oscillator used which is the basic circuit of PIC Microcontroller along with capacitors of 33pF.
  • You can download te Proteus Simulation along with hex file by clicking on below button:

Download Proteus Simulation for ADC diplay on LCD

Step 2: Code Designing in MikroC Pro For PIC
  • AS we have designed the cirucit diagram so next thing we need to do is to design the programming code for PIC Microcontroller.
  • There are many different compilers available online for PIC Microcontroller, I am using MikroC Pro for PIC here.
  • So, here’s the programming code you need to use for Displaying ADC value on LCD using PIC Microcontroller in Proteus ISIS:

 

  • The code is quite easy and self explanatory, I am using two functions here one is ShowADC() and the other one is ShowVoltage().
  • ShowADC() function will show the ADC value on LCD as it is while the ShowVoltage() function will convert this ADC value into voltage and then will display it over LCD.
  • I am not using ADC function anywhere in the code, but if you wanna use it then simply un-comment the line and comment the Show Voltage line and it will be displayed.
Step 3: Results
  • So, now we are done with designing of both circuit and programming for Displaying ADC value on LCD using PIC Microcontroller, so now let’s combine them.
  • Compile the PIC code and get the hex file from it.
  • Upload this hex file in Proteus Simulation, in order to upload simply double click PIC Microcontroller and open the properties window and browse to the address of hex file.
  • Now hit RUN button on Proteus and if everything goes fine then you will get following results:

Display ADC value on LCD using PIC Microcontroller, ADC value on PIC Microcontroller, PIC ADC tutorial, PIC with ADC and LCd,PIC LCD ADC

  • The first thing to see is the LED of power supply, which is now turned ON, means our supply section is working fine.
  • Now let’s have a closer look on the ADC values in the below figure:

Display ADC value on LCD using PIC Microcontroller, ADC value on PIC Microcontroller, PIC ADC tutorial, PIC with ADC and LCd,PIC LCD ADC

  • So, now we can see the LCD is displaying exactly the same values as are shown in the voltmeters. Now if you change the value of variable resistor RV1 and RV2 then the value of voltage and current will respectively change in LCD.

That’s all for today, in the coming post I will show how to display power on LCD. I hope now you can easily Display ADC value on LCD using PIC Microcontroller in Proteus ISIS. It was simple in case of Arduino as the values were in integer form but here if you have a closer look at  code then you can see we have converted the values into characters and then displayed them on LCD. So, we will cover it in next post. Till then take care. 🙂

5 Comments

  1. Kindly provide me with schematic and code for Sinewave inverter, the code should include ON/OFF, OVERLOAD, and LOWbattery. Thanks

  2. If i want to display power (P=V*I) then how to do it in the above code? i am able to display temperature. But i am not able to display power . Please help

  3. please guide me about the LCD value which you mentioned in the above paragraph whats this value (677) in lcd? and in which base it gives us 677 value when we applied 4.5v.

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment