Solar CH

Build log


Wrote a Victron to Prometheus exporter. Now starting to get data from the controller. Peak output from the panel was 38 W.

Recorded a timelapse of the sun on the target area. The Hero 7 records timelapse at 2 Hz and stores at 30 FPS, so 1s = 15s. The area is totally in shade by 10:27 in = 157 minutes after starting. Stopped at 15:01, 164m long, so in shade at 14:54. The sun is at 223 deg / 20 deg at that time, so the nearby buildings are at 20 deg.


Printed a Victron BlueSolar to DIN adapter. Took two tries as the Victron mount isn’t flat.

Made an adapter for the Raspberry Pi header that supplies power and has a voltage divider to make the 5 V VE.Direct connection work with the 3.3 V Raspberry Pi.

Used the extra ports on the Raspberry Pi 4. Enabled by adding


to /boot/firmware/config.txt. This creates /dev/ttyAMA0 through to /dev/ttyAMA4. ttyAMA4 didn’t work initially as the pin had the wrong pinmux set. This can be fixed by running:

sudo raspi-gpio set 13 a4 pn


Got most of a day’s worth of charge. The day was cloudy with good amounts of sun. Got around 100 Wh of generation out of the panel which charged the battery about by 50 to 70 %.

Power generated and consumed
Power generated and consumed
Battery level
Battery level


Wired a relay and the fall back mains supply. The relay switches to mains fast enough, but the DC ready signal from the mains doesn’t decay fast enough causing the Pi to reset.

According to the Sonoff switch, the system pulls 8 W. On 12 V this is 4.3 W.


Wrote a VE.Direct to Prometheus and MQTT exporter. Integrated with Home Assistant, works well.


Printed the corner pieces for the stand and assembled. 11.5 mm U section aluminium for the posts. Designed for 28° which is good for winter here.

Corner mount
Corner mount
Bottom foot
Bottom foot
Panel in sun with the frame
Panel in sun with the frame


Changed the power swichover relay to be driven by the Pi, and did a quick hack that checks the battery state every 10 minutes and switches using hysteresis.


Tidied up powersel, added monitoring, and set the switchover values to their final values. Still runs as root.


Added a udev rule to give gpio access to the pins, and made powersel use that group.

Set up backups using to on cron.weekly.


Got a first full day of OK sunshine. The switch over worked correctly and the system ran on solar or stored energy for 14h.

Full day of charging
Full day of charging

2020-11-08 pt2

What’s next:

  • Move the panel into the final location
  • Run the wires through the window and put the server in the final location
  • Publish the vedirect exporter
  • ???

Ideally the outcome includes turning off the existing NAS. I have a solution for video, but not audio to Android.


Looking at avg_over_time(victron_ppv_watt[24h])*24, gives:

2020-11-05 74 Wh 2020-11-06 39 Wh 2020-11-07 91 Wh 2020-11-08 65 Wh

Total of 269 Wh or 7c of electricity. 56 % of what’s needed to run the server.


Daily charging totals
Daily charging totals

Looking at avg_over_time(victron_ppv_watt[16h])*16 gives the total number of Wh over a day.

Date Generation
2020-11-05 74 Wh
2020-11-06 39 Wh
2020-11-07 91 Wh
2020-11-08 65 Wh
2020-11-09 85 Wh
2020-11-10 48 Wh

On 2020-11-09, the battery was fully charged and some generation was dropped:

Battery charge cycle
Battery charge cycle


2.35 W

2.08 W with /boot/firmware/usercfg.txt


Sun altitude

Location 47.37,8.53




With a slope of 60 deg, produces 54 kWh/m2/month in December, which is ~1.8 kWh/d, or 75 W/m2.

December is 30 % of the peak output.

Taking a Victron BlueSolar 90 W @ 119 CHF with area of 0.52 m2. Solar irradiance is ~1120 W/m2, so the panel is 15 % efficient.

So a 90 W panel can supply 5.9 W for 24 H in December.

To check, a 90 kW (note: 1000x) system gives 4278 kWh in December and 13853 in July at 37 deg, which is 6.5 W continious in Dec and 19.2 (3x) in July.

At 60 deg, this is 4825 kWh in December, or 6.7 W. 2 d of storage is 320 Wh, 26 Ah @ 12 V, or 53 Ah @ 12 V with 50 % cycling.


Wind loading


Horizontal = 1.31 to 5.64 kWh/m^2/day = ~39 to 169 kWh/m^2/month

Horizontal - 30 to 200 kWh/m^2/month

Actual solar - 32 to 177 kWh/m^2/month

Panel: 545 x 668 x 25mm series 4a

So sin 28 deg = O/H, O = 313,

cos 28 deg = A/H, A = 589.

Michael Hope
Software Engineer