Remote Solar Voltage Meter running openhab on Raspberry Pi

I’m looking for a little help/guidance on setting up a wifi connected raspberry pi that can read DC voltages from a solar panel and report them back to the openhab sitemap to display on my phone.

I have been looking around for what to use as the volt meter and best thing so far is an adrino, but even that has some disadvantage. It can only read up to 5v, I need more like 30v. I think there is a way to divide the voltage down, but not totally sure. Also, it means running an additional item, bleeding off a little more power than just the rasp.

Anyone know another way to do this?

Also, I’m really a beginner when it comes to programming sensor into the openhab sitemap, any guidance here would be greatly appreciated.


We can see several chapter in your project:

  1. the sensor
  2. the communication
  3. the server (openhab)

Regarding your voltage sensor you are not limited by the voltage acceptance of your microcontroller, the tips is to use a voltage divider with resistors, You connect your pannel to Vin and the ground, your microcontroller to Vout and the ground. Vout will be equal to R2/(R1+R2) * Vin.

For instance if we take R1 = 1Mega ohm & R2 = 0,1 Mega ohm
0,1/(1,1) * 30 =2,7V

Which means the Vout will vary between 0 and 2,7V which is acceptable for a big range of microcontroller.

Once you have read this value you need to send it to Openhab. Unfortunately the pi cannot read directly analogic values, you will need to convert the value to digital. This can be done by an arduino or other micro controller (ESP8266), you will have to read the value in entrance of one analog pin, convert it and send it to the pi.
This can be achieved by several communication support, serial wire,ethernet, wifi, 433/868MHZ… depending on your setup you have to choose one. The pi can be far or close to your panel depending on the technology you choose.

Depending on the communication support the openhab programming will change.