jessey
- 11th May 2009, 14:54
I'm using a current transformer (one that I had kicking around) with a 600 to 5 ratio that is suppose to be good for up to 25 amps. The motor I'm using it on (under no load) uses approximately 1/4 of an amp and produces about 1.5 vac. I connected the output of the current transformer to a 1.5 Amp 1000 Volt bridge rectifier and I get a voltage of about 1.15 dc. I have it connected to an adc input on my 16f688 with a .1 mf cap to ground. When I power up the circuit the LCD shows the number very gradually creeping up to about 162 then drops very slowly to about 140, it's not consistent at all and sometimes goes up to over 200. I'm using ADCIN with the code below:
'PIC Config Fuse Definitions for 16f688
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF & _BOD_ON
ANSEL = %00001000 ' enable analog AN3 (pin 3), the rest as digital
ADCON0 = %0000001 ' VREF to VDD & left justify & sets converter On
ADCON1 = %00100000 ' set conversion clock FOSC/32
CMCON0 = 7 ' turn off comparators
OSCCON.3 = 1 ' Use internal clock
OSCCON = %1110111 ' Set to use the internal oscillator
DEFINE OSC 8 ' Without this define the 688 will defalt to 4 Mhz
ADCIN 3,Ugo_Motor
LCDOut $fe, 1,"Ugo Motor = ",DEC Ugo_Motor
I've never used a current transformer before so maybe I'm using the wrong one for my small motor? I've been using the same code on another 16f688 ADC with the same settings as above and it's been working good for quite some time now. Would anyone have any suggestions that might help solve my problem?
Thanks
jessey
'PIC Config Fuse Definitions for 16f688
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF & _BOD_ON
ANSEL = %00001000 ' enable analog AN3 (pin 3), the rest as digital
ADCON0 = %0000001 ' VREF to VDD & left justify & sets converter On
ADCON1 = %00100000 ' set conversion clock FOSC/32
CMCON0 = 7 ' turn off comparators
OSCCON.3 = 1 ' Use internal clock
OSCCON = %1110111 ' Set to use the internal oscillator
DEFINE OSC 8 ' Without this define the 688 will defalt to 4 Mhz
ADCIN 3,Ugo_Motor
LCDOut $fe, 1,"Ugo Motor = ",DEC Ugo_Motor
I've never used a current transformer before so maybe I'm using the wrong one for my small motor? I've been using the same code on another 16f688 ADC with the same settings as above and it's been working good for quite some time now. Would anyone have any suggestions that might help solve my problem?
Thanks
jessey