Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to build a voltmeter using Pic16f887?

Status
Not open for further replies.

lacoste

Newbie level 1
Joined
Dec 26, 2009
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,333
Are there any examples, links, posts, or other information I can follow to build a voltmeter (5 volts, simple) circuit by using a pic16f887? The result is to be displayed on an ldc......
 

Re: Volt Meter Pic16f887

to measure 5v via pic16887 u don't need such a hardware
just u need to connect an LCD to µc & use pic ADC for measuring 5v thatz it
 
Volt Meter Pic16f887

you will also have to perform the conversion (scaling) inside the Pic and then display it, and ur scaling depends upon ur reference voltages at the Pic
 

Re: Volt Meter Pic16f887

engr_najam said:
you will also have to perform the conversion (scaling) inside the Pic and then display it, and ur scaling depends upon ur reference voltages at the Pic
can u give me exp.it perform the conversion (scaling) inside the Pic and then display it, and ur scaling depends upon ur reference voltages at the Pic16f676.
 

Volt Meter Pic16f887

yah u r rite, the scaling factor depends upon the reference voltages.
suppose ur reference voltages are 0 - 5 volts, then ur decimal output from the adc will be
0 for 0 volts and 1024 for 5 volts in the case of 10 bit adc converter.
any for any other decimal value of adc just multiply it by the scaling factor (5/1024)*decimal value.
now this is the value to be sent the LCD or any other ...
 

Re: Volt Meter Pic16f887

engr_najam said:
suppose ur reference voltages are 0 - 5 volts

what do u mean by reference voltages 0 - 5 volts?? reference voltage is just a single value.
Can u plzz elaborate it ?
 

Re: Volt Meter Pic16f887

suppose if i get a decimal valve = 50 then
5/1024x50 = 0.244

how i gonna display it on LCD
engr_najam plzzz help me
 

Volt Meter Pic16f887

@hameeds01: in the case of Pic we have the choice to keep reference voltages of our own on specified pins on the controller using i thing ADCON1 and ADCON2 registers. and then u can set the reference voltages e.g. 0 and 1 volts between which the signal will converted etc 0 volt mean 0 decimal value and 1 volt mean 1024 decimal value. for negative values u hav to check their data sheet.

@FMradio: In my case i am using Proton IDE which is very simple, just set the data and enable pin and and using print command send itself it to the LCD. it uses Basic language. I think i hav to send to its code if you need it.
 

Re: Volt Meter Pic16f887

Hi lacoste,

I present here a simple voltmeter with 16F887 (0-5v scale). But mind it, this is very basic with no input overvoltage protection. A voltage greater than 5v applied to the input will destroy the 16F887.

Source code (written in mikroBasic):
Code:
program softwarefor887Voltmeter

dim LCD_RS as sbit at RB4_bit
    LCD_EN as sbit at RB5_bit
    LCD_D4 as sbit at RB0_bit
    LCD_D5 as sbit at RB1_bit
    LCD_D6 as sbit at RB2_bit
    LCD_D7 as sbit at RB3_bit

    LCD_RS_Direction as sbit at TRISB4_bit
    LCD_EN_Direction as sbit at TRISB5_bit
    LCD_D4_Direction as sbit at TRISB0_bit
    LCD_D5_Direction as sbit at TRISB1_bit
    LCD_D6_Direction as sbit at TRISB2_bit
    LCD_D7_Direction as sbit at TRISB3_bit

dim ADCResult as longword
dim voltage as word[5]
dim display as string[5]

sub procedure GlobInit
    ANSEL = 1
    ANSELH = 0
    TRISA = 1
    TRISB = 0
    PORTB = 0
    LCD_Init()
    LCD_Cmd(_LCD_CLEAR)
    LCD_Cmd(_LCD_CURSOR_OFF)
    LCD_Out(1, 1, "Voltage:")
    LCD_Chr(1, 16, "V")
    display[1] = "."

end sub

main:
     GlobInit
     while true
           ADCResult = (ADC_Read(0) * 500) >> 10
           voltage[0] = ADCResult div 100
           voltage[1] = (ADCResult div 10) mod 10
           voltage[2] = ADCResult mod 10
           display[0] = voltage[0] + 48
           display[2] = voltage[1] + 48
           display[3] = voltage[2] + 48
     vout:
           LCD_Out(1, 10, display)
           delay_ms(50)
     wend
end.
 

Re: Volt Meter Pic16f887

Tahmid said:
Hi lacoste,

I present here a simple voltmeter with 16F887 (0-5v scale). But mind it, this is very basic with no input overvoltage protection. A voltage greater than 5v applied to the input will destroy the 16F887.

Source code (written in mikroBasic):
Code:
program softwarefor887Voltmeter

dim LCD_RS as sbit at RB4_bit
    LCD_EN as sbit at RB5_bit
    LCD_D4 as sbit at RB0_bit
    LCD_D5 as sbit at RB1_bit
    LCD_D6 as sbit at RB2_bit
    LCD_D7 as sbit at RB3_bit

    LCD_RS_Direction as sbit at TRISB4_bit
    LCD_EN_Direction as sbit at TRISB5_bit
    LCD_D4_Direction as sbit at TRISB0_bit
    LCD_D5_Direction as sbit at TRISB1_bit
    LCD_D6_Direction as sbit at TRISB2_bit
    LCD_D7_Direction as sbit at TRISB3_bit

dim ADCResult as longword
dim voltage as word[5]
dim display as string[5]

sub procedure GlobInit
    ANSEL = 1
    ANSELH = 0
    TRISA = 1
    TRISB = 0
    PORTB = 0
    LCD_Init()
    LCD_Cmd(_LCD_CLEAR)
    LCD_Cmd(_LCD_CURSOR_OFF)
    LCD_Out(1, 1, "Voltage:")
    LCD_Chr(1, 16, "V")
    display[1] = "."

end sub

main:
     GlobInit
     while true
           ADCResult = (ADC_Read(0) * 500) >> 10
           voltage[0] = ADCResult div 100
           voltage[1] = (ADCResult div 10) mod 10
           voltage[2] = ADCResult mod 10
           display[0] = voltage[0] + 48
           display[2] = voltage[1] + 48
           display[3] = voltage[2] + 48
     vout:
           LCD_Out(1, 10, display)
           delay_ms(50)
     wend
end.

can u give me the ASM FILE [Source code].pic 16f676 volt meter 7 segment display , it i\p rang 0-500 volt AC. . not cool circuit .com
 

Volt Meter Pic16f887

Hi sahu,
I wrote the program in mikroBASIC and so don't have any ASM file except the one generated by mikroBASIC which isn't of much help.
 

Re: Volt Meter Pic16f887

Tahmid said:
Hi sahu,
I wrote the program in mikroBASIC and so don't have any ASM file except the one generated by mikroBASIC which isn't of much help.
can give HEX FILE.PIC 16F676 voltmeter ,it i\p rang 0-500 v AC.7 segment display & ckt diagram also.
 

Volt Meter Pic16f887

Hi sahu,
I made one such for my father who uses it for commercial purpose, so I can't disclose the program.
 

Re: Volt Meter Pic16f887

Tahmid said:
Hi sahu,
I made one such for my father who uses it for commercial purpose, so I can't disclose the program.
DEAR FRIEND
my & ur country r diffr.so i hope no commercial problome with us.
pl pl pl pl ................help me .if any other problome .can u cont. me on ............shivendrakumarsahu77@yahoo.com
 

Re: Volt Meter Pic16f887

sahu said:
Tahmid said:
Hi sahu,
I made one such for my father who uses it for commercial purpose, so I can't disclose the program.
DEAR FRIEND
my & ur country r diffr.so i hope no commercial problome with us.
pl pl pl pl ................help me .if any other problome .can u cont. me on ............shivendrakumarsahu77(at)yahoo.com


Check this link

http://www.winpicprog.co.uk/pic_tutorial11.htm

Try to use C language instead of assembly, which will save a lot of time.....
 

Re: Volt Meter Pic16f887

Tahmid said:
Hi sahu,
I made one such for my father who uses it for commercial purpose, so I can't disclose the program.

did u make a formula for Atom Bomb ?? is it so secret ?? u made it urself OMG
:D:D
 

Re: Volt Meter Pic16f887

hameeds01 said:
Tahmid said:
Hi sahu,
I made one such for my father who uses it for commercial purpose, so I can't disclose the program.

did u make a formula for Atom Bomb ?? is it so secret ?? u made it urself OMG
:D:D
I can fully understand what Tahmid is saying, Basically his father uses it in a commercial product so if his father is selling it then it does not matter what country you’re in the same rules apply,

Why should he release is code anyway, I know how long it can take to develop something and I can tell you it's a lot of hard work and time, And Time is money, The trouble is with some people rahter than do it there self’s there to lazy to learn for themselves :D:D, This would be liking asking one of the manufactures can you give me the code you use in one of there products and say but it’s ok I don’t live in your country, Would you think there be fourth coming in saying sure no problem yeah right sure they will. :D:D

A good example is lacoste first post in asking is there any sample code if he had bothered to use google he woudl have founds lots of samples and schematics, It looks like his really needed has he has never come back to say thanks for your help, So this means it's either not exactly what his after or his took the advise and may never post here again
 

Re: Volt Meter Pic16f887

wizpic said:
hameeds01 said:
Tahmid said:
Hi sahu,
I made one such for my father who uses it for commercial purpose, so I can't disclose the program.

did u make a formula for Atom Bomb ?? is it so secret ?? u made it urself OMG
:D:D
I can fully understand what Tahmid is saying, Basically his father uses it in a commercial product so if his father is selling it then it does not matter what country you’re in the same rules apply,

Why should he release is code anyway, I know how long it can take to develop something and I can tell you it's a lot of hard work and time, And Time is money, The trouble is with some people rahter than do it there self’s there to lazy to learn for themselves :D:D, This would be liking asking one of the manufactures can you give me the code you use in one of there products and say but it’s ok I don’t live in your country, Would you think there be fourth coming in saying sure no problem yeah right sure they will. :D:D

A good example is lacoste first post in asking is there any sample code if he had bothered to use google he woudl have founds lots of samples and schematics, It looks like his really needed has he has never come back to say thanks for your help, So this means it's either not exactly what his after or his took the advise and may never post here again

I agree with Mr.wizpic...................Why should he release is code anyway, I know how long it can take to develop something and I can tell you it's a lot of hard work and time, And Time is money, ..................
 

Re: Volt Meter Pic16f887

HI EVERY BODY
..........HAPPY NEW YEAR..........
..........HAPPY NEW YEAR 2010..........
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top