Studio Contrechoc

design & textile & technology entries

RFM01 and RFM02 libraries (version 0.1) for arduino 18

We bought RFM01’s RFM02’s and RFM12, a few month ago.

Eventually the RFM12’s worked with the library of We modified this library  a little bit to seperate it from the Ports.h.

The RFM12’s communicated very well, and we did (and will do) several first projects with these transceiver. (see former posts) Although it is sufficient to use these RF12’s we still had a bunch of RF01’s and RF02’s.

So we set out to get also these senders and receivers working.

First we tried to modify the library of jeelabs for the RF12 to get it working for the RF01 and RF02. We learnt about the SPI of the ATmega168 (and 328), the fixed (Master Slave) registers PB5 – PB2, and about the interrupt on PD2. (Of course in a first stage we tried to change the pin numbers but that failed, we now knew why.)

But the RF01 nor the RF02 worked. Finally after trying A tiny remark in the descriptions of the RF01 and RF02 explained why: before the datatransmission you have to send the command 0xC6 and this cannot be done SPI. SO this is why the examples use different (slower?) methods.

see for instance:, but more to the point just the datasheet of the atmega168. There you can also read about the interrupts.

Even before the RF12 lib of we found the RF01 and RF02 examples of Benedikt on but the first time around these did not function. Now, with more experience in settings and wiring these examples worked.

We got transmission using these slightly modified avr projects. The frequency is 434 MHz with the idea of also talking to the RF12. This last attempt failed, are there other settings?

two arduino’s with floating rf modules 01 and 02 working with the libraries

We used the RFM01_Eva (together with RFM02_Eva, and RFM12_Eva) to compare all kinds of settings.

The programming was done using AVR Studio 4 using a AVRISP mkII. We have made our own experimental board (minimal components) but also used the arduino with the programmer.

Then we made a first version of RF01 and RF02 libraries for the Arduino (arduino 18). This is relatively easy and gives us the freedom to include the wireless stuff in other arduino projects.

We combined it with the library we assembled using wiring and a liquid crystal display, to check what was sent and if it was sent well. ( using the liquid crystal I2C lib we had made earlier.)

Then we had these two test (arduino-) projects used to send and receive a simple text. (The receiver uses the Liquid Crystal AT161.) The pins used can be found in the library scripts.

Now we face the question: do we facilitate lots of fancy stuff and make the library less accessible or do we just provide a testing base for everyone to be extended?

🙂 the answer is this: sketches of the RF01 RF02 libs, working in the arduino version 018 can be downloaded here if you want another frequency than 433 you have to look at the code in the lib.

We always try to document the technical side togehter with experiments in design, so also a few pictures of PCB we made using ferroIIchloride. We have drawn with a marker on the copperplate and etched it for about an hour. This way we can make PCB’s which are more fun than the usual very straight rectangular boards…

a test of etching with a working sender RF02
a banana shaped etched pcb for an atmega168 and an RF01 and RF02, the components will all be surface mounted

One response to “RFM01 and RFM02 libraries (version 0.1) for arduino 18

  1. Pingback: Watson 8681 & RFM01 & Arduino « qlfecv's Blog

%d bloggers like this: