Small solar systems: Difference between revisions
(Created page with "Sometimes you just need a small solar system to power some lights, radios, or a raspberry pi. This, is that! I have setup several of these at our glider field to power securit...") |
No edit summary |
||
Line 4: | Line 4: | ||
==Data Logging== | ==Data Logging== | ||
While not strictly necessary, this is a quick and fun little project that gives you some insight into how much battery capacity is being used. I | While not strictly necessary, this is a quick and fun little project that gives you some insight into how much battery capacity is being used. First, you need to get the data off the charge controller via modbus. Morningstar sells some serial to modbus adapters, I got the one that has RS-232 on one side and an RJ-11 to plug into the charge controller's modbus on the other. I'm using a raspberry pi which was already being used as an OGN (open glider network) receiver. A USB->Serial adapter plugs into the pi and that plugs into the modbus adapter. Then, I run the following little program to dump the data out of the charge controller and put it into an rrdtool databse: | ||
https://gist.github.com/AD7ZJ/495f9b74469aa339b8d62549826db9ac | |||
https:// | rrdtool database, create as follows: | ||
<nowiki> | |||
rrdtool create pvData.rrd --start now-2h --step 60s DS:battVoltage:GAUGE:5m:U:U DS:arrayVoltage:GAUGE:5m:U:U DS:chargeCurrent:GAUGE:5m:U:U DS:loadCurrent:GAUGE:5m:U:U DS:hsTemp:GAUGE:5m:U:U DS:ambientTemp:GAUGE:5m:U:U RRA:AVERAGE:0.5:1m:5d RRA:AVERAGE:0.5:5m:30d RRA:AVERAGE:0.5:1d:20y | |||
</nowiki> | |||
Then make a script to call every 5 minutes and put the data into the database: | |||
<nowiki> | |||
#!/bin/bash | |||
data=$(/home/pi/pv/rrdDataOut.o); | |||
rrdtool update /home/pi/pv/pvData.rrd N:$data | |||
</nowiki> | |||
Finally, you can generate graphs of the data: | |||
<nowiki> | |||
rrdtool graph /home/pi/pv/graphs/batteryVolts.png \ | |||
--start end-1d \ | |||
-w 800 \ | |||
-h 200\ | |||
--vertical-label 'Battery Volts (V)' \ | |||
--upper-limit 15 \ | |||
--lower-limit 10 \ | |||
--rigid \ | |||
DEF:line=/home/pi/pv/pvData.rrd:battVoltage:AVERAGE \ | |||
LINE2:line#FF0000 | |||
rrdtool graph /home/pi/pv/graphs/arrayVolts.png \ | |||
--start end-1d \ | |||
-w 800 \ | |||
-h 200\ | |||
--vertical-label 'Array Volts (V)' \ | |||
DEF:line=/home/pi/pv/pvData.rrd:arrayVoltage:AVERAGE \ | |||
LINE2:line#FF0000 | |||
rrdtool graph /home/pi/pv/graphs/chargeCurrent.png \ | |||
--start end-1d \ | |||
-w 800 \ | |||
-h 200\ | |||
--vertical-label 'Charge Current (A)' \ | |||
DEF:line=/home/pi/pv/pvData.rrd:chargeCurrent:AVERAGE \ | |||
LINE2:line#FF0000 | |||
rrdtool graph /home/pi/pv/graphs/loadCurrent.png \ | |||
--start end-1d \ | |||
-w 800 \ | |||
-h 200\ | |||
--vertical-label 'Load Current (A)' \ | |||
DEF:line=/home/pi/pv/pvData.rrd:loadCurrent:AVERAGE \ | |||
LINE2:line#FF0000 | |||
rrdtool graph /home/pi/pv/graphs/temps.png \ | |||
--start end-1d \ | |||
-w 800 \ | |||
-h 200\ | |||
--vertical-label 'Temperature (C)' \ | |||
DEF:hsTemp=/home/pi/pv/pvData.rrd:hsTemp:AVERAGE \ | |||
DEF:ambientTemp=/home/pi/pv/pvData.rrd:ambientTemp:AVERAGE \ | |||
LINE2:hsTemp#FF0000:"Heatsink Temp" \ | |||
LINE2:ambientTemp#00FF00:"Ambient Temp" | |||
</nowiki> | |||
Finally, enjoy your graphs! RRDTool is perfect for this. | |||
https://prescott.ad7zj.net/gliderpv/ |
Latest revision as of 07:45, 28 February 2024
Sometimes you just need a small solar system to power some lights, radios, or a raspberry pi. This, is that! I have setup several of these at our glider field to power security cameras, radios, charge batteries, etc. It always goes like this: Solar panel -> charge controller -> battery.
I have used morningstar charge controllers for all the systems. We tried some off-brand ones and while they worked ok, they did not reliably disconnect the load at low voltage. That kills your batteries and there goes your cost savings! I like the morningstar SS-MPPT-15 controller. Since they are MPPT you can use them with the large, higher voltage panels cheaply available these days. I can typically get panels 250-300w output for around $100.
Data Logging
While not strictly necessary, this is a quick and fun little project that gives you some insight into how much battery capacity is being used. First, you need to get the data off the charge controller via modbus. Morningstar sells some serial to modbus adapters, I got the one that has RS-232 on one side and an RJ-11 to plug into the charge controller's modbus on the other. I'm using a raspberry pi which was already being used as an OGN (open glider network) receiver. A USB->Serial adapter plugs into the pi and that plugs into the modbus adapter. Then, I run the following little program to dump the data out of the charge controller and put it into an rrdtool databse:
https://gist.github.com/AD7ZJ/495f9b74469aa339b8d62549826db9ac
rrdtool database, create as follows:
rrdtool create pvData.rrd --start now-2h --step 60s DS:battVoltage:GAUGE:5m:U:U DS:arrayVoltage:GAUGE:5m:U:U DS:chargeCurrent:GAUGE:5m:U:U DS:loadCurrent:GAUGE:5m:U:U DS:hsTemp:GAUGE:5m:U:U DS:ambientTemp:GAUGE:5m:U:U RRA:AVERAGE:0.5:1m:5d RRA:AVERAGE:0.5:5m:30d RRA:AVERAGE:0.5:1d:20y
Then make a script to call every 5 minutes and put the data into the database:
#!/bin/bash data=$(/home/pi/pv/rrdDataOut.o); rrdtool update /home/pi/pv/pvData.rrd N:$data
Finally, you can generate graphs of the data:
rrdtool graph /home/pi/pv/graphs/batteryVolts.png \ --start end-1d \ -w 800 \ -h 200\ --vertical-label 'Battery Volts (V)' \ --upper-limit 15 \ --lower-limit 10 \ --rigid \ DEF:line=/home/pi/pv/pvData.rrd:battVoltage:AVERAGE \ LINE2:line#FF0000 rrdtool graph /home/pi/pv/graphs/arrayVolts.png \ --start end-1d \ -w 800 \ -h 200\ --vertical-label 'Array Volts (V)' \ DEF:line=/home/pi/pv/pvData.rrd:arrayVoltage:AVERAGE \ LINE2:line#FF0000 rrdtool graph /home/pi/pv/graphs/chargeCurrent.png \ --start end-1d \ -w 800 \ -h 200\ --vertical-label 'Charge Current (A)' \ DEF:line=/home/pi/pv/pvData.rrd:chargeCurrent:AVERAGE \ LINE2:line#FF0000 rrdtool graph /home/pi/pv/graphs/loadCurrent.png \ --start end-1d \ -w 800 \ -h 200\ --vertical-label 'Load Current (A)' \ DEF:line=/home/pi/pv/pvData.rrd:loadCurrent:AVERAGE \ LINE2:line#FF0000 rrdtool graph /home/pi/pv/graphs/temps.png \ --start end-1d \ -w 800 \ -h 200\ --vertical-label 'Temperature (C)' \ DEF:hsTemp=/home/pi/pv/pvData.rrd:hsTemp:AVERAGE \ DEF:ambientTemp=/home/pi/pv/pvData.rrd:ambientTemp:AVERAGE \ LINE2:hsTemp#FF0000:"Heatsink Temp" \ LINE2:ambientTemp#00FF00:"Ambient Temp"
Finally, enjoy your graphs! RRDTool is perfect for this. https://prescott.ad7zj.net/gliderpv/