13 comments on “Raspberry Pi Solar Charger Current Sensor

  1. Cool project 🙂
    Really nicely written too.

    Just miss the full circuit you used that would be handy for anyone that wants to build it to like me.
    I would be really grateful if you could post it or email it to me.

  2. Very nice blog, I will be attempting to replicate it soon. As I am not only an electronics noob, linux noob and a python noob is it ok if I post here for help?

  3. Opps first mistake i bouht the ACS712 chip without the board. I realise i can still use it but how am i going to connect my beefy battery cables, carrying up to 20A to it…? Bigger solar panels coming soon!
    i will need somekind of termination block to connect. I bought the 20Amp version by the way. The little jumper leads on my bread board would surley melt with 20A going through them.
    I realise i should move it form a bread board after testing.

    I also have a question about the 3.3v VREF.

    I understand (i think) what a voltage divider is and why you have it. BUT isnt the VREF just for refeference and not for providing power?

    If it is for reference then you could use the PI’s 5v instead of 3v without effecting the PI and no longer need the voltage divider.

    I apologise if i have missed the obvious.

    Any valuable time you spend putting me right is greatly appreciated.

    • Yes, 20A is quite a bit of current and more than I’d want to run through a bread board. I used the voltage divider because the current sensor board and the Raspberry Pi board were at different voltage levels. If I pushed a 5 volt signal into the Raspberry Pi board, I could destroy the Pi. Thus, I needed to scale it down to something in the range of 0 – 3.3 VDC.

      The Raspberry Pi’s power (5V and 3.3V) and ground pins are not GPIOs. The GPIOs on the Pi need to protected against voltages higher than 3.3 VDC.

  4. Ok all working except
    i have connected the acs712 amp terminals to my battery feed from the solar charger.
    i cut the positive wire and put it in inbetween.
    But the power does not flow through the acs712…
    From looking at the diagram and googling the wiring i believe i have done it correctly.

    any ideas

    Also i get 4.5 V out of my PI not 5v so my voltage divered is a bit off
    I get 2.25 out of acs712 and 1.5 after divider. im sure i can accomodate this in the programming

    • I’m not sure what could be causing your problem. If you are getting a reading somewhere between 0 and 3 VDC from your current sensor, then it appears that it is sensing the current. Can you try putting in a known value (one you can measure first with a multimeter) and testing the output? In the software, I had to try a number of things to get a reading that appeared to match my multimeter, so it is possible you will have to address it with the programming.

  5. Hi, thanks for the information, I was wondering how you got the current sensed equation:

    current_sensed = (1000.0 * (0.0252 * (current_reading – 492.0))) – correction_factor

    And why did you set the correction factor to 94.

    Thank you

    • It has been a long time since I came up with that equation. I believe I used a multimeter and measured different values. Then I made the equation to fit the values I had measured. You might want to also check the data sheet for the current sensor to see if they give any recommended equations.

Leave a Reply

Your email address will not be published. Required fields are marked *