Technology for P2P Energy Exchange
The basic architecture is aligned with the OpenEnergyMonitor emonPi device as much as meaningful. Because that is the closest open source project in existence, so it's better to align with their ecosystem and develop extensions rather than starting from scratch.
Necessary changes and extensions:
This will be the central piece of hardware for DIY electrical networks, such as for rural electrification. It is made to be fully DIY manageable and serviceable, which means it has to be simple to use and very sturdy, both mechanically and electrically. It would have, for that purpose (1) very few different types of connectors which reconfigure themselves as needed, (2) SELV voltage but also high enough to bridge distances of a few hundred meters for village grids, (3) sophisticated fault and overload protection, such as automatic current limiting in cables depending on their (automatically determined) specific resistance. The box will be "made for abuse", tolerating everything that lay people do to it, such as laying it flat on the ground instead of installing it to the wall, operating it outdoors and even in rain, connecting 1000 V DC from too many serially connected PV panels etc.. This includes that the box must be able to accept input from arbitrarily oversized sources (while having itself limited power in its charge controller, obviously). The defaults would be configured for safety, but all expert settings would be available via a web-based interface.
The idea is also that these same boxes will be used for self-consumption of PV electricity in cities, by basically established a flat-wide own DC network with panels on the terrace, balcony, roof and behind windows. This can include several special type of panels such as walk-on tiles for the terrace, auto-rollup panels for vertical walls and sloped roofs that retract in high-wind conditions etc.. Such a system would be the first market for these boxes, and a way to develop and introduce the system before it is ready and cheap enough for emerging markets such as rural electrification.
The boxes should also include Internet routing over powerline modems (just for DC cables) and integrated wifi access points. Because if these boxes are connected between village houses, that infrastructure can be used to route common Internet access as well. In addition, the boxes need communication infrastructure anyway to negotiate load and generation etc., and the established Ethernet network would be used for that as well. For both purposes, each box would contain one Raspberry Pi computer.
Physically, the boxes should have Euro box format (or fit into an Eurobox for protection during transport, but that will not be needed as the box itself will have to be outdoor proof and very sturdy). So physical dimensions would be for example 60×40×20 cm.
The boxes will not be able to export to the grid, that is, not contain an inverter. This makes them cheaper as grid-tie inverters are quite expensive. Also, it keeps the box safe as it will not generate high voltages. A grid-tie inverter can however be added as a load to the box, if desired, and might be develop by other open hardware developers.
The box will also not contain input for grid electricity, but is prepared to accept SELV (48 V DC) input from an AC adapter, coming as a separate box that is being connected to the grid. This again keeps the box safe and hackable, while the grid-connected AC adapter is a separate box that people usually should not open. It also keeps the box agnostic about inputs, allowing inputs from everywhere including the grid, gensets etc. as long as they conform to some standard such as 4-100 V DC.
The box is made to form an energy efficient DC grid, including least-cost routing of electricity. This also applies to one house, where long DC lines would otherwise create huge losses. So instead, there would be for example one box per story, each with its own PV panels connected, bringing the source closer to the load. For high-demand situations, boxes can of course help each other out.
To install the box, people would just have to mount it to the wall (or place it on the floor) and connect PV panels, loads, and optionally batteries. The box will have a small battery inside for load balancing and essential use during the night (phone charging, lighting). All other batteries would be connected to one of the connectors on the box.
For the choice of connectors, SpeakOn seems great. It can do up to 70 A (when using all four terminals), is available in waterproof variants, and is locking nicely. It just needs to be made in a cheaper, open source fashion. For choice of connector gender, all "things" (box, loads, battery packs, grid AC adaptor etc.) should have one gender and all "cables" the other, on both ends. This lets the energy router box use just one type of connector for both loads and sources (battery packs, PV arrays etc.), which means it can be more flexible as there will a large number of identical connectors that can be used for any purpose.
Since batteries and potential AC adapter / grid-tied inverter combinations can be both load and source, it makes no sense to enforce direction of current by means of connector gender, and it is not needed with SpeakOn connectors anyway as they are safe to the touch in any gender under voltage.
It is possible, and for cost reduction purposes probably a good idea, to have two physical signalling standard for device-to-device communications. First, Ethernet over powerline (similar to ADSL) for communication between energy routers and with complex devices such as batteries / power boxes, as they include their own computer anyway. Second, SPI or a similar simple protocol for cheap devices such as handheld tools that want to tell their power requirements (such as maximum power, to be limited by PWM).
Scaling this system, just as spreading it through the multiple rooms of a house and the multiple houses of a village, would be done by adding more boxes. Boxes can come in multiple variants: some will only allow distribution, not accepting and converting input power; some will have higher-powered charge controllers inside (steps 100 W, 400 W, 2000 W). All these different functions are realized by internal modules, so can be added and changed lateron.
All connectors should have numbers, and the boxes also should have numbers (doubling as network IDs, maybe derived from IPv6 addresses). For equipment safety, connectors would always be in their default mode when nothing is plugged in, which might be even simply "12 V DC" for all the regular automotive equipment (rather 14.4 V DC or 15 V DC, to save some line losses).
Any device that wants something else needs to tell the box using the communication channel. This will reconfigure the connector only while the device is plugged in. For example, a device might switch to 48 V DC, with or without PWM power limiting to some threshold. 48 V DC would be the system voltage, allowing the highest power output and efficiency, while 12 V DC and anything else would be DC-C converted on the fly only, with more limited power output. As another example, a device might require its connector to be the DC burn socket to use up excess PV power (direct connection to PV outputs to avoid any conversion losses, and being told via the communication channel how much of that is is allowed to burn). If a box cannot provide the required configuration, the display would show an error message. For some connectors that usually permanently connected to something (like PV panels) it will be cheaper to keep the device "dumb" and configure the connector in the box. An orange LED would light next to it, indicating that nothing else should be connected before checking the configuration. Also, the connectors would be mechanically locked (a possible addition to SpeakOn).
Open source web software developed by the OpenEnergyMonitor team. Meant to be installed on a Raspberry Pi. Can be installed right on the same Raspberry Pi that is used as datalogger for the MPPT charge controller – with a bit of self-developed glue software.
The cheapest way to build a data logger is reportedly to use a Raspberry Pi 2 (with full Venus or the Venus packages, the only major disadvantage of the latter being lack of automatic updates). See: https://www.victronenergy.com/live/vedirect_protocol:faq#comment-2920549054
A Linux distro (or just add-on packages for RPi) that allows to communicate with Victron Energy charge controllers. Does not include data analysis features on its own, as it uses "HTTP / HTTPS […] to send data to the database behind the VRM Portal" as per https://github.com/victronenergy/venus/wiki/sales-pitch . And the VRM portal is a gratis SaaS solution by Victron Energy. Completely useless here, as it would depend on an Internet connection to view the data of a charge controller on ones own rooftop … . So we'll just use the features to communicate with the MPPT charge controller.
Runs on the Raspberry Pi. Plus, there are ready-made packages available for the RPi: https://github.com/victronenergy/venus/wiki/raspberrypi-install-venus-packages . The RPi packages include support for "VEDirect MPPTs", so are fit for the purpose of builing a datalogger for a MPPT with VE.direct connection. It's the simplest way to get the functionality of the Venus distro on a Raspberry.
Might be used instead of the Victron Energy Venus software to read data from the charge controller.
A web based data logger that works with Victron Energy BlueSolar MPPT charge controllers.
The firmware on Victron Energy charge controllers can be updated (source: https://www.victronenergy.com/live/victronconnect:start#firmware_updates ). So in principle, reverse engineering it and creating an open source variant should be possible.
Their "free plan" allows to get a 5-day weather forecast for any location: https://openweathermap.org/price . It allows up to 60 API calls per minute, of which we'll only need one every three hours (as the 5-day forecast is updated every 3 hours to reach further into the future).
The 5-day forecast has a 3-hour granularity, and for each such time window includes a cloud cover prediction (in percent): https://openweathermap.org/forecast5#XML . This does not yet allow to know how thick the clouds are, but having a freely available prediction that differentiates between blue sky and clouds is the most significant step already :-) In addition, there is a prediction for precipitation (in percent or millimeters), which can serve as a proxy for cloud thickness: heavy rain clouds are necessrily thick.
No free service seems to be available yet.
Good looking web service that provides this service, but only for a fee: http://www.enercast.de/leistungsprognosen/funktionsweise
Another web service offering forecasts only for a fee: http://solargis.com/products/forecast/overview/
These people claim to operate a freely accessible service, but it does not work: http://www.solarserver.com/service/solar-photovoltaic-power-forecast-for-worldwide-locations.html
Current research done in Germany on this topic, without publicly usable results: http://www.dwd.de/EN/research/weatherforecasting/num_modelling/07_weather_forecasts_renewable_energy/weather_forecasts_renewable_energy_node.html
Victron Energy BlueSolar MPPT 100/15.
The offgrid energy controller should, of course, work with all Victron Energy charge controllers eventually.
This was originally selected over the MPPT 75/10 because it allows to install my intended 1000 W(p) within the over-dimensioning limits of the charge controller ("max. 20 A short-circuit current of the PV array"). Namely, by using 5 strings with 200 W and 48 V (nominal) each, made from 4 × 12 V panels (as existing) resp. 2 × 24 V panels (as planned for the 600 W extension). Because in this case, each string has the same short circuit current as each of its serially connected panels. A 24 V / 100 W panel for example has a short-circuit current of 3.04 A (see https://prevent-germany.com/solarmodul-100w-mono-72-solarzellen-4-busbars-in-breit-number-pv-100-m-72 ). So with 5 strings, the short-circuit current of the whole system is 5 * 3.04 A = 15.2 A. Which is below the admissible maximum of 20 A.
The same could also work with 3 * 24 V = 36 V panels, however as that requires multiples of three it does not fit for my roof space and 8 existing panels.
The downside of this is that I have voltages up to approx. 90 V in the PV side, which is not safe to handle. However the output side is still just 24 V, and normally no work is needed on the PV side, and even 90 V DC is not terribly unsafe, so it's all still quite safe. Also up to ~650 W(p) PV capacity I can keep using the "safe" 24 V panel configuration.
In the end it turned out that the "20 A max. short circuit current of PV array" condition for over-dimensioning can be ignored for the MPPT 75/10 and 100/15, as per https://www.victronenergy.com/live/drafts:mppt_faq#disqus_comments . So I will simply install it using 24 V panels (72 cells in series), as that leads to voltages that are completely safe to handle.
Question and answer that documents that the 20 A "max. short-circuit current of PV array" condition does not apply to the MPPT 75/10 and 100/15 charge controllers: https://www.victronenergy.com/live/drafts:mppt_faq#disqus_comments .
So in short: the MPPT 75/10 charge controller ensures that the PV current is less than 10 A under all circumstances and PV configurations, which is below the 12 A allowable max. short circuit current. Likewise, the MPPT 100/15 guarantees less than 15 A, which is below the 20 A allowable max. short circuit current. So the rule can be ignored for these charge controllers.
The case is different for example for the MPPT 150/100: it guarantees PV current is below 100 A under all circumstances, but the allowable max. short circuit current is 70 A. So here, the guarantee of the charge controller is not enough, and the short-circuit current has to be considered when sizing the PV array.
The new Raspberry Pi Zero W is just fine, as it comes with (1) micro USB port for the galvanically isolated USB to TTL adapter, (2) wifi chip that allows to use it as an access point. Source: The Pi Zero W uses the Cypress CYW43438 chip, the same as the Pi 3, as per https://www.raspberrypi.org/blog/raspberry-pi-zero-w-joins-family/ . And wifi host mode is possible with the Pi 3, as per https://www.raspberrypi.org/blog/raspberry-pi-zero-w-joins-family/
"For the Victron BlueSolar MPPT charge controllers equipped with a VE.Direct port, you will need the VE.Direct USB cable, or a similar USB to Serial (TTL level) converter. I strongly advise the use of the Victron cable for galvanic isolation." [https://github.com/izak/ib.bluelantern#components]
The VE.direct port in the devices do not contain isolation, so to protect them an isolated USB to TTL adapter is strongly encouraged. [https://www.victronenergy.com/live/vedirect_protocol:faq#comment-2966198758]
Explanation of why galvanic isolation is needed: http://www.all-electronics.de/integrierte-digitale-isolation-macht-usb-tauglich-fuer-industrieanwendungen/
"MPPT all models (2016): 5v", https://www.victronenergy.com/live/vedirect_protocol:faq#faq
Uses the cheaper CH340 USB to serial chip, which does not have drivers on stock systems. To install drivers on Linux (Ubuntu and Raspian):
The "official" cable for ~30 EUR:
Nice, but only 3.3 V TTL levels, so not suitable here.
Proposal (currently in use): "KFZ Dual USB Adapter | 2,1 / 3,1A 12V | Ladegerät Zigarettenanzünder Auto", 12-24 V input, EAN 4251259100805, 9.50 EUR incl. shipment, http://www.ebay.de/itm/310872638085 . It is also available from http://www.csl-computer.com
Better than "16x2" displays which can only show characters.
Good for making this into a product, since in bulk (10 each) they are available for 5.44 EUR per piece already (incl. shipment): http://www.ebay.de/itm/262806378140
Suitable ones are available for under 8 EUR, even for under 5 EUR: http://www.ebay.de/sch/i.html?_nkw=128x64LCD
The problem is, however, to find a model that fulfills all these requirements:
Overview of various LCD controllers and the voltages and interfaces they support: https://www.raspberrypi.org/forums/viewtopic.php?t=142351&p=966416
The ST7565 is a suitable choice of controller, given this software support and tutorials:
Graphical LCD models based on the ST7565 controller
Research option: search for "12864 st7565r" on Aliexpress: https://www.aliexpress.com/wholesale?SearchText=12864+st7565r
"20P Grey Backlight COG 12864 LCD ST7565R Controller 3.3V / 5V (No Chinese Font)", 4.80 USD + 4.60 USD shipment, https://www.aliexpress.com/item/a/2052478063.html . Has white backlight, a large viewing area, and you can choose 3.3 V logic and SPI interface. Pins have the RPi pin distance of 2.54 mm (see http://raspberrypi.stackexchange.com/a/7453 ), so can also be used on RPi breadboards.
"20PIN Green Backlight COG 12864 LCD ST7565R Controller 3.3V 5V (No Chinese font)", https://www.aliexpress.com/item/a/2054631734.html , similar to the above but with green backlight.
Problem: it comes with a board that is controlled by an Arduino.
Ideed uses a 128x64 px ST7565 LCD. Proof: http://3.bp.blogspot.com/-b2Md9kSXgCM/T0vy5TRCAZI/AAAAAAAAZgM/PU1OQgo2K6g/s1600/DSCF4655.JPG
Adafruit "Graphic ST7565 Positive LCD (128x64) with RGB backlight + extras - ST7565", https://www.adafruit.com/products/250 . However, at 18 USD plus 16 USD shipping to Europe really expensive.
artronicpl CGG128064CF01-FHW-R, 6.30 EUR on eBay, see http://www.ebay.de/itm/391719350757 . However the problem here is that they need quite some external components (capacitors) according to the datasheet at http://www.artronic.com.pl/o_produkcie.php?id=1143 , which are probably already contained on when buying an alternative with a backside PCB.
The ST7920 controller is rather not suitable, as there is little code:
A variant for other sensors (for DC currents etc.) would be needed.
Hopefully not needed, as the Raspberry Pi also includes the "emonHub" service which can also acquire sensor data from other sources. (For example VE.direct via USB port, see https://github.com/openenergymonitor/emonhub/tree/emon-pi/conf/interfacer_examples/vedirect ). So hopefully there are ready-made USB or GPIO connected solutions to acquire more current and voltage sensor data.
Raspberry Pi based energy monitor, but mostly meant for AC connected home PV setups.
Quite expensive (ca. 200 EUR), and not really needed as the MPPT charge controller already has all the sensors coming with OpenEnergyMonitor. So only a data logger is needed.
Way to extend it for off-grid solar PV monitoring: https://openenergymonitor.org/emon/node/11011
Will probably not be needed at all, as such a display is very limited for mmore complex output. For that, one would always use a computer, tablet or phone with a web browser, connected via wifi. On the device one will just need a 16x2 text display, then.
The problem is not so much the price but that that the software needed for these displays is more complex and also needs more CPU power. Problems with the software are for example demonstrated at https://www.youtube.com/watch?v=j4PWXYiszCk . So better stick with simple 128×64 monochrome displays.
Windows, Apple and Android software to configure their hardware. Could probably be made to run with Wine, or at least inside a virtual machine.
An old tool to configure Victron Energy MPPT charge controllers. Windows based command line tool.
Would be nice to develop a Linux command line tool based on this, or from re-engineering this.
Since it is open, and used anyway by the integrated Victron Energy charge controllers, it is here adopted as standard protocol for devices to talk to each other. Victron Energy uses it for that purpose already, anyway.
The protocol might have to be extended for the purposes of the offgrid energy system (hopefully in collaboration with Victron Energy, to not produce ambiguity through a "forked version"). Potential extensions include functions of a "smart load protocol":
It is a serial protocol, so needs just two wires. That makes it fit for integration into the SpeakOn SPX connectors, since these have 2 (or up to 6 actually) unused contacts.
For the physical and logical interface, while the VE.direct protocol would be kept for the messages. Already used by the LibreSolar products, see http://libre.solar/ .
Must allow to use it in parallel in any number, both from the same source and from different sources (but charging the same battery bank). This also implies it must not be restricted by generation capability like PV short circuit current, as PV charge controllers usually are.
Must be able to accept input from various sources, including:
Combine a small MPPT charge controller with a large PWM charge controller. For all off-grid situations, this is exactly right, and the cheapest solution. In low-light situations efficiency is important, and current is low, so a small MPPT controller is enough. But in bright weather, when there is more light than needed to fill the batteries, efficiency is unimportant since electricity generation potential will be wasted after filling the batteries anyway.
A MPPT charge controller should reduce their output voltage dynamically to not exceed max. input current. That allows to connect oversized PV arrays to a relatively small charge controller. Which is the way to go to have enough PV capacity in off-grid installations in winter.
This is simple to do when basing it on a DC-DC converter with CC-CV feature (constant current, constant voltage), since one can set an output current limit on it, and it will automatically reduce the output voltage to not exceed it.
My MPPT charge controller should be based on the DC-DC converters with CC-CV option that I got. It should be fully programmable, so it can charge all kinds of batteries.
Building one from that basis is relatively simple. First reverse-engineer the protocol of the LED display daughterboard by listening on its connector pins with an intermediate connector. Then control the DC-DC converter for the MPPT feature by adjusting the output current limit setting up and down a bit every second or so to find and follow the maximum power point, using sensors for actual output voltage and current and a multiplication to track the resulting power output.
Proposal: LibreSolar MPPT Charger, see http://libre.solar/devices/mppt-charger/ . A well extensible, open source 20 A charge controller that can act as a buck and boost converter and a generic adjustable DC-DC controller.
Proposal: Use a normal Victron Energy BlueSolar MPPT charge controller and configure its bulk and absorption voltages for Li-Ion chemistry, while setting its float voltage to zero, or if not possible to a value below the open circuit voltage of charged LiIon batteries, which is 4.2 V/cell. This also causes the cells to not be charged at all after the end of the CC-CV charging process.
Proposal: SBMS100, an open source 100 A LiIon battery charger and battery management system, based on a PWM charge controller. See EarthOS for more details.