300ma x 0.1R = 30mV
1000ma x 0.1R = 100mV
Your PIC is on a 5V regulator, so assuming 10 bit ADC = 5V/1024 = 0.0048828125V per ADC 'bit'.
30mV divided 0.0048828125V = ADC reading of 6 for 300mA current (through your sense resistor)
100mV divided by 0.0048828125V = ADC reading of 20 for 1000mA current (through your sense resistor)
As mentioned earlier, that's insufficient resolution - you can get 4x more by making your PIC's positve reference the PIC's internal 1.024V fixed reference voltage. (probably still not enough, so I'd consider making the sense resistor 0.2 ohms etc)
current (through your sense resistor).
Also, how does each side of the sense resistor 'tap off' connect to your PIC ADC pins, becuause they are sitting at 12V?




Bookmarks