Please, proceed carefully following the tips published in this blog, specially when Main Power is involved. I'm not responsible for any damages caused by what is written in this blog.
Thank you

Thursday, 10 March 2016

Data acquisition - Let's take a look...

Finally I'm ready to show acquired data on the web.

I developed a small PHP web application which shows data and charts through the browser.

Some details:

- PHP 5 programming language and HTML5 rendering
- MARIADB database engine (the independent version of MYSQL, bought by Oracle)
- Frontend developed with Bootstrap v.3 framework
- Google Charts library for charts
jQuery e jQuery-UI Javascript libraries

The User Interface is very simple; it aims to let me verify that all the systems are running fine.

I developed a simple homepage which shows a couple of charts for:

- daily photovoltaic production (link)
- last minutes of Methane Gas detection with a link to a page which shows daily data (link)

Dal grafico della produzione fotovoltaica si può notare un dato anomale...nelle ore notturne la produzione sembra essere costante e maggiore di 0 (cosa naturalmente impossibile...). A detta dell'assistenza, questo problema sembra essere dovuto alla potenza reattiva dovuta alla scarica dei condensatori dell'inverter
From the first chart you can see a strange thing...during the night it seems that photovoltaic production is positive...(impossible, isn't it?). It is due to the reactive power caused by capacitors in the inverter.

(today was a good day...we got 2Kwp)

Under every chart you can also see the last detected data.

On this page there is an auto refresh function which lets you see the real time data.

Then I also developed a login page for future functionalities.

This web application is running on the Raspberry PI, where Apache 2 is installed.
I used a Dynamic DNS service to let this web application be on internet, through a NAT managed by my home router.

I used NO-IP service, which gives me 3 free domains. There is also a linux client application which keeps DNS updated every time my public IP will change.

Tuesday, 8 March 2016

Data acquisition - Photovoltaic production

Another kind of data I would like to acquire is the production of my photovoltaic plant, a 3 kwp plant built over my roof and made by SUNAGE 250 swiss modules and AROS SIRIO inverter.

I also received a little energy monitor tool, which allows me to verify power production through a wireless display. This display is able to store data in a little sqlite database. Through a USB connection, it lets me view and download data using a PC.

This tool is called OWL


My model is the OWL+USB CM160.

The OWL has a little bug because it also detects reactive power when the inverter is switched off (during the night for example...)

For my purpose I have to connect OWL to Raspberry. Unfortunately this is not supported and there aren't official drivers. Making some research over the internet, I found a good linux open source interface for OWL: EAGLE-OWL https://github.com/cornetp/eagle-owl

I compiled and installed this software directly into the Raspberry. It is a background process which detects the CM160 e gets the database data.

This is the shell of Raspberry where you can see the eagle-owl software and database files.

This process will run automatically on startup. Then I wrote a little php script which is able to read CM160 database file e put its data into mysql. In this way I could store all historical data which will be displayed through a web interface.

This script will run on Raspberry every minute (standard cron task).