Engineers thermometer

I have just configured an emonGLCD and a battery-powered emonTx unit with 3 temperature sensors. This would make a useful heat-pump engineers tool, and probably has many other uses.

The emonTx has 2 probes (DS18B20's) on 2m cables, and one on-board the PCB. It's battery powered so can be put anywhere in range. The emonGLCD display shows the 3 emonTx temperatures and also a local temperature.  Temperatures are transmitted via wireless from the emonTx to the emonGLCD every 2 seconds.

Typical uses would be for balancing radiators. i.e T1 on the flow, T2 on the return. I have added T1 - T2 (delta T) because that is what you are often looking for.   It could also be used for air-in, air-off off an air source heat pump, or and flow/return situation.   It would make a good tell-tale device. i.e. to alert if any system goes out of its best operating ranges.

I also have the temperatures data going to a Nanode emonBase to be logged to emoncms so that graphs can display temperatures over time. You really need this to balance up central heating radiators. i.e. fix it to a different radiator every day and compare results. The flows can be balanced accordingly.

The DS18B20's are not ideal because they are a bit chunky (as opposed to thermocouples). On the other hand, the accuracy is excellent and it seems that the values can be relied upon. I have chosen to pot-up the probes myself.

They are fragile, and the ready-made sensors from the OpenEnergyMonitor shop are much more rugged and can easily be tie-wrapped to a copper pipe and insulated etc.

Next thing is to battery-power the emonGLCD so it becomes a portable tool.  

Another addition would be a LCD pulse input. This would give me a reading of kWh, and would save me using a stop-watch, as I have many over the years.

Adapting these devices could get addictive!!

By John Cantor

A short video of OpenEnergyMonitor Labs

Timelapse footage from inside and outside OpenEnergyMonitor Labs here in the mountains of Snowdonia, North Wales, UK.

We had lots of fun making this. If only each day was longer!

Faulty Batch of MCP1702 Voltage Regulators

We have noticed recently that a number of people have been having problems with the Nanode RF. The problems were brought to our attention through this thread on the forums.

Many people were getting the message "Failed to access Ethernet controller" when running an EtherCard example.

After much testing we have identified the problem. It turns out that the MCP1702 3.3V voltage regulator which supplies 3.3V to the Ethernet Chip (ENC28J60) was not supplying enough current to power the chip. The voltage was dropping down to 2.6V under load.

Swapping the voltage regulator for one from a different batch solved the problem. it looks like we have been sent a faulty batch of voltage regulators, our apologies for not spotting this sooner.

Note: this problem only applies to the MCP1702 voltage regulators in the latest batch of Nanode RF kits. All emonTx and emonGLCD kits are un-effected, they have always used regulators from another source.

If you have this problem we will send out two replacement regulators free of charge, one for the Ethernet chip and the other for powering the Atmega 328, it may be ok to leave the Atmega328 voltage regulator in place as the current requirements are not as high and it seems to work fine here without swapping it out, but we will send two out so that you can swap out as you prefer.

We have created a free voltage regulator entry in the online shop, just quote your previous OpenEnergyMonitor order ID when ordering and we will send them out:

All the Nanode RF's kits sold through the shop from today onwards will contain the non-faulty voltage regulators.

De-soldering tips
The easiest way to de-solder the regulator is to if possible cut two of the regulator legs, you can then pull out the third by pulling on the regulator body itself while holding the soldering iron tip on the solder surrounding the leg. Then use pliers to pull out the other legs one by one. It is usually easier to pull the legs out if there is actually plenty of (molten) solder around the leg. To clear the holes of solder with a solder sucker again make sure there is plenty of solder in the holes to start with, this usually leaves the cleanest result in our experience. An extra pair of hands can help make the whole job easier. 

elektro:camp(«2012.05») Workshop | Offenburg-Germany

Hackathons are great! The next one I am attending will be the electro:camp in Offenburg, in Germany, close to the french border. I think Trystan and Glyn will also be there as well as a number of cool hackers and makers, all interested in energy and automation.

Many great developments will result from this event and hope to see some of you there as well.

Here is the official website:

Speeding up emoncms feed data requests

If you log 5 second data you quickly amass a huge number of datapoints (about 6 million a year). If you then tried to visualise a years data by loading all 6 million datapoints you would be waiting a long time. The most we would want to load is the same number of datapoints as the pixel width of the visualisation, lets say around 1000 datapoints. So we need some way of picking out of our 6 million datapoints 1000 datapoints at equal interval.

When I first wrote emoncms I searched for mysql queries that could pick out table rows at given intervals and came across the following query that does this:

SELECT * FROM (SELECT @row := @row +1 AS rownum, time,data FROM ( SELECT @row :=0) r, $feedname) ranked WHERE (rownum % $resolution = 1) AND (time>'$start' AND time<'$end') order by time Desc

It seem to work really well. Fast forward 5 months my feed tables are approaching 2.5 million rows  and I'm starting to notice query times getting really quite long. After a bit of searching again, I came across a suggestion to a similar problem suggesting the use of an index. So I tried adding an index and creating a php for-loop to request a single row at given intervals:

$range = $end - $start;
$interval = $range / 1000;

for ($i=0; $i<1000; $i++)
  $qtime = $start + $i * $interval;
  $result = db_query("SELECT * FROM $feedname WHERE `time` >$qtime LIMIT 1");
    $row = db_fetch_array($result);
    $data[] = array($row['time'] * 1000, $row['data']);    

The following table shows the typical times for requesting data from both the indexed and non indexed tables and the different methods. At the same time I also tested whether request times where affected by the data type that time is stored as: mysql datetime or a unix timestamp stored as an unsigned int.

So it looks like the optimum configuration is primarily the addition of an index and use of the php data request method and then to reduce disk space use, switching to unix timestamp. The next step is to create a script to automate table conversion from datetime unindexed to timestamp indexed.

emonGLCD V1.3 Switches - fix!

It was mentioned in this blog post regarding the current version of the emonGLCD (V1.3) that a hardware error rendered the push switches un-usable. This is not the case any more!

It turns out that this error can be fixed in software. The switches can be made to work with no hardware modifications. The emonGLCD tester sketch has been updated with the required fix.

Here are the details:

The push switches are connected ADC 1,2 and 5 (digital 15,16 and 19). When pressed they are pulled low through resistor R5.
The Atmega328 has internal pull-up resistors (20K) which can be enabled by setting the port as output and doing a high digital write:

pinMode(switchpin, INPUT);

digitalWrite(switchpin, HIGH);

The switches are active low, meaning a logic 0 will be read on digital 15,16 and 19 when the relevant switch is pressed. 

Thanks to forum member Drsdre for bringing this elegant fix to our attention. This is a real open-hardware success story! If you've bought an emonGLCD from us we will send out on request the three switches to be added free of charge.

We have created an item for the extra switches in the shop, just click buy (it's free) and quote your original order number:

All emonGLCD kits bought from the shop from now on will include the switches.

Happy days.

Open source hardware and the free rider dilemna

I wrote a post on my personal blog about using content from open source projects in general and the Open Energy monitor in particular. Here is an extract of it:

There are now more than 960 registered members in the community, not all of them are active and quite a few contribute actively to the development of the project. But does that mean that the others are just passive members? free riders? is that fair?
I started toying with the idea of using an arduino to monitor electricity consumption about two years ago, and I found out that someone else (Trystan and Glyn and quite a few others) already started developing that idea and sharing their work and findings online. Sharing their work and code online does not only save other people (actually humanity in general) a lot of time and effort, but it also allows for a much wider scope of fellow tinkerers to review and improve that work.
You can read the post on my blog.

Heat Pump Monitoring

Over the past few months we have been working with John Cantor to develop, build and test the potential of a heat pump monitoring system. John has a lifetimes experience of installing, optimising and troubleshooting all types of heat pumps. John runs and has recently written a very informative book Heat Pumps for the Home

The rest of this post will be a guest post by John, over to you:

A heat pump works by transferring heat form one place to another. The electrical input power should be only a fraction (maybe 1/3rd or 1/4) of the available heat delivered. However, the energy efficiency can vary dramatically.  One of the biggest factors that affect this is the working temperatures on the cold (source) and the hot (sink) sides of the system.  This is mainly dictated of system design (radiators/underfloor-heating details etc), but it is also dependent on the way that the system is operated, see

It has become evident that a significant number of the UK’s heat pumps are not reaching their energy-efficiency potential.  In ordered for us to learn how best to install, set-up and operate heat pump systems, some form of real-time monitoring is vital.

We have developed a heatpump-specific variant of the OpenEnegyMonitor wireless web-connected emonBase and emonTx system. Emoncms was used as the web logging and graphing application.

This tool is as valuable as the stethoscope and X ray is to a doctor.  It allows a heating system to be analysed in detail and observed over time so that settings can be modified, use-patterns changed, and system modifications be made.

Our first test was on a heat pump in Scotland.  The owner initially had some very high electricity bills. After a brief spell of monitoring, we were able to pinpoint a few issues.
These related to the electric boost heater coming on unnecessarily and the under-floor heating poorly balanced causing frequent compressor ‘cycling’ (stop/start).  However, this installation was generally a good example. The data can be seen here:

Our second test was on a suspect system in Wales. This showed up some alarming temperatures on the source, and it is apparent that the refrigeration circuit is in poor health.  We plan to repair the system, then compare the graphs before and after.

The graphs below show just one aspect of the analysis.

There are many things that can be viewed using the web-dashboard. This includes the refrigeration circuit, the source, the underfloor heating and the compressor power-factor.  

It seems likely that there would be 2 main uses for this monitoring.
1)      For the installer or technically-minded owner to learn how best to operate their system, or to pinpoint any areas for attention and possible modification.
2)      For the owner to see some basic data relating to running cost etc. It would also be used as a remote monitor for holiday accommodation.

The diagram at the top shows the full version, but we are working on a simpler version that focuses on the user-control aspect of a system.

OpenEnergyMonitor Shop is open!

It's taken a bit longer than we expected but finally we can proudly announce that our on-line shop is open for business!

Last week we 'soft launched' the shop to friends, members of the community and our twitter followers. We would like to say a big thank you to everyone who's supported the project by making a purchase through the shop. We have been a little overwhelmed by the level of interest. Again, thank you, you guys are amazing!

In the shop we sell all the components needed to build an Arduino based wireless, web-connected open-source energy monitoring system.

Component kits for the main OpenEnergyMonitor modules are available in the shop:

emonTx - wireless energy monitoring transmitter unit

emonGLCD - wireless graphical LCD display unit with on-board LED's & sensors

emonBase - NanodeRF wireless, web-connected base station
We also sell CT clip on current sensors, optical utility meter pulse detector sensors, temperature sensor and power supplies.

This system is still in development, it's not an end user consumer product. It is however functional and very flexible in it's current form. Being Arduino based and using standard Arduino software libraries, it's easy to customise the system to meet your needs.

One motivation behind opening the shop is that by selling the units in development kit form it removes barriers to entry and empowers members of the OpenEnergyMonitor community to to get involved with the project. Revenue raised through the shop will go directly towards funding more development and sustaining ourselves so we can continue working on the project.

In the near future we are planning to move to surface mount electronics to enable pre-assembled units. See our newly updated vision page for more information on how we see the project progressing in the future.

emonGLCD V1.3 PCB

Introducing the latest version of the emonGLCD PCB.

This latest version (V1.3) fixes a few minor issues with the previous version (V1.2) but also has some issues of its own. It's a case of two steps forward and one step back.

The good news:

  • The LDR light sensor no longer suffers from reduced sensitivity due to sharing a port with one of the LCD pins 
  • Both tri-colour LEDs are on ATmega328's hardware PWM ports allowing the brightness to be controlled with some nice dimming effects 
  • New new rear silkscreen design featuring a handy RFM12B frequency note area and a large Welsh dragon graphic! 
The bad news:

  • The new feature in V1.3 was suppose to be two extra push switches to allow for future screen navigation. Unfortunately due to a PCB layout error non of the switches on V1.3 are functional. While this is frustrating since it was an easily avoidable mistake the display is still very functional. The current firmware example for single CT energy monitoring and solar PV monitoring don't really make much use of the switch. 
The good news!

Everything else LCD, wireless, ATmega 328, Light sensor, Temperature sensor and multi-colour LED's work great. We have decided to go with the switches not working for now as it still makes a very functional energy monitor display. 

emonGLCD V1.3 front
emonGLCD V1.3 rear 
V1.3 assembled
The schematic and board design for emonGLCD V1.3 are up on solderpad:

The emonGLCD documentation page has been updated with the new port mappings: