Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.

## dcole13

534 posts

Ultimate Geek

Topic # 154369 25-Oct-2014 18:50

Hi

On our motor home that we own we have a couple of Solar panels on the roof that powers pretty much the whole thing. I am now looking into somehow monitor the amount of power from the solar panels with a raspberry pi. How would I go about doing this? The panels are 12V. Also, could someone clarify on how you would measure the amount of power? Is it kwh?

Thanks

## solival

153 posts

Master Geek

It is quite simple to find power meters suitable for solar panels. Why just don't buy them? Or you want to make something DIY?

## dcole13

534 posts

Ultimate Geek

solival: It is quite simple to find power meters suitable for solar panels. Why just don't buy them? Or you want to make something DIY?

I want to DIY. Also, I have an arduino I could use, I know that this has analog inputs, can I just use resistors to lower the 12V to 5V and then check from the arduino?

## Mark

1324 posts

Uber Geek

dcole13:
solival: It is quite simple to find power meters suitable for solar panels. Why just don't buy them? Or you want to make something DIY?

I want to DIY. Also, I have an arduino I could use, I know that this has analog inputs, can I just use resistors to lower the 12V to 5V and then check from the arduino?

I'm not an electronics person by any stretch of the imagination, but I'm pretty sure that sticking some resistors in-between your Arduino and the 12V output of your panels would not be a good thing to do (and might even result in melted stuff on your table or worst case melted fingers).  How is the Arduino going to measure anything ?  Going to need a power-measuring-thingy on it which then you'd have to work out how to attach to the panels.

## solival

153 posts

Master Geek

Voltage divider (two resistors) for making 5v from 12v is not the best thing as if you get more then 12v you'll burn your arduino port. So you need to design it to work with maximum possible voltage. I don't know specifics of solar panels though. Is it possible that they give less then 12v? For example 5v if it's cloudy. If it's always 12v then you don't need to measure voltage, just use constant.

You need to measure current. It can be shunt or special sensor. Good example of what you need is here:
http://www.hacktronics.com/Tutorials/arduino-current-sensor.html

For raspberry it's more problematic because AFAIK it doesn't have analog port, so you will need to add ADC to your device to use it with Pi.

## SumnerBoy

1660 posts

Uber Geek

Subscriber

Check out the project at www.openenergymonitor.org. They have an Arduino shield which I am using for 240VAC measurement and it works very well. Would obviously require some mods to work with 12V but there is a pretty active user forum so I am sure you would get some advice/help if you asked the right question ;).

## Niel

3267 posts

Uber Geek

Trusted

On the back of the solar panel will be printed the maximum no-load voltage.  Use this to design a voltage divider so that this voltage gives 5V to the ADC input.

Current sensors with a shunt resistor has losses.  If you are up to it, get a decent sensor from http://www.lem.com/ and make sure it is designed for DC measurement.  You want to sense the magnetic field around the cable, not the voltage drop across a resistor.  It is also inherently isolated so almost no chance of blowing things up.  You can buy them from Element14 or RS Components.  The one I have used a number of times (for a high voltage application) output a 0-25mA current out which I pass through a 200 Ohm resistor to get a 0-5V measurement.  You also get sensors with a voltage output, but for industrial use a current loop is more common.

You can never have enough Volvos!

## frankv

2312 posts

Uber Geek

I can think of several ways to measure voltage using a RPi.... caveat: I'm not an electronics guru, but know enough to be dangerous.

Obviously? you could add an analog-to-digital (A2D) converter chip to it (there's one on TradeMe ATM). If you got an A2D with a suitable maximum analog voltage (i.e. >= 12V) and 5V digital levels, you wouldn't need to do the voltage-divider thing that others have suggested.

If all you want to know is whether it is over/under a threshold (e.g. 10V) then a voltage divider and a transistor could give you this. You could even have several of these to allow you to detect several levels.

Another approach might be to use pulse-width modulation (PWM) -- a capacitor whose charge rate depended on voltage, with a periodic reset would do this.

Finally, frequency modulation... an oscillator whose frequency is dependent on voltage. The RPi could measure the frequency via a digital input.

## dcole13

534 posts

Ultimate Geek

I've ordered some resistors for a voltage divider, I'll test to see if it works and then move on to get an amperage sensor.

## geocom

482 posts

Ultimate Geek

Subscriber

One person supports this post

Seeing that it has not been said yet. The Raspberry Pi digital lines are 3.3v. 5V will fry the GPIO line. You will need to make sure that your ADC runs on 3.3v or you will need a logic level converter.

Geoff E

## dcole13

534 posts

Ultimate Geek

geocom: Seeing that it has not been said yet. The Raspberry Pi digital lines are 3.3v. 5V will fry the GPIO line. You will need to make sure that your ADC runs on 3.3v or you will need a logic level converter.

I'm using an Arduino as the ADC as I have one I don't use. It uses 5V

## ubergeeknz

3343 posts

Uber Geek

Trusted
Vocus

News »

IBM leads Call for Code to use cloud, data, AI, blockchain for natural disaster relief
Posted 25-May-2018 14:12

New FUJIFILM X-T100 aims to do better job than smartphones
Posted 24-May-2018 20:17

Stuff takes 100% ownership of Stuff Fibre
Posted 24-May-2018 19:41

Exhibition to showcase digital artwork from across the globe
Posted 23-May-2018 16:44

Auckland tops list of most vulnerable cities in a zombie apocalypse
Posted 23-May-2018 12:52

ASB first bank in New Zealand to step out with Garmin Pay
Posted 23-May-2018 00:10

Umbrellar becomes Microsoft Cloud Solution Provider
Posted 22-May-2018 15:43

Three New Zealand projects shortlisted in IDC Asia Pacific Smart Cities Awards
Posted 22-May-2018 15:14

UpStarters - the New Zealand tech and innovation story
Posted 21-May-2018 09:55

Lightbox updates platform with new streaming options
Posted 17-May-2018 13:09

Norton Core router launches with high-performance, IoT security in New Zealand
Posted 16-May-2018 02:00

D-Link ANZ launches new 4G LTE Dual SIM M2M VPN Router
Posted 15-May-2018 19:30

New Panasonic LUMIX FT7 ideal for outdoor: waterproof, dustproof
Posted 15-May-2018 19:17

Ryanair Goes All-In on AWS
Posted 15-May-2018 19:14

Te Papa and EQC Minecraft Mod shakes up earthquake education
Posted 15-May-2018 19:12

Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.