Current Sensor/Shunt for use with Arduino - Page 1
Forum section: electronics / beginners

author: birdie
author_rank: Contributor
timestamp: March 25, 2015, 03:05:38 am
content: I'm looking at building a custom power monitoring system for my camper trailer. One of the things I want to do is measure some high currents (relative to what a Arduino can handle natively...) including solar panel current and voltage input to the camper trailer batteries, and overall system current usage. I also want to monitor the current usage for individual circuits including the lights and 12v camping fridge.Can anyone suggest some suitable current sensor/shunts to use with an Arduino. It will all be DC, voltages up to 25V or so from solar, and 12V or so for batteries. Currents I'm thinking in the ballpark of 30A or so... but I honestly don't know my actually current draw which is why I want to build the monitoring circuit so I can keep on eye on my battery level and also monitor how much I'm putting back in via Solar and how much each ciruit is drawing...

author: PeterFW
author_rank: Frequent Contributor
timestamp: March 25, 2015, 04:03:55 am
content: Texas Instruments INA226, only 5-6 external components, I2C interface, library allready available for the arduino IDE and it reads current/voltage and calculates the power.I had it running in under a minute and spitting out readings.

author: zapta
author_rank: Super Contributor
timestamp: March 25, 2015, 04:10:19 am
content: You can also use a high side current to voltage converter and use the Arduino for the A/D. For example this onehttps://www.adafruit.com/products/1164. For higher currents you will need to connect an external shunt.

author: birdie
author_rank: Contributor
timestamp: March 25, 2015, 04:41:31 am
content: Someone else suggested these:http://www.jaycar.com.au/Test-%26-Measurement/Panel-Meters/Accessories-%28Current-Shunts%2C-add-on-PCB-etc-%29/Heavy-Duty-Current-Shunt---6---50A/p/QP5412How do they work? Do you just measure the voltage across the two small terminals and then the voltage value is the current value?

author: mtdoc
author_rank: Super Contributor
timestamp: March 25, 2015, 04:43:00 am
content: I boughtone of thesefrom eBay a while back but it looks like they are no longer available there. You could probably put together the same thing easily with the same or similar Allegro chip -they have several similar.

author: mtdoc
author_rank: Super Contributor
timestamp: March 25, 2015, 04:48:31 am
content: Quote from: birdie on March 25, 2015, 04:41:31 amThat's a current shunt. It has a very low, known resistance. You measure the voltage drop across it which is directly proportional to the current. But the voltage drop is very small (mV range) so you would need an accurate, high resolution ADC to use that value with an Arduino.Several commercially available battery monitors, designed for renewable energy systems use shunts like those. For example the Trimetric and Pentameric from Bogart engineering.

author: birdie
author_rank: Contributor
timestamp: March 25, 2015, 05:09:49 am
content: Quote from: mtdoc on March 25, 2015, 04:43:00 amHow do these work, just output a 0-5v voltage proportional to the current which can then be read using an ADC on the Arduino?Quote from: PeterFW on March 25, 2015, 04:03:55 amI like the sound of that, I2C interface should be more accurate than relying on the internal ADC accuracy... I didn't see anything about the current or voltage ratings for this one though...?

author: mtdoc
author_rank: Super Contributor
timestamp: March 25, 2015, 06:30:35 am
content: Quote from: birdie on March 25, 2015, 05:09:49 amYes.QuoteThat looks like a great solution as well. It looks like it works by reading the voltage drop across a current shunt so the shunt will determine the voltage and current ratings.

author: PeterFW
author_rank: Frequent Contributor
timestamp: March 25, 2015, 12:56:22 pm
content: Quote from: birdie on March 25, 2015, 05:09:49 amThe following may include erros, please check the math yourselfIt works up to 36V, the current capabillity is dependant on the shunt resistor.The maximum shunt voltage is 800mV that means if you want to measure 30 Amps at 36 Volts your shunt must be smaller then 0,025 Ohm, wich is perfectly reasonable given the 16Bit resolution of the shunt monitor.Even with a 0,01 Ohm shunt you have a measurement error below 0,5% with a resolution of about 50mA.

author: Seekonk
author_rank: Super Contributor
timestamp: March 25, 2015, 01:55:51 pm
content: I use the 5A version of the ACS712 and then make a wire shunt to up the current. Putting 30A through the 30A version is nuts. It is a camper, no reason for all that accuracy.

author: MLXXXp
author_rank: Frequent Contributor
timestamp: March 25, 2015, 06:06:19 pm
content: Perhaps the INA3221 breakout board reward in this Kickstarter campaign may be of some interest:https://www.kickstarter.com/projects/sunair/really-useful-breakout-boards-for-raspberry-pi-ardYou would probably have to change the values of the shunt resistors for your purposes.INA3221 datasheet:http://www.ti.com/lit/ds/symlink/ina3221.pdf

author: mtdoc
author_rank: Super Contributor
timestamp: March 25, 2015, 07:03:13 pm
content: The 30A versions of the ACS712 areavailable on a very cheap breakout board on eBayAs Seekonk says - putting 30A through them for any prolonged period may not be a good idea and will likely release the magic smoke, but for that price buying a few to experiment with is a no brainer IMO. In fact I think I will pick up a few.

author: Psi
author_rank: Super Contributor
timestamp: March 25, 2015, 07:14:49 pm
content: Be aware that hall effect current sensors don't have very good accuracy at mA level. They are good for sensing amps but not mA.+/-200mA is what you can expect real world.

author: mtdoc
author_rank: Super Contributor
timestamp: March 25, 2015, 07:27:15 pm
content: Quote from: Psi on March 25, 2015, 07:14:49 pmGood point. But I think for the OPs use (and mine which is also monitoring of a RE system) the accuracy is good enough. Temperature effects are also something to keep in mind - especially important if you are monitoring at an outside location.

author: rx8pilot
author_rank: Super Contributor
timestamp: March 25, 2015, 07:41:52 pm
content: Quote from: PeterFW on March 25, 2015, 04:03:55 amI have used the INA226 on a production project and have been very happy with it. The i2c (TWI) interface is easy and the the device is accurate and cheap. I interfaced with an AVR and coded it on my own to integrate with and existing application so I have no notes on the Arduino. It outputs 16bit data which requires a pinch of effort.There are some other INA devices that output a voltage range that you can capture with your on-board A/D. Less accurate though.

author: PeterFW
author_rank: Frequent Contributor
timestamp: March 25, 2015, 08:39:45 pm
content: Quote from: rx8pilot on March 25, 2015, 07:41:52 pmI would not say cheap but it is not pricey either, to me this device has a phenomenal bang per buck ratio.It even will do averaging for you and is way more accurate then the on board ADC.The allegro devices are not bad either but as allready mentioned, they guestimate the current rather then measuring it. Depending on your appication they might do what you want.But you have to measure the bus voltage seperately and you should measure the supply voltage of the Allegro device or calibrate it once to improve the accuracy, since the output is 1/2 VCC referenced.This library works fine for me, i have not had a problem yet:https://github.com/jarzebski/Arduino-INA226