RFM69 REMOTE CONTROL
The RFM69 Remote is an Arduino based remote control to communicate with other RFM69 devices.
Hardware Spec
- RFM69 module
- 1" Oled SCreen
- 5 Buttons Keypad
- Atmega328p chip 8Mhz
- Battery operated
- Recharge via USB
- Program via USB
- Compatible 315/433/868/915Mhz.
Note the unit is sold without RFM69 module. This has to be soldered by the user.
Battery and antenna are also not part of the base product.
Software
Basics
The RFM69 Remote is programmed using Arduino IDE via USB.
These are the settings to be used in the IDE under Tools
before uploading the sketch.
Libraries
There are several libraries that we recommend to help you programming the remote control.
SSD1306Ascii. This library will deal with displaying text on the Oled screen. It is particularily well suited for low memory usage. Note this does not support graphics. This is text only.
RFM69 Library. The library driver for the RFM69 module itself.
OnePinKeypad. The library for the the 5 buttons keypad. It supports pressed, release and long press actions.
Examples
Simple Rx
This is a simple receiving example below. This example displays any RF data sent to the remote.
// Example Rx 01
// LeChacal.com
// Example use with RFM69 Remote Control.
// Prints any receiving rf data on screen.
// Network id hardcoded to 1. No encryption.
// Required libraries
//
// SSD1306Ascii
// https://github.com/greiman/SSD1306Ascii/releases
// RFM69
// https://github.com/LowPowerLab/RFM69/releases
// Set your own node id below
#define MYNODEID 1 // This device Node ID.
// Uncomment the required frequency below.
//#define FREQUENCY RF69_315MHZ
#define FREQUENCY RF69_433MHZ
//#define FREQUENCY RF69_868MHZ
//#define FREQUENCY RF69_915MHZ
#include "SSD1306Ascii.h"
#include "SSD1306AsciiWire.h"
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
SSD1306AsciiWire oled;
#include <RFM69.h>
RFM69 radio;
void setup() {
Serial.begin(115200);
Serial.print("RFM69 Remote Rx example 001, ");
Serial.print("Node ID: ");
Serial.println(MYNODEID, DEC);
// Setting up the oled screen with a nice font.
oled.begin(&Adafruit128x64, 0x3C);
oled.set2X();
oled.setFont(System5x7);
oled.clear();
oled.print("waiting...");
// Radio initialisation
if (!radio.initialize(FREQUENCY, MYNODEID)) {
Serial.println("Initialize Failure");
}
else {
radio.setHighPower(); // Always use this for RFM69HCW
}
}
void loop() {
if (radio.receiveDone())
{
oled.clear();
oled.print("from: ");
oled.println(radio.SENDERID); // who is sending
for (uint8_t i = 0; i < radio.DATALEN; i++) {
oled.write((char)radio.DATA[i]);
}
oled.println();
oled.print("rssi: ");
oled.println(radio.RSSI);
}
}
Simple Tx
The second example below shows how to send RF data using the 5 buttons keypad. When a button is pressed it sends a text to the other device.
// Example Tx 01
// LeChacal.com
// Example use with RFM69 Remote Control.
// Sends over rf which button is pressed.
// Result is also printed on the screen.
// Required libraries
//
// SSD1306Ascii
// https://github.com/greiman/SSD1306Ascii/releases
// RFM69
// https://github.com/LowPowerLab/RFM69/releases
// OnePinKeypad
//
// Set your own node id below
#define MYNODEID 1 // This device Node ID.
#define SENDTOID 2
// Uncomment the required frequency below.
//#define FREQUENCY RF69_315MHZ
#define FREQUENCY RF69_433MHZ
//#define FREQUENCY RF69_868MHZ
//#define FREQUENCY RF69_915MHZ
#include "SSD1306Ascii.h"
#include "SSD1306AsciiWire.h"
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
SSD1306AsciiWire oled;
#include <RFM69.h>
RFM69 radio;
#include "OnePinKeypad.h"
keypad Keypad;
void setup() {
Serial.begin(115200);
Serial.print("RFM69 Remote Tx example 001, ");
Serial.print("Node ID: "); Serial.println(MYNODEID, DEC);
// Setting up the oled screen with a nice font.
oled.begin(&Adafruit128x64, 0x3C);
oled.set2X();
oled.setFont(System5x7);
oled.clear();
oled.print("waiting...");
// Radio initialisation
if (!radio.initialize(FREQUENCY, MYNODEID)) {
Serial.println("Initialize Failure");
}
else {
radio.setHighPower(); // Always use this for RFM69HCW
}
}
void loop() {
Keypad.update(); // Reading what key is pressed
if (Keypad.state == RELEASED_SELECT) {
radio.send(SENDTOID, "ok", 3); // length is 3. 2 for ok plus 1 for the ending 0.
oled.clear(); oled.print("ok");
Keypad.closeEvent(); // Close the keypad event to indicate we are done with the last event.
}
else if (Keypad.state == RELEASED_UP) {
radio.send(SENDTOID, "up", 3);
oled.clear(); oled.print("up");
Keypad.closeEvent();
}
else if (Keypad.state == RELEASED_DOWN) {
radio.send(SENDTOID, "down", 5);
oled.clear(); oled.print("down");
Keypad.closeEvent();
}
else if (Keypad.state == RELEASED_LEFT) {
radio.send(SENDTOID, "left", 5);
oled.clear(); oled.print("left");
Keypad.closeEvent();
}
else if (Keypad.state == RELEASED_RIGHT) {
radio.send(SENDTOID, "right", 6);
oled.clear(); oled.print("right");
Keypad.closeEvent();
}
}