element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Single-Board Computers
  • Products
  • Dev Tools
  • Single-Board Computers
  • More
  • Cancel
Single-Board Computers
Blog Energenie Experiments – Remote Power Control for the Home
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Single-Board Computers to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: shabaz
  • Date Created: 19 Nov 2014 11:52 AM Date Created
  • Views 2382 views
  • Likes 5 likes
  • Comments 5 comments
  • mains
  • remote_control
Related
Recommended

Energenie Experiments – Remote Power Control for the Home

shabaz
shabaz
19 Nov 2014

Introduction

There is a remote power control solutionremote power control solution for home use by a company called Energenie, that provides radio-controlled mains socket adapters for UK use. These are intended for use with small radio-controlled handset, like a TV remote; I wanted the ability to use them with any microcontroller board. This is a short post about my findings. The aim was to control these sockets:

image

with this:

image

 

What about Europe, US, Asia, etc?

Unfortunately I don’t believe they have a product for some other regions (I could be wrong) – which is a shame. For other regions you may want to consider Watts Clever or Elro CoCo or Brennenstuhl products since colleagues here have already reverse-engineered these - a popular topic!

 

Raspberry Pi Control Board

A while back Energenie came out with a small board intended for the Raspberry Pi (RPI) (sold in a pack pack or separatelyseparately), to allow remote control directly from the RPI. They supply Python code to switch up to four sockets on and off independently. This is great, but sometimes you may want to use a different board other than the RPI.

image

 

I’m not familiar with Python, so it was interesting to try to understand the code, to make it platform agnostic. The information here should allow the Energenie RPI module to be used with any microcontroller dev-board in any language.

 

Hardware and Software Detail

The first step was to take a look at the Energenie documentation (PDF). They provided a lot of information; clearly the documentation is written by an engineer. It is great to see the level of openness. This is the block diagram from their documentation:

image

The next step was to look at the hardware. Here is a photo of the board:

image

 

Out of curiousity the circuit was examined briefly. There are two ICs on the board, and the datasheets are available on the Internet. An approximate circuit diagram from the two datasheets was created below; the left side shows the transmitter (containing a PLL locked to a fixed multiple of the crystal frequency – i.e. just a single channel), and the right side shows an encoder device to generate a stream of data. As can be seen, it is basic (but sometimes this is all that is required). It is better than some circuits which rely on lower-cost transmitters without a PLL to shave some cost. The dual-mode (ASK/FSK) capability is also nice.

image

 

The encoder has some values d0..4 brought out as signals as shown in the circuit above, but also some signals c0..19 are internally hardware-assigned a random value (the sockets can learn using a button on them). The diagram below shows the frame format from the encoder:

image

 

Based on this and the diagram in the Energenie datasheet it was straightforward to understand the circuit. Once a code has been set up on d0..4 (to select which socket needs to be powered on or off – there is a reference table in the Energenie documentation) then the Enable pin needs to go high briefly. The Mode signal is kept low (the sockets use ASK, not FSK mode). When the Enable pin goes high, the data is repeatedly burst out until the Enable pin is brought low.

 

How would one go about debugging this sort of thing? With an oscilloscope, the information between the encoder and the modulator could be probed. I didn’t perform any such capture due to lack of time. If you need to play with ready-built radio modules just to get going but are not interested in much detail, then a low-cost solution is to use a radio receiver (it could even be a $10 SDR dongle plugged into a PC); you’ll hear the output, and then you know that at least part of the solution is functioning to a degree. I was in a hurry and I didn’t use anything more exotic than a radio receiver. A low-cost used radio that covers useful spectrum can be obtained for about £40-50.

 

The next step was to create a small adapter cable (or just use jumper cables) to plug into the Energenie module, to allow it to be connected to non-RPI boards. I used a FRDM board as a quick test. Any board including an Arduino could be used (but make sure that the supply and signal levels are 3.3V, not the default 5V that the usual Arduino offers).

image

 

Finally the python code was translated. There is not much to it – it is so short it is self-explanatory.

 

Here is some example code which would work on FRDM boards; this code switches a socket on and off repeatedly. Refer to the Energenie documentation to see the d0..3 combinations for controlling additional sockets.

 

#include "mbed.h"

#define sock0_on d3=1;d2=1;d1=1;d0=1;
#define sock0_off d3=0;d2=1;d1=1;d0=1;

DigitalOut d0(D0);
DigitalOut d1(D1);
DigitalOut d2(D2);
DigitalOut d3(D3);
DigitalOut mode(D4);
DigitalOut enable(D5);
DigitalOut led(LED_RED);

int main()
{
    mode=0;
    enable=0;
    wait_ms(100);
        
    while (true) {
        sock0_on;
        wait_ms(100); // apparently needed according to documentation
        enable=1;
        led = !led; // toggle led
        wait_ms(250); // transmit for 250msec
        enable=0;
        wait_ms(5000);
       
        sock0_off;
        wait_ms(100); // apparently needed according to documentation
        enable=1;
        led = !led; // toggle led
        wait_ms(250); // transmit for 250msec
        enable=0;
        wait_ms(5000);        
    }
}

 

With this code you can hear the socket switching on/off (i.e. there is presumably a relay inside).

 

Summary

This was just a quick post to show that using the Energenie module it is possible (in the UK and other countries with similar sockets) by directly interfacing to 3.3V logic circuitry or microcontrollers in order to safely control home mains power to appliances. This opens up possibilities such as using Arduino, TI CC3200 or BeagleBone Black or other devices rather than the RPI. To achieve a similar solution in other regions, check out the blog posts from mcb1, fvan and crosseyejack mentioned earlier in this post.

  • Sign in to reply
  • shabaz
    shabaz over 10 years ago in reply to DAB

    Hi DAB,

     

    Thanks!

    I've just got two of the Energenie sockets currently so I can't do too much yet, but I plan to use probably at least a couple to control lamps as a security measure.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 10 years ago in reply to mcb1

    Hi Mark,

     

    Thanks!

     

    I have a whole family of FRDM boards currently (as do you I think), so it's a case of pick your requirement and 'choose your weapon' when it comes to selecting one!!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 10 years ago

    Nice Post,

     

    Have you done an energy audit on the devices that you want to control?

    It would be very useful to see your before and after power usage to calculate the cost benefit.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 10 years ago

    Interestingly both those products are available on the AUS/NZ website, although how you're allowed to sell it into NZ is a mystery, since it doesn't meet our regulations.


    mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 10 years ago

    Nice job.

     

    I like that you've used the FRDM board, its mean's i might need to try mine out.

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube