Block Chain Solar PV Data Logger

in #utopian-io7 years ago (edited)

Introduction

The ElectriCChain.org project has the stated aim of building open source tools to monitor global solar PV energy generation for the benefit of humanity.
Why is this needed? Most solar PV data is either estimated, or is locked behind private servers. So what we are building here is a method to know in near real time, what was actually generated by solar PV installations, globally in a totally decentralised, open source, open data methodology.
This has applications in climate science (one University already interested), monitoring hardware performance/comparison, energy grid managment, adding value to the SolarCoin block-chain (itself an OSS human benefit crypto-currency) and anything else that imaginitive minds can think of.

There are two primary components to the project version I have been building, the DataLogger and the SunFinder.

The DataLogger

The DataLogger is a simple Python script that interfaces with either a solar PV generation meter, or with a solar PV inverter and periodically collects the total MWh that an installation has generated, there are numerous examples of this all over the internet. The more unusual (dare I say unique) part is that the DataLogger injects the readings it gathers into the SolarCoin block-chain. The DataLogger makes a transaction into the block-chain by sending a random, small amount of SolarCoin to one of its own addresses, and is optimised to spend the minimum fee of 0.0001SLR to do this operation. The DataLogger collects multiple energy readings and posts data to the block-chain when the host solar PV system has generated at least 10kWh. This amount of energy is not coincidental, SolarCoin Foundation rewards Solar PV energy producers by sending 1 SLR for every 1 MWh of validated energy generated; by logging data at a frequency of 10kWh, every producer of energy, whether they own a huge plant or a small domestic system can use the DataLogger and only spend 1% of their free SLR claimed from the SolarCoin Foundation:

10kWh = 0.01MWh, therefore logging 1 MWh of energy generated requires 100 datalogs
0.0001SLR tx-fee x 100datalogs = 0.01SLR per MWh cost to data log

Each data log can contain up to 8 readings; this provides a resolution down to approximately 1.25 kWh per energy reading. A small domestic solar PV installation of 4kWp will on average log 10kWh per day, depending on season and location.
Of course it is important that the activity of logging the data and running the SolarCoin block-chain, not consume large amounts of energy, and therefore the SolarCoin daemon, and the DataLogger code is able to operate on SBCs; the PoC version is running 24/7/365 on a RaspberryPi2, consuming just 3 Watts or 72Wh per day, and it is logging data from 2 different solar plants as well!

The SunFinder

The other end of the application suite is the SunFinder; there is little benefit in logging energy data to the block-chain if it cannot be extracted for analysis! Sunfinder is a custom block-chain explorer that specifically looks for transactions in the SolarCoin blockchain that have energy data recorded. When it finds a transaction it ingests the data and writes it to an SQLite3 database. A hurdle to overcome was ensuring data in the block-chain was not spoofed by one user as if they were another; anyone can write data to a public blockchain. When the genuine user makes their first data log into the block-chain, they write information about their system, as part of this log a Signature Address is nominated, all subsequent data logged is then signed against the Signature Address; any observer using SunFinder who has a SolarCoin Core wallet installed, can then check the signature. The Signature Address is always contained in the first system specific datalog, so reading the blocks from genesis forwards results in the SunFinder always being able to decode signatures correctly, and ignore spoofed datalogs. In addition, the message that is signed also contains a checksum of the DataLogger code, so any observer using SunFinder can have a copy of the DataLogger with the same checksum and know the user logging data has not tampered with their version (for example adjusting the MWh calculation, or not using a genuine access method for the inverter/meter).
SunFinder is also lightweight, and can easlit operate alongside the DataLogger and SolarCoin wallet on SBCs (tested on Raspberry Pi 2), once upto block height, it sleeps for 10 minutes before looking for more blocks. SunFinder also includes automated fork detection and rollback.

Open Source

All code is published under the Unlicence, anyone can develop this code. I am a self-taught, novice developer, all help is welcomed.

New Developments

Both the DataLogger and SunFinder now work with either the SolarCoin Daemon or Qt wallets, they also auto-detect Windows versus Linux OS and so can be integrated on most user hardware types (still recommend SBC). This is new work never shared before.
DataLogger commit https://github.com/Scalextrix/ELCC/commit/52a621af8179091b094175044c5799c2e6d2a0ed#diff-f63a2fd53a08c6cff171a6f94eddb91e
SunFinder commit https://github.com/Scalextrix/ELCC/commit/260082d8ff0f0e4b4ed176cde9cd9eec3f071c72#diff-2ac8307edd897317347e2f5dc2b83c74

The GoodWe integration is also new and not before disclosed, commit:
https://github.com/Scalextrix/ELCC/commit/1d87db4542578921ef8f4c70acef0e2489f9de26

ToDos

There are operational integrations with Enphase and GoodWe inverters, there are many more manufacturers to integrate, need more users willing to connect & test.
Each new version of the DataLogger code changes the checksum, so SunFinder lookbacks to older DataLogger versions are not possible; need to add a file containing valid checksums for older versions.
There is a SunViewer in Tkinter to provide simple charting of Total Energy, Incremental Energy and Geolocation, this needs more finesse.

Example of System Registration into block-chain:
https://chainz.cryptoid.info/slr/tx.dws?3397966.htm

Example of Energy Generation into block-chain:
https://chainz.cryptoid.info/slr/tx.dws?3397985.htm

Example of charting:
Capture.JPG



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Hey @scalextrix I am @utopian-io. I have just upvoted you!

Achievements

  • This is your first accepted contribution here in Utopian. Welcome!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Your contribution cannot be approved yet because you have not included the latest commit you have worked on (according to Utopian Rules) -

You must provide the links to the branches/forks/gists/pull requests.

See the Utopian Rules. Please edit your contribution to reapply for approval.

You may edit your post here, as shown below:

You can contact us on Discord.
[utopian-moderator]

OK well Im the only contributor to the project, so every commit is by me, but I guess I can add the URL of the last one.

This is done, see the New Developments header

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by scalextrix from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews/crimsonclad, and netuoso. The goal is to help Steemit grow by supporting Minnows and creating a social network. Please find us in the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP. Be sure to leave at least 50SP undelegated on your account.

Coin Marketplace

STEEM 0.18
TRX 0.15
JST 0.029
BTC 62952.44
ETH 2542.20
USDT 1.00
SBD 2.65