WiRF - WiFi to Sub-GHz Radio

Control your sub-GHz devices from anywhere.

Similar projects worth following
WiRF is a WiFi Module coupled with a an On-Off-Keyed radio transmitter which can be used to control many kinds of simple radio devices. The most common frequencies are 433MHz and 868MHz, but for the first generation hardware I chose to concentrate on 304MHz because that's what my ceiling fans uses for a remote.

I have a ceiling fan over my bed and I love to fall asleep with it on but I hate to wake up at 4am freezing because it's still on. The fan came with a small handheld remote which can set the fan speed and turn on the integrated light. What the remote doesn't offer is any sort of timer feature, so I thought this would be a good first application of WiRF.

Full disclosure: I am an employee of Electric Imp but have worked on this project on my own time because it is something that I enjoy doing.


Since I am relatively new to the sub-GHz radio world, I decided to start with a single application: Control a Ceiling fan and then take what I've learned and grow it into a more general tool.  The first generation is transmit only and while it can be made to work from 300-900MHz, it requires changing components to do so.

For the first generation hardware the goal's I made are:

1. Control a ceiling fan with integrated light from a phone.

2. Set a schedule for the fan to turn on or off.

3. Focus on minimal UI and feature set (It's just a ceiling fan afterall)


Based on what I can find online pretty much all the wireless ceiling fans sold in America use a 304MHz signal for control. The remotes typically use a simple On-Off-Keying with a pulse distance encoding which is very similar to infrared remote controls. Sadly, I was unable to find a 304MHz transmitter so I built my own based on a SAW resonator.

To provide the WiFi control, I went with an Electric Imp module which has WiFi and an integrated MCU with an RTC for running the schedules.


The first step was to reverse engineer the fan protocol. To do this, I opened up a remote and found the signal which went from the MCU to the RF amplifier (the transistor that's next to the antenna). I put a scope on the trace and started hitting buttons. Sure enough, the protocol is very simple. Logic 0 is transmitted as 640us low followed by 320us high and Logic 1 is transmitted as 320us low followed by 640us high. Every button press creates a 13-bit transmission in the form of 0-1-[DIP1]-[DIP2]-[DIP3]-[DIP4]-0-[FanHigh]-[FanMed]-[FanLow]-[FanReverse]-[Light] where DIP* is equal to the settings of the DIP switches on the transmitter which acts as a 4-bit address so you can have 16 fans in your house. Each packet is transmitted 3 times with a 11ms pause between each transmission.


For the RF transmitter I copied the SAW-stabilzied reference circuit from RFM.

Since I wanted a small-ish wall powered gateway, I used the Electric Imp reference design Sophie which is a base board which could contains an AC/DC power supply and 3V3 power supply. I copied the board outline for the Electric Imp reference design Sana and added the transmitter. The WiFan board stacks on top of the Sophie board, though sadly this didn't leave enough room for my antenna in the box so it got all squished up.

The only changes from the schematics are that I added a 10pF series capacitor to the antenna, I hand wound my antenna and I grounded the antenna at the far side. This makes it behave more like a loop antenna, but increased my singal quite a bit. For the antenna length, I looked at a commercial 433MHz antenna and tried to make mine 42% longer, but it ended up a bit of a mess.


I used the Imp agent to serve up a small webpage which has a selection of buttons to control the fan (see screen shot). The imp then formats a SPI packet to contain the On-Off-Keys and transmits the packet 5 times (I found 5 times to be more reliable than 3).

Check out the git hub link for the full source.

Next Steps

I'm very happy with the first generation, it is able to control a single fan but the range isn't very good, it can't be used in different frequencies without changing components and it is TX only so the learning process is very manual.  The next generation is going to replace the SAW transmitter with the SI4460 RF transceiver.

  • 1 × See BOMs in Github

  • Official Entry?

    Brandon Harris08/25/2014 at 19:03 0 comments

    So the project made it onto the Official Entries List despite not being included in the Unofficial Project Statistics. I think this was because I hadn't completed 4 project logs which I didn't realize were required since they aren't in the Entry Specifics section (not so simple, huh?).  I'm hoping this means that the hackaday folks realized that the project is in the spirit of prize and included it.

  • Video

    Brandon Harris08/21/2014 at 05:17 0 comments

    Almost forgot! I posted a video explaining a bit about the project, it's rather last minute so please excuse the poor camera work! I don't have a ceiling fan in my lab to demo, so I'll try to post another video of it in action.

  • Inspirato

    Brandon Harris08/21/2014 at 04:49 0 comments

    In a moment of HackadayPrize-fueled inspirato, I've put together a first pass schematics for the SI4460 based version! There are lots and lots of RF components -- and this was the reduced BOM variant of the matching network!

    Check out the WiRF github link for the Altium source files and PDF schematic.

View all 3 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates