RPi and MCP3008 to measure 12v battery
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

RPi and MCP3008 to measure 12v battery

by beeman on Thu Jan 17, 2013 11:38 pm

We are using a RPi with a MCP3008 to measure various environmental sensors around a bee hive (temp, humidity, sun, weight). The whole packege is powered (with adapters) by solar panels and a 12 volt battery. Is there a safe way to measure the voltage of the 12v battery? Maybe stepdown resistors in series (a 1m and 10m resistor) to have the voltage in the 1 volt range? I'm sorta mumbling to get more clear ideas. Thanks in advance. BeeMan
BeeMan, instrumentation for research
beeman
 
Posts: 6
Joined: Fri Dec 28, 2012 10:26 am

Re: RPi and MCP3008 to measure 12v battery

by adafruit_support_bill on Fri Jan 18, 2013 5:38 am

Yes, a voltage divider to drop the voltage into the right range will work.
User avatar
adafruit_support_bill
 
Posts: 29813
Joined: Sat Feb 07, 2009 9:11 am

Re: RPi and MCP3008 to measure 12v battery

by beeman on Fri Jan 18, 2013 1:16 pm

So to confirm a few details. We assume that the grounds are equivalent and tie the battery negative (-) to the GND on the GPIO buss, right?
And then with the voltage divider using E=IR and resisters in the meg-ohm range, the current would be very small. Would resisters of 1K and 10K be "better"? Or smaller current better?
Should we get the smallest fuse available to connect to the positive (+) terminal of the battery or would it matter? No weird current ground loops or anything?
Theory is great, but theory plus experience is the best? That's why the questions. :- )
BeeMan, instrumentation for research
beeman
 
Posts: 6
Joined: Fri Dec 28, 2012 10:26 am

Re: RPi and MCP3008 to measure 12v battery

by adafruit_support_bill on Fri Jan 18, 2013 3:33 pm

1K & 10K should be fine. Tie the grounds together. A fuse is a good idea - especially if it is a high-capacity battery. These can produce arc-welder scale currents and do a lot of damage in the event of a short.
User avatar
adafruit_support_bill
 
Posts: 29813
Joined: Sat Feb 07, 2009 9:11 am

Re: RPi and MCP3008 to measure 12v battery

by amdrake on Mon Jan 28, 2013 3:13 pm

Beeman,

I too am instrumenting a hive to monitor the location of the winter cluster, using custom frames with embedded temperature sensors, and an Arduino Mega to do the scanning, and an Xbee network to get the data back to the house. The frames also have a resistor network embedded in case adding a little targeted heat might help a near-frozen cluster move to nearby honey stores. Like you, I am planning on power from a solar panel and storage battery. I'm concerned about outdoor heat and cold on a LiPo battery; what kind are you trying? The latest Make Magazine issue had an article about how a guy in Virginia handled temperature extremes for his outdoor solar/battery/electronics boxes; it is kinda wild. (I'm also setting up a RPi system, but not planning on using it for the hive monitor.) I'd like to share approaches and experiment results, including your battery voltage monitoring. My email address is public in this forum, a.m.drake@comcast.net. Hope to hear from you, and anyone else interested in using Adafruit products and training for beekeeping.

--Tony
amdrake
 
Posts: 7
Joined: Thu Sep 20, 2012 4:42 pm
Location: Maryland