Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

Question regarding ACS712

3132 Views - Created 05/10/2015

21/07/2015

Posted by:
Ryno Burger

Ryno Burger Avatar

Hi
I'm building a similar rig found on brain's website using a raspberry pi to log my solar's performance and usage data.
I managed to wire up the ACS712 current sensor and is able to get some amperage reading on the load I'm sensing.
One thing which I cannot seem to wrap my head around is whether one can use the ACS712 sensor to read voltage on for instance my 48V battery bank or are there other specific sensors out there dealing with voltage reading, in this case 48v to 5v to make it compatible with the ADCPi?
Any help or guidance will be highly appreciated!
Thanks

21/07/2015

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

To read the 48V input on an ADC Pi you will just need to use a voltage divider to drop the voltage down to a level the ADCPi can manage.

As the ADCPi ADC chips can only read voltages up to 2.048 volts the ADCPi already uses a voltage divider consisting of a 10K and 6K8 resistor which drops the 5V input down to 2.02381V. To increase the voltage range you will just need to add another resistor in series with the input to increase the resistance of the 10K side of the voltage divider.

To work out the size of the resistor you will need to work out the maximum voltage that will be present on your battery bank and add a small margin for safety. I had a quick look at some typical charging voltages for 48V packs and it appears that they can be around 55V to 60V. A 200K resistor combined with the existing 10K resistor would give you a total resistance of 210K on the input. Using our voltage divider calculator I put in 210K for R1, 6K8 for R2 and 2.02381V for the output voltage and it gave an input voltage of 64.52382V which should be high enough for your needs.

If you add a 200K resistor in series with the input on the ADCPi you will just need to multiply the voltage reading by 12.904764 to give you the correct voltage.

21/07/2015

Posted by:
Ryno Burger

Ryno Burger Avatar

Thank you so much for taking the time to respond with that very detailed and clear explination, it make a whole lot more sense now.
So, do I understand you correctly that a sensor like the ACS712 can be used for both amp and voltage readings?

21/07/2015

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

The ACS712 is just designed to measure current. To measure the voltage you need to connect the input on the ADCPi to the positive terminal on the battery pack with the 200K resistor. Connect the ground pin on the ADCPi to the negative terminal on the battery pack to ensure you have a common ground between the Raspberry Pi and the battery pack.

If you are powering the Raspberry Pi from a separate power supply it may be worth using a multimeter to measure the voltage between the ground on the battery pack and the ground on the ADCPi before connecting them together. With some switch mode power supplies, you can get ground loop problems where the ground on the raspberry pi is floating at a different voltage to the ground on the battery pack and connecting them together causes a short which can damage the Raspberry Pi. If the Raspberry Pi is being powered by the battery pack this shouldn't be a problem.

21/07/2015

Posted by:
Ryno Burger

Ryno Burger Avatar

Oh wow, ofcourse, I never thought of directly connecting it to the analog input on the ADCPi :-)
Again, thanks a lot, it all makes sense to me now.

Sign in to post your reply

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.