Monitoring current and voltage via i2c to a Pi


#1

Hey All,

I’m looking for some advice (as the subject line suggests) on logging the current usage of two bits of kit and the voltage of a battery (and maybe some other things later on). I think I want to use a Raspberry Pi to do the logging (I have one and there seem to be several good tutorials online) and I think I want to get the data to the Pi via i2c.

My plan (so far) is to connect an Ada Fruit 12bit ADC (1528-1014-ND) to my Pi, which looks fairly straightforward. I will then use a couple of Spark Fun Current sensor breakouts(1568-1882-ND) to do the current reading. So far so good.

I’m struggling a bit with the voltage reading though. It’s a 12v battery that I need to check on so I think at most I need 0 - 20v. I just can’t quite work out how to do that. The ADC want’s 0 - 5v. If it was the other way around I think I need an amplifier but I have no idea what it’s called the other way around.

I’d appreciate any input to help a bit of a noob.
(If someone had a totally different idea I would be willing to think about that as well)

Gareth


#2

@garethwestwood,

Adafruit does make an all in one sensor to achieve this. Take a look at 1528-1168-ND

Plus it is already enabled in Raspbian’s kernel config:

These are the same sensors we use with our Weather Station; Solar and Battery monitoring:

https://eng.eewiki.net/WeatherStation/power.html

Regards,


#3

Hey Robert,

Thanks for the speedy response! Paragraph 1 of the product description is perfect!

Will grab a couple of those and see what I can do.

Thanks again