Computing stuff tied to the physical world

An OOK relay

In AVR, Hardware on Oct 12, 2009 at 00:01

After having hooked up OOK radios in a few ways, I’ve decided to create an “OOK relay” – a little unit which listens for OOK-encoded data on the 433 and 868 MHz bands, and then re-transmits the decoded data as “normal” packets via the RF12 driver. OOK stands for “On-Off Keying” as opposed to the more advanced FSK – “Frequency Shift Keying” used by the RFM12B’s – i.e. AM vs. FM.

The benefit of an OOK relay is that OOK reception then automatically gets integrated into all the data collection from other JeeNodes that’s already going on anyway. Since an RFM12B can send both 433 and 868 MHz OOK signals, the end result is a pretty complete solution for all sorts of things going on over the air.

Here’s the hardware test setup:

DSC_0650.jpg

The 433 MHz receiver is seen from the side, standing almost straight up with the white antenna wire. It’s connected to DIO of port 1. The 868 MHz receiver is lying flat, with the red antenna wire, and is connected to AIO of port 1. Both receivers are powered from the 3.3V supply.

The reason for this particular setup is that I can use two different pin change interrupts for both: PCINT1_vec for 868 MHz and PCINT2_vec for 433 MHz. No need to decide inside the interrupt routine which is which – this saves some interrupt routine overhead.

The code was created from the two existing decoders for these receivers, and will be made available once everything is finished. Right now, the decoders work happily alongside each other:

Picture 3.png

Sample output:

Picture 2.png

I cheated a bit though by selectively powering the receivers, because there is a hardware problem… it looks like these receivers are interfering with each other. They only work when the other one is off. It’s not that surprising, given that one frequency is almost an exact harmonic of the other. Maybe placing the two receivers physically further apart, or adding better RF power supply decoupling will fix it. They should be able to work together, even receive signals on the two frequency bands at the same time.

More work left to do…

  1. Great ! I love it !

  2. Very interesting! just what I need :)

  3. Question for you – since this will be a standalone unit which can be placed anywhere, I’m wondering what other functions to add to it.

    One is a no-brainer: I’d like to add a DCF77 receiver, to broadcast the precise time every minute (great for other nodes to sync their clocks to). Optional, of course.

    Another one is a decoder for “Decabit” TFcodes, as sent over the power grid, at least in the Netherlands and Germany. These signal the times of night/day power tariff switch-overs, and in some areas also control street lights. I haven’t been able to detect/decode these signals so far, but maybe one day someone will figure it out. Tech info at http://www.anime-za.net/tech/ripple_page03.html

    That leaves two more ports free. We don’t have to use them of course, but we could. One idea would be to hook up a yet-to-come LCD plug, and allow this relay to display messages from other nodes.

    This doesn’t seem to work in the Netherlands, only in the UK, unfortunately: http://news.jeelabs.org/2009/05/28/measuring-the-ac-line-frequency/

    Or maybe add an AC power switching relay, to turn an appliance on and off? Perhaps like this: http://news.jeelabs.org/2009/04/16/switching-ac/

    Other suggestions?

  4. Why do you think the frequency measuring it wouldn’t work in the Netherlands? The change in the Frequency is not willfully created by the UK power companies, it happens in every power grid when supply and demand are not in balance.

  5. Have several ELV-Papers lying around me for checking their wiring diagramms with atmega and FS-20 Receiver. I found out that they all work at 3.0 volt. In the last ELV there was written that the receiver working at 3.0 volt have the best receive-quantity. On the jeenode there is a MCP1702 in 3.3 volt. is it possible to by a MCP1702 in 3.0 volt and to change it on my jeenodes ? What do you think , is the Jeenode working as good with 3 volt instead of 3.3 volt ? Why did you decide to take 3.3 Volt ?

    • Short answer: don’t – see http://news.jeelabs.org/2009/02/27/out-of-spec/

      Running the ATmega at 3V and 16 MHz is going to be pushing the limits even further. So far, I have not seen any problems with running the ELV receivers at 3.3V – I even remember seeing this mentioned somewhere on ELV docs, but I might be wrong.

      You could insert a schottky diode in the power supply of the receiver to get the supply voltage down. Since it only has an output signal, this should work without any problems. I’d be interested to hear whether it makes any difference in range for you.

Comments are closed.