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.

VOLTMETER with PIC 16F877A

Status
Not open for further replies.
I used 1uF Tantal capacitor and it worked Thanks once again.

Do I need to use a Tantal capacitor as C2 in the attached image of Precision Rectifier?
 

Attachments

  • Precision Rectifier.jpg
    Precision Rectifier.jpg
    51.5 KB · Views: 129

I'm glad to see that this works.

Tantal is good because he offer high capacity in small size and low profile, but max voltage is lower in comparison with other capacitors, but usually in usefull ranges. Also tantal have polarity what needs additional attention. That from schematic can be tantal or electrolytic cap.



Added :

See this interesting project with capability to send data Voltage, Ampere, Wattage, Resistance, and show data as LCD style on PC (source, hex, pc software) :

http://www.ar2r.50webs.com/multimeter/multimeter.html

This is not hijack of thread, just give good and additional voltmeter link.


;-)
 
Last edited:
I used 1uF Tantal capacitor and it worked Thanks once again.

Do I need to use a Tantal capacitor as C2 in the attached image of Precision Rectifier?

can this circuit work or adapted the output of current transformer with a burden resistor
 

can this circuit work or adapted the output of current transformer with a burden resistor

Yes you can use this circuit on the output of current transformer with burden resistor, I have used it upto 2 V
 

can i ask you guys im just confused about my code i need clarification..

adc=adc_read(0)

what would be possibly be the value of adc
is it represented in 0-1024 am i right ?
im using pic16f877a which means it has 10bit
2^10 levels=1024
and for example i have 5v as vref
voltage=(5/1024)*adc
is this the right computation to to get the voltage input??
 

Yes. Exactly you use 1023 steps for 10-bit in calc, and this is 4,88mV for each step.

Surf on EDABoard you will find lots of good existing explanation materials.
 

thank you sir for your quick response..ill be working for a self sustaining charger...
i want it to read the voltage of the battery if it reaches for certain level i want it to switch it to another battery

e.g

volt=adc_read(0)
voltage=(5/1024)*volt
BATTERY1:
if(voltage<3)
{
PORTA=0x01 ; this will activate the Ra0 for relay causing it to switch the battery1 to battery2
volt1=adc_read(1)
voltage1=(5/1024)*volt1

BATTERY2:

if(voltage1<3)
{
PORTA=0x00 ;deactivate the relay on battery1
PORTA=0X02;activate the second relay on Ra1


}
else goto

}
else goto BATTERY1



DO YOU THINK THIS WILL WORK??THANKS in advance
 

thank you sir for your quick response..ill be working for a self sustaining charger...
i want it to read the voltage of the battery if it reaches for certain level i want it to switch it to another battery

e.g

volt=adc_read(0)
voltage=(5/1024)*volt
BATTERY1:
if(voltage<3)
{
PORTA=0x01 ; this will activate the Ra0 for relay causing it to switch the battery1 to battery2
volt1=adc_read(1)
voltage1=(5/1024)*volt1

BATTERY2:

if(voltage1<3)
{
PORTA=0x00 ;deactivate the relay on battery1
PORTA=0X02;activate the second relay on Ra1


}
else goto

}
else goto BATTERY1



DO YOU THINK THIS WILL WORK??THANKS in advance

If the variable voltage1 is defined as an integer (non-floating type), then you will face a problem with this line:

Code:
voltage1=(5/1024)*volt1

voltage1 will be equal to 0.

Instead, you should use:
Code:
voltage1 = (volt1 * 5) / 1024;

Hope this helps.
Tahmid.
 

sir can you give me some adc circuit?sometimes i dont know if its in circuit or in my code ...im stuck
 

You can find one here on my blog post:
https://www.edaboard.com/blog/1574/

This one:
48_1332699015.png


Before just using the hardware as is, read the blog post. And then decide if the buffer and voltage divider are required.

For clearing ADC-related doubts, go through these:
https://www.edaboard.com/blog/1569/
https://www.edaboard.com/blog/1570/
https://www.edaboard.com/blog/1571/
https://www.edaboard.com/blog/1572/
https://www.edaboard.com/blog/1573/
https://www.edaboard.com/blog/1574/

If, after going through the above, you still have some questions that need to be answered or some doubts that need to be clarified, feel free to ask.

Hope this helps.
Tahmid.
 

thanks a lot sir this will help me a lot ...ill give u a message after read and tested it ...ill include you too in my acknowledgement part..hehhehe
 

Dear Tahmid,

Please let me know that how to display float value on LCD like, 12.58V.

Please visit thread " PIC16f877a LCD ready-to-use functions needed "
 

No dear, i want to convert string to float.

- - - Updated - - -

Please how to add float function in saeed`s LCD code?

- - - Updated - - -

Please let me know that how to add float function in saeedsolution.blogspot.com LCD code?
 

You can find one here on my blog post:
https://www.edaboard.com/blog/1574/

This one:
48_1332699015.png


Before just using the hardware as is, read the blog post. And then decide if the buffer and voltage divider are required.

For clearing ADC-related doubts, go through these:
https://www.edaboard.com/blog/1569/
https://www.edaboard.com/blog/1570/
https://www.edaboard.com/blog/1571/
https://www.edaboard.com/blog/1572/
https://www.edaboard.com/blog/1573/
https://www.edaboard.com/blog/1574/

If, after going through the above, you still have some questions that need to be answered or some doubts that need to be clarified, feel free to ask.

Hope this helps.
Tahmid.

can this go higher for measuring high voltage say up to 300v ac or dc

thanks
 

Hi all,

Can reducing the microcontroller's clock make the ADC reading more stable?

Thanks.
 

tahmid?

i used this circuit and my system seems no response
by the way here is my latest code:


unsigned int volt,volt1,voltage,voltage1;
void main()
{

TRISB=0x00;
ADCON0=0b10000001;
ADCON1=0b11000000;
TRISA=0b00000011;
PORTB=0x01;
BATTERY1 :
volt = ADC_Read(0);
Delay_us(50);
volt1=(volt*5)/1024 ;
if(volt1<3)
{
PORTB=0x02;
goto BATTERY2;
}
else
goto BATTERY1;
BATTERY2:
TRISB=0x00;
ADCON0=0b10010001;
ADCON1=0b11000000;
TRISA=0b00000010;

voltage = ADC_Read(1);
Delay_us(50);
voltage1=(voltage*5)/1024 ;
if(voltage1<3)
{
PORTB=0x01;
goto BATTERY1;
}
else
goto BATTERY2;

}



i put led in each output port which are in RB0 and RB1 to indicate the switching but seem no light at all
the default led light is at RB0 if detected less than 3v it will switch to RB1
BUT no light at RB0 at all
is there anything wrong with my code or in hardware?i just tested it first in breadboard by the way...thanks:)
 

You need to step the voltage down so that the 24V is within the 5V maximum. Then, you need to use the PIC to calculate the actual voltage depending on the "scaled" (stepped down) voltage.

need help to making pic16f72 based voltmeter. plz help me..........
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top