swethamenon
Member level 4
- Joined
- Sep 12, 2012
- Messages
- 70
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,745
Using sensors LV 20P &LA 25-NP V&I measured.output interms of voltage.in LV o/p resistor is 100ohm.so Is(sec current) can calculate.Is/Ip=2.5.I/p rsistance 5kohm.thAT IS THE FIRST PART.In PROTESUS its working.BUT current part nt ok.o/p resistance 100ohm.Ip/Is=1000.Here need Ip.Using POT both values of sensors given.
Code:
unsigned float adcval,adcval1,V1,Is,I,I1,Is1;
char val[7],val1[7];
void main()
{
TRISA=0XFF;
TRISD=0X00;
ADCON1=0X80;
lcd_init(&PORTD);
lcd_cmd(lcd_clear);
lcd_cmd(lcd_cursor_off);
while(1)
{
adcval=Adc_Read(0)*.0048;
Is=adcval/100;
I=Is/2.5;
V1=I*5000;
floattostr(V1,val);
val[5]='\0';
adcval1=Adc_Read(1)*.0048;
Is1=adcval1/100;
I1=Is1*1000;
floattostr(I1,val1);
val1[5]='\0';
lcd_cmd(lcd_clear);
lcd_out(1,1,"V=");
lcd_out(1,4,val);
lcd_out(2,1,"I=");
lcd_out(2,4,val1);
delay_ms(1000);
}
}
Last edited by a moderator: