measuring current with pic
Hi,
I am designing a automatic Residual Current Circuit breaker (RCCB) for household circuitry. If there is an unbalance in the circuitry current transformer will induce a residual current. I want to measure this current accurately and if the residual current is more than 30mA, i want to interrupt main power supply to the house circuitry. The maximum that can flow through the House circuitry is around 40A.
my question is, how to measure the current accurately and protect my PIC from higher residual current. I have few ideas, but i don't no whether these are correct?
1. interfacing current transformer and PIC (ADC port) using a resistor
2. interfacing through a current measuring IC ( still don't have one) to Digital input or PWM input of PIC
Plz help me.