Blog
OpenEnergyMonitor

emonPi Raspberry Pi Energy Monitoring Shield - Prototype Dev Update

For a while now I have been working on developing a Raspberry Pi energy monitoring shield. Here is a preview of the first prototype design.

The emonPi is not designed to totally replace the emonTx V3, but rather to complement it. I see the emonPi fulfilling two applications:

1. As a low cost Raspberry Pi add-on shield to make all-in-one home energy monitoring unit based on the Raspberry Pi.  We will produce a version of the emonPi board on it's own (without enclosure, HDD and LCD), maybe even with just SMT components ready assembled (like the Arduino Lenoardo) to being the cost down further.

2. As a high quality, robust and nicely enclosed stand-alone energy monitoring unit and web-connected base station with LCD status display, built in hard-drive for local logging and backup. The emonPi has also been designed to be perfect for installers of heat-pump monitoring systems which require many temperature sensor wired up (see temperature sensing part of my forum post update) as well as power monitoring.

The emonPi has got an option for RFM12B / RFM69CW radio to enable it also to act as an emonBase, receiving date from other wireless nodes such as emonTH (room temperature and humidity node), emonTx V3 (energy monitoring node) and transmitting the current time to the emonGLCD LCD display.

Since the emonPi is an energy monitor sensing node and remote posting base station all-in-one and coupled with a status LCD this should make system setup, installation and debugging easier. The emonPi should also be great for remote administration since with the correct network config the Raspberry Pi can be accessed remotely, log files checked and even upload Arduino sketch firmware onto the emonPi's ATmega328.


Development has been documented in an ongoing open forum thread: http://openenergymonitor.org/emon/node/3937

My latest update post can be viewed here: http://openenergymonitor.org/emon/node/3937#comment-21865

emonPi - Raspberry Pi Energy Monitoring Shield Prototype 

emon Pi Features 

  • Two channel CT monitoring with AC sample input 
  • Ability to power the Raspberry Pi and an external HDD without the need for an additional USB hub, emonPi can also function without a HDD
  • RJ45 DS18B20 on-wire temperature bus to allow many temperature sensors to easily be added using a RJ45 breakout board for heatpump monitoring applications 
  • PWM and IRW I/O's on RJ45 
  • Status LCD
  • Compatible with RaspberryPi model A and model B 
  • Option for RFM12B / RFM69CW with SMA antenna to receive or transmit data from other sensor nodes
  • OOK (on-off keying) transmitter footprint for controlling remote plugs etc. 
  • ATmega328 with ability to remotely upload sketches vis Raspberry Pi Serial 
  • Open-source hardware, firmware and software 
  • High quality custom made, wall mountable enclosure
   

End-plate silkscreen draft:

See G+ album for more photos: https://plus.google.com/b/114424977493521882459/photos/+OpenenergymonitorOrgpage/albums/5999656723837107313

 LCD demo:




Please join in the emonPi's open-development forum thread if you have any ideas of thoughts to contribute:
http://openenergymonitor.org/emon/node/3937#comment-21865


The disadvantages of the emonPi compared to the current emonTx V3 are:

  • Only two CT channels, no (approximate) 3-phase
  • Due to higher power requirements of the Pi, the emonPi can't be powered from batteries, 5V DC USB mini-B is required. 
  • Again, due to higher power requirements of the Pi, the emonPi can't be powered from an AC-AC adapter, for real power a 5V DC and 9V AC adapter will both be required. 
  • Requires wifi connectivity or Ethernet to reach the location where the utility meter is located
  • Larger enclosure than the emonTx V3


    How to draw a myelectric style bar chart

    Part of the android app tutorial series: How to build an Energy Monitoring android App P1
    Both the myelectric emoncms module and the soon to be myelectric android app have a bar chart that is written using the 2d graphics canvas. This short guide details how the bar chart is built and the first part is written to be applicable for different programming languages with examples in each particular language to come at the end, there's one for android java canvas at the moment.





    Writing custom graphs is not as complicated as I initially imagined it to be. Once you have a grasp of 2d graphics canvas sometimes its easier to write your own graph to get the style that you want. The myelectric graph was written from scratch in order to achieve a precise look: simple color scheme, bar height values overlayed on the bar, kWh label in the top-left corner.

    Tutorial: How to draw a myelectric style bar chart



    Gwynedd Council Award 2014

    Many thanks to Gwynedd Council (our local council) inviting us along to the Gwynedd Business Week dinner and presenting us the 'Special Contribution to Gwynedd's Economy' award week before last. 


    It's great to be recognised locally for our achievements, especially being an open-hardware business where everything we develop is open-source both hardware and software. It shows that there is a different way of doing things, technology business does not always need to be about closed IP, open-source works and open-source hardware businesses could be a way to have local employment not just here in North Wales but all over the world.

    Trystan stepping up to receive the award 

    A little side story about the slate plaque: We love the slate plaque, slate is very appropriate material to the area; North Wales was once the slate mining capital of the world. Nowadays the slate quarrys and mines are far fewer, many being dormant landmarks in the area used as recreation areas (e.g. our personal favourite, rock climbing :-D ). One underground cavern is used to house a 1.7MW pump storage hydro-electric power station which is the second largest in Europe  and 8th largest in the world

    View from the Llanberis Slate quarries - the round building is a vent hole for the 1.7MW pump-storage hydro power station underground...very cool!  

    Diolch yn fawr Cyngor Gwynedd! 


    How to build an Energy Monitoring android App part 1




    Glyn and I have wanted to have an android app to make it easier to access energy monitoring data from phone's and tablets for sometime.

    Last year we took part in a student project to develop an Emoncms android App with Mathew Keegan who was studying at the time at Aberystwyth University. Mathew made good progess on the foundations of the app which I've uploaded to github here: https://github.com/emoncms/androidAppDev/tree/master/MathewKeeganAberUni

    I've been trying to learn a bit of android app programming to understand what Mathew has developed. I followed a couple of Hello World tutorials and then explored networking and how to update the display. I've written up my notes as a tutorial: How to build an Energy Monitoring android App part 1 here:

    How to build an Energy Monitoring android App part 1


    Im going to try and continue development in this style by writing tutorials of how to do each step.

    I think we should all be able to build our own software (if we want to) and given the rising use of tablets and mobiles as our personal computing devices having at least a basic understanding of how to build an app is enlightening and satisfying to see the results on your phone. Even if you've only dabbled in software before I would like to encourage you to try the tutorial, please ask me if I can clarify anything and feel free to send me a github pull request with edits to the tutorial.

    My next tutorial will focus on how to use android graphics canvas to draw a graph that looks like the myelectric graph in the myelectric emoncms module.

    I've posted this blog post on the forum's here which is a better place to discuss:



    Emoncms Mobile View (My Electric)

    The latest version of Emoncms (V8) has got a feature called 'My Electric', this is a ready made mobile friendly dashboard.

    Just click the 'My Electric' button once logged into Emoncms and select your Power and KWh/d feeds. You will notice that that URL for this page automatically contains your API key, this is to enable this page to be bookmarked and easily accessed on a mobile device.

    If you use Chrome on both your desktop and mobile device your bookmarks will automatically sync. For even easier access Chrome on android allows web-pages to be pinned to the home screen for one button full screen access, this makes the Emoncms page load almost instantly, just like a native app giving a real-time dynamic view of how much power is currently being consumed or generated. Just follow the steps below:

    On first visit the My Electric page will ask you to select your Power and KWh/d feeds

    To create a shortcut on your android home screen hit the 'Add to home screen' button in Chrome

    A shortcut is now created on your homescreen to enable quickly firing up the dashboard

    When the homescreen short-cut is launched the My Electric dynamic mobile view page loads up almost instantly in Chrome in fullscreen mode (no URL bar etc.). This makes  it appear like a native app
    Recently Trystan has been working on taking the first steps to building a native android Emoncms app documenting the progress of building android apps as he goes along. If your an android developer who fancies working on this, please get in touch. See here for Trystans progress:

    https://github.com/openenergymonitor/documentation/blob/master/BuildingBlocks/androidApp/androidAppPart1.md 

    https://github.com/emoncms/androidAppDev/tree/master/HelloWorld

    Emoncms 'Hello World' android App





    Development update: EmonHub, Emoncms&MQTT, Application guides

    There's been a lot of development happening recently but not being blogged about so here's a short overview with links to where to find out more:

    EmonHub (The next version of the oem_gateway)
    http://openenergymonitor.org/emon/node/5203
    Paul (pb66), Jerome, Dave McCraw and I have been discussing the best way to integrate the ability to listen and dispatch data with different datatypes and how best to integrate threading so that dispatchers cant block the other dispatchers and listeners.



    Using MQTT with Emoncms to make a more extensible flexible system.
    We've discussed the idea of using MQTT within emoncms several times before but the idea came up again during discussion about the best way to implement node decoding in emonhub. Emoncms could provide some of the same features of emonhub ie multiple listeners and multiple dispatchers in an elegant way if it incorporated mqtt message queues. It would also provide benefits for control as initially explored here last December https://github.com/emoncms/development/tree/master/experimental/control/nodejs_websocket_thermostat

    Here's a system diagram of how it could look like:



    This approach needs a fair bit of work to make it a really nice solution, If you think this is the way to go it would be great to get some help with making it happen, in particular:
    • Integrating the event module by running it as its own process subscribed to the applicable mqtt topics.
    • Writing a process for the emonhub style dispatcher for sending data to other services such as a remote emoncms or another service entirely such as PVOutput or ThingSpeak
    • Creating raspberrypi module style emoncms gui for the new python based listener setting the rfm12pi radio settings.
    • Managing all these processes, a process status interface in emoncms?
    Richard Hatfield and I have also been doing work on setting up Emoncms + MQTT + scheduler for heating control, the raspberrypi software setup guide for the configuration so far is here:
    https://github.com/openenergymonitor/documentation/blob/master/Modules/RaspberryPI/FullStackHDDScheduler/FullStackHDDScheduler.md

    There are also some new related MQTT mini examples in the emoncms/development repository: https://github.com/emoncms/development

    I've created a forum thread for discussing emoncms + mqtt here:
    http://openenergymonitor.org/emon/node/5207

    New Application Guides


    An ongoing project for some time now is the writing of new application guides that go through step by step system building for home energy monitoring, heatpump monitoring, solar pv and thermal performance monitoring, integrating some of the new features for counting watt-hours on the emontx and using some of the new emoncms features such as myelectric. There's a new github repository in which to develop these guides. The table of content so far is:




    Help with testing and github pull requests with changes to these guides would be most appreciated and if youd like to submit a guide for an application or configuration that you dont think has been covered well that would also be welcome. Please get in touch on the forums if you've got any question's about development and how to get involved.

    ZeroCarbonBritain: Report in short

    I've just come across the 'report in short' flyer by zerocarbonbritian giving a very nice overview of their more in-depth report that I've mentioned before that outlines a very positive and thorough vision for a sustainable future. If you haven’t seen it already its worth checking out:

    "We have the technology to power ourselves with 100% renewable energy, to feed ourselves sustainably and to leave a safe and habitable climate for our children and future generations" - ZeroCarbonBritain



    Download the flyer here: ZCB_RTF - Report in Short - A4 printable.pdf

    Download the full report here: http://zerocarbonbritain.com/

    Id also very much recommend Alice of ZeroCarbonBritain's inspiring talk on their work:

     
    Alice Hooker-Stroud, Centre for Alternative Technology, ‘Zero Carbon Britain (Energy)’ from tyndallcentre on Vimeo.

    Elektrocamp, visiting Jerome in Bordeaux and OuiShare



    Lars Zimmerman and Jenni Ottilie Keppler (Open It Agency), Tristan Copley Smith & Jonathan Minchin (Open Source Beehives), Nick Ierodiaconou (Open Desk), Justina Swat (Fab Jam), Tomas Diez (Fab Lab Barcelona) and Open Energy Monitor (myself) at OuiShare Paris.

    Im now back home in Wales after spending two weeks in France and Belgium attending two interesting events and meeting up with Jerome Lafréchoux developer of the oem_gateway (now emonhub) in Bordeaux. It was a great two weeks, I met lots of very nice people and heard about all sorts of interesting projects.

    The first event was Elektrocamp which is a European meetup that happens every 6 months for people taking an open source approach to Smart Metering, Smart Home, Smart Grid. Some of the projects at elektrocamp where:

    Flukso – an innovative open source energy monitoring project using openwrt
    OpenTRV – open trv heating controller
    Perpetual project – better heating control methods and algorithms
    MySmartGrid - open smart grid approaches based on flukso

    I then went down to Bordeaux to meet Jerome Lafréchoux who developed the oem_gateway which is a central part of the OpenEnergyMonitor system, it was great to meet in person and discuss next steps for OpenEnergyMonitor and emonhub development as well as enjoying a beer and good food.

    Then it was back up to Paris for OuiShare which is an amazing event bringing people together from quite a wide spectrum of projects in the sharing/collaborative economy. There was a good group of us open hardware people there, we had our own space called 'the factory' where as well as a lot of discussing we built things, I spent quite a bit of time over those days building open source furniture with Nick of OpenDesk and beehives with Tristan and Jonathan of open source beehives.



    Lars Zimmerman of Openit made a good blog post with a list of many of the open hardware projects at OuiShare here http://openitagency.eu/open-source-hardware-ouisharefest
    Here's a copy of the list and I've added a few more on the bottom:
    Thanks a lot to Leo Benichou for organising the open hardware for energy transition session at ouishare and for putting me up for the days in paris.
    As Lars said, Good days for Open Source Hardware!

    emonTx V3 Antenna Testing

    Today we did some quick testing regarding using different antennas with the emonTx V3. 

    Four antenna options were tested (Farnell part numbers listed for SMA antennas) :


    Note: the graph sub-title has a typo, it should read 'RFM69CW', 'CRW' module does not exist.. At least to my knowledge! 

    It was found that the wire-whip antenna as shipped by default with the emonTx V3 performed best. 

    However using an SMA could be preferable in some environments; it's more robust and can  be extended easier. 

    Now we have a way to measure RSSI (received signel strength indicator) using  an rfm69cw module we plan  to  do some more antenna and range testing. I'm interested to test to see how many db we're loosing in the antenna pcb trace from the module to the RFu328 then the emonTx V3 pcb trace then finally into the 90 degree sma connector. In future version will probably but the rf module and MCU directly on the PCB keeping the antenna trace as short as possible and use an edge mounted sma connector (these are also cheaper and easier to solder in manufacture). 

    For more info on the test see the emonTx V3 wiki page: