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.

[SOLVED] simple LCD based Voltmeter with PIC16F688

Status
Not open for further replies.
Joined
May 1, 2010
Messages
119
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,308
Location
India, Kerala, Moolamattom
Activity points
0
Hallo Viewers,

I get a good and simple LCD based Voltmeter with PIC16F688 form internet.It can measure only 1.5 V to 20 V DC. But i need to change the Voltage range between 1.5 V to 70 V DC. can anyone know how to convert the source code for given purpose? I dont know to change the source code. This this the programme code of the PIC16F688 and the Cfile for the code.

.................................................................
// LCD module connections
sbit LCD_RS at RC4_bit;
sbit LCD_EN at RC5_bit;
sbit LCD_D4 at RC0_bit;
sbit LCD_D5 at RC1_bit;
sbit LCD_D6 at RC2_bit;
sbit LCD_D7 at RC3_bit;
sbit LCD_RS_Direction at TRISC4_bit;
sbit LCD_EN_Direction at TRISC5_bit;
sbit LCD_D4_Direction at TRISC0_bit;
sbit LCD_D5_Direction at TRISC1_bit;
sbit LCD_D6_Direction at TRISC2_bit;
sbit LCD_D7_Direction at TRISC3_bit;
// End LCD module connections

char Message2[] = " DVM Ver 1.1s";
char Message1[] = " OUTPUT=";
unsigned int ADC_Value, DisplayVolt;
char *volt = "00.0";

void main() {
ANSEL = 0b00000100; // RA2/AN2 is analog input
ADCON0 = 0b00001000; // Analog channel select @ AN2
ADCON1 = 0x00;
CMCON0 = 0x07 ; // Disbale comparators
TRISC = 0b00000000; // PORTC All Outputs
TRISA = 0b00001100; // PORTA All Outputs, Except RA3 and RA2
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // CLEAR display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,1,Message2);
Lcd_Out(2,1,Message1);
Lcd_Chr(2,14,'V');

do {

ADC_Value = ADC_Read(2);
DisplayVolt = ADC_Value * 2;
volt[0] = DisplayVolt/1000 + 48;
volt[1] = (DisplayVolt/100)%10 + 48;
volt[3] = (DisplayVolt/10)%10 + 48;
Lcd_Out(2,10,volt);
delay_ms(100);
} while(1);

}

.......................................................................................................



Help me anyone please......now i am on yahoo messanger.........
manojsoorya at ymail dot com : this is my ID
 

Attachments

  • DVM.rar
    37.7 KB · Views: 100

On your hardware, there should be an external potential divider to the controller, prpbably with a gain of about 1/4. Now if you want the maximum voltage to be say 1000v, set the gain to 5/1000 = 1/200. In your code edit adc_read(2)*2 to adc_read(2)*5*(1000/5)/1023 = adc_read(2)* (1000/1023).


All under heaven.
 
Hai samson

Can you say me which line of programme i need to change?

Can you show me how i change?

I am not able to try to change the source code...


Please do it for me............

Thanks in advance.........
 

Displayvolt = adc_value*2
remember to change the external attenuator.
Sorry, i couldnt open the zip file for i`m browsing with my phone presently.
 

i think pic16E877 can convert only 5 volt. So you need an additional circuit for down converting that much of voltage. After the adc you can scale up proportionaly
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top