Digital Voltmeter measure voltage between two point in circuit . Now we are going to make a digital voltmeter which can measure 50 volt maximum . We will use pic18f2550 microcontroller and it's ADC pin . Remember that an ADC channel of pic18f2550 can count from 0 to 1023 . Because it's ADC channel register is 10bits. As we like to measure 50 volt , we need to apply a simple technique . So we have to convert 50 volt to 5 volt and we get reading 1023 at adc channel for 50 volt .
For converting we will connect 68k ohm, 22k ohm and 10k ohm resistors in serial so that during applying 50 volt it makes 5 volt drop at 10k ohm resistor . It's the main theme .
ADC(Analog to Digital Converter ) :
We need a basic knowledge about ADC . Let's take a look at here :![]() |
ADCON1 Register |
Basically ADC is like as voltage divider . According to voltage It produce output .
bit 5 : VCFG0: Voltage Reference Configuration bit (VREF- source)
1 = VREF- (AN2)
0 = VSS or 0 volt
bit 4 :VCFG0: Voltage Reference Configuration bit (VREF+ source)
1 = VREF+ (AN3)
0 = VDD or 5volt
We will set VCFG0[bit 5]=0and VCFG0[bit4]=0 . So we will get highest value 5volt[1023] and lowest value 0volt[0].The ADCON1 is a 10 bit register that means 2 to the power 10 is it's highest counting capacity and result is 1024 . So this register can count from 0 to 1023 . When 0 volt , we get reading at RA0 pin 0 .When 5 volt , we get reading at RA0 pin 1023. It means 5volt equivalent to 1023 .
If 1023 reading value equal to 50 volt.
So 1 reading value equal to 50/1023 volt
So 'read_val' reading value equal to (50/1023)*read_val .
Source Code :
sbit LCD_RS at LATB7_bit;
sbit LCD_EN at LATB6_bit;
sbit LCD_D4 at LATB5_bit;
sbit LCD_D5 at LATB4_bit;
sbit LCD_D6 at LATB3_bit;
sbit LCD_D7 at LATB2_bit;
sbit LCD_RS_Direction at TRISB7_bit;
sbit LCD_EN_Direction at TRISB6_bit;
sbit LCD_D4_Direction at TRISB5_bit;
sbit LCD_D5_Direction at TRISB4_bit;
sbit LCD_D6_Direction at TRISB3_bit;
sbit LCD_D7_Direction at TRISB2_bit;
char volt[]=" ";
char mv[]="v";
void main() {
double source=0;
float calv=0;
float sum=0;
float mult=0;
ADCON1=0x0E; // Configure RA) pin as input
CMCON=7;
ADC_Init(); // Initialize ADC
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Out(2,15,mv);
while(1){
source=ADC_Read(0);
calv=(source*50.50)/1023;
floattostr(calv,volt);
Lcd_Out(1,1,"Volt Meter");
Lcd_Out(2,1,"V=");
Lcd_Out(2,4,volt);
}
}
Nice post. I find out some thing harder on distinct blogs everyday. It will always be stimulating to study content using their company writers and exercise something from their website. I’d would rather apply certain using the content in my weblog regardless of whether you do not mind. Natually I’ll provide you with a link with your web weblog. Many thanks for sharing. Flow Meter LC
ReplyDeleteKeep it easy and even impressive. Many clients are worried about the design elements in the logo that if the expert web designer is easy, then it will be boring and will give a lazy impression to the customers winners. Logo Cravings recommends that you choose a 3D logo design service in the United States as the ideal solution to these problems. Services for 3D logo design will remain simple and provide depth and detail about logo design in general. This makes 3D logo design one of a kind and makes your brand stay fresh and alive.
ReplyDeleteThanks to inform this, but i am looking other topic blog, but i think you don't publish Motion Graphic Design Services United States this topic are so top searching topic, why are you not publish these types blogs?
ReplyDeleteInfluential and the most creative topic it was, of DIGITAL VOLTMETER PROJECT USING MICROCONTROLLER, which is so attractive to me as well but there are also very beneficial and highly motivating Dissertations Editing in UAE available to get the best results in your thesis reflectively.
ReplyDeleteI have read some blogs on this, Top website design company in USA doing this type of blogs. I think this is hot topic and in trend too.
ReplyDelete