Thursday, November 27, 2014

At Last - The Long Awaited Relay Board!

A General Purpose 3 Channel 16A Relay Board

Every year, for about 5 years now, I get motivated on a long term project of mine, to make an open source heating control system, and every year, I get distracted and fail to make any real progress.

Well, this year it's different.  I have had a week off work at the end of November, and I was determined to progress the project along a little further.

I've come up to North Wales this week to meet up with Trystan Lea and Glyn Hudson of to have one of our irregular meet-ups, to work on collaborative projects together.

The relay board was something I had wanted to do for some time, and to do it as a potential project with OEM was an attractive idea. Not only will it reach a wider user base, but it has been designed to be compatible with and complement the existing OEM ecosystem - consisting of emonTx, emonGLCD, emonCMS etc.

The board is intended to be a plug in replacement for existing central heating controllers, though with 3 16A mains relays, it is also a very versatile board for other applications.

Power Supply.

The mains section consists of the 3 relays and a 2.3VA transformer power supply. This restricts the live, mains-potential voltages to the upper third of the pcb where they can be kept out of harms way with a suitable insulating enclosure.

Sensor Connectors

The lower two-thirds of the pcb is the microcontroller section, expansion connectors and user interface.

The expansion connectors allow a range of temperature sensors to be plugged in.  

There is an RJ45 connector which allows the Dallas "One Wire" DS18B20 temperature sensors to be connected.  OEM use these already on their emonTx and emonTH products, and so it seemed sensible to use these again, benefiting from their stock item and existing firmware. Additionally they stock an RJ45 break out board, which will accept up to six of these sensors, and can be daisy-chained using standard RJ45 network leads to extend the sensors 6 at a time.  If you have a lot of sensors to wire in, this would be a neat solution.

In addition there is provision for up to 6 analogue inputs. These have been tailored for 10K thermistors, but any analogue signal up to 3.3V may be measured.  I prefer thermistors to the digital type sensors, because they can give better resolution, and they are available in a handy "pipeclip" package, from Rapid Electronics - which are great for making measurements on heating pipes.

Open Collector Output

In addition to the temperature sensing channels, there are some unbuffered digital inputs which are 5V tolerant, and one 200mA open collector transistor output which can be used for driving a 4th external relay.

User Interface.

The user interface is designed to be simple and intuitive - just 4 push button switches and 4 LEDs.  As this device will generally be commuicating with the rest of the system via a wireless link, to a remote display (emonGLCD), the user interface can be very simple.

The LEDs give positive confirmation that the relay has switched to its ON position, and the push buttons are arranged below the LEDs - and can be used for selecting a "boost" or "over-ride" function for any of the 3 relays or external relay drive.

Microcontroller Section

This unit is designed to have a plug in microcontroller module, which includes the wireless device.

The reason for this is that it will allow various combinations of microcontroller and wireless to be used. It also puts all of the slightly tricky surface mount components onto the one pre-built module, whilst the rest of the board uses through hole components for easy home construction.

The first module to be used will be the newly updated RFMPi from OEM - below.

This is a combination of an ATmega328 and either an RFM12B or a RFM69. Whilst this module has previously been used to provide RFM wireless connectivity for the Raspberry Pi, we have updated the design this week, to break out most of the I/O to a 24 pin connector (on the left) - allowing access to 8 analogue input and 8 digital I/O lines plus the SPI bus.  Indeed this should make a compact and useful module with many possible applications.

Another option is my RFM_Stick. It's based on the ATmega328 and has a position for an RFM12 and the new Espressiv ESP8266 WiFi module. This is a new board from me, and no samples are available yet.

The RFM_Stick is the first of a series of boards that share a common 40 pin footprint. There will be a choice of AVR or ARM based boards, designed to have a range of communication options and be breadboard friendly.  ARMiGo is the first of these.

On the right hand side of the pcb is the standard "FTDI" connector footprint which allows serial comms and local programming of the microcontroller.

For those who wish to use another microcontroller or wireless, all of the I/O appears on a 40 pin DIL footprint - which is compatible with my recently updated ARMiGo module. This is a high performance ARM M4 Cortex - with a choice of 48 pin package microcontroller options.

Real Time Clock

I have included an option for a real time clock on the pcb. This can either be a DS1307 or similar, (industry standard footprint) - or my preferred MCP79410 - which is very cheap. The RTC has back-up from a supercapacitor - so that time is maintained during a power outage.

In some applications, operation from a dc supply or a battery might be applicable. A 3 pin connector allows a LiPo or similar battery pack to be added if required.

It is anticipated that samples of the relay board will be available around the 10th of December. Please contact in early December for full details and availability.


Anonymous said...


Interesting board - well done on getting to this stage!

I have some concerns on the tracking for the 'hot' side. The creep distance for 240 VAC working looks marginal in some areas (e.g. N01/NO2/NO3 relay pads)
I'd suggest advising switching light loads only, the connectors and common live trace will struggle with 3x16A !

- emjay

Ken Boak said...

I have updated the 240V tracking to increase the clearance distances, and also allowed the use of wider tracks, and tracks placed on both sides. This should improve the current handling capability of the board.

Dick Middleton said...

Something horrible about the rendering of this web page on my browser. The big picture and the mini bio overlap each other and the text.