Disclaimer

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
Showing posts with label cm160. Show all posts
Showing posts with label cm160. Show all posts

Monday, 28 August 2017

Home Automation System - MQTT and RF433 to monitor photovoltaic production




Now I will try to integrate my RF433 Wireless Receiver (built on Arduino with Ethernet Shield) with MQTT, just to acquire my photovoltaic production data in my future Home Automation System

I don't write nothing more about my acquisition system; this is my old post about that:

http://domoticsduino.blogspot.com/2017/02/rf-433-mhz-data-sniffing.html

Now I would like to transmit data to my MQTT broker, for the future integration with OpenHAB

So, I have to edit the code of the Arduino sketch and let it to publish messages to the MQTT broker. In this time, the receiver publishes data to a HTTP REST Web Service

Well, using Arduino IDE (the same thing used for the SONOFF firmware upload), I open the sketch and edit the code.

I omit the technical details about the code because it's not the purpose of this post, but if you are interested in it, write me an email; I will be happy to share my code with you.

I chose the following MQTT topic:

arduino/groundfloor/rf433/solarenergy/state

I followed the same naming convention as the SONOFF :

[device]/[zone]/[type]/[data id]/state

The content of the message is simply the value of the production in Watt.

Here are the published messages, through mqtt-spy:



And here is the receiver:




Currently it's "mute", but the next step would be adding a led to monitor its status and eventually some environmental sensor...

Stay tuned...


Friday, 24 February 2017

Rf 433 Mhz data "sniffing"



It's been a long time when I wrote my last post...My job and family matters keep me far from my hobbies...priorities won

As some of you could remember (see post http://domoticsduino.blogspot.it/2016/03/data-acquisition-photovoltaic-production.html), I acquired the production of my photovoltaic plant using the OWL CM160 wireless receiver, plugged into the USB port of Raspberry.


Unfortunately, this system was not so stable as I wished, because of the USB driver...and so Raspberry needs to restart...not so convenient...isn't it?

I found an internet blog where someone was able to sniffing wireless data packets trasmitted by the sensor to the OWL, through a simple wireless receiver, as the one I used to receive the gas sensor data...(see post http://domoticsduino.blogspot.it/2015/08/data-acquisition-receiver.html)


This it the article:

https://github.com/onlinux/OWL-CM180

It's using a CM180 wireless receiver, but the explanation works well for the CM160 too.

These systems use the Oregon Scientific communication protocol...My CM160 use the version number 3...

Here is a doc about Oregon Scientific protocol...

DOWNLOAD

Data is transmitted using che Manchester OOK (on off keying) code at 433 Mhz

So I connected my wireless receiver to an Arduino UNO and I downloaded the sketch which allows me to decode the OOK transmission. Playing with bits I was able to decode the transmitted value of the solar power...

Some example in hexadecimal chars:

2a8081bf01501a011900 ==> power 434 W
2a81817f02d0fdf71800 ==> power 627 W
2a81813f0980f3b71300 ==> power 2366 W

Output on the serial port


The next step will be the transmission of received data to central server

Sniffing all the 433 Mhz packets, I noticed that there are packets with a different format...these packets may be transmitted by other sensors. One of these sensor could be the temperature gauge, placed outside the house. At this time I'm not able to decode this particular signal...maybe in the future??

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

http://www.theowl.com/energy-monitors/standalone-monitors/owl-usb/


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).