Using ADC to measure bidirectional battery current from shunt

I’m using an Imp001 on an April dev board. I have an AD8418 current sense evaluation board output connected to Pin 9 on the Imp. I power the AD8418 with 3v3 from the Imp. The eval board is set up to measure voltage differential on a low side shunt (500A/50mv) with the output centered on 1/2 the supply (1.65v). I have confirmed 1.65v output from the AD8418 when no current is flowing through the shunt using my test meter connected at Pin 9. When I read the ADC I get a raw number of about 6300 when it should be 32768ish. I don’t see where I’ve gone wrong. Suggestions appreciated.

shunt <-hardware.pin9;
shunt.configure(ANALOG_IN);
function getBatteryCurrent() {
//read output of AD8418 shunt sensor on main battery shunt using Pin9
local reading = 0;
reading = shunt.read();
server.log("reading = " + reading);
}

Consider this closed. I moved my sensor input from pin9 to pin8, adjusted my code to reflect the change in wiring and everything works. I have something wrong with pin9.

1 Like