This is a PCB used as a shield on top on a Arduino Uno, with or without a ethernet shield (W5100), powering a Nrf24l01+ or RFM69 radio with a dedicated voltage regulator, atsha hardware for message signing and onboard reset/inclusion mode and status leds.
Why?
A reliable gateway is a key in your MySensors network. In the same time, making it modular and easy to replace/upgrade parts if needed is something I have needed for a long time. For me, I also wants to use both RFM and NRF radio and in this you get the package of the two radios into one - just to hook up with a Arduino Uno. This makes it quick, easy and reliable. Modular and easy to update and debug is the keyword here. A gateway in a fancy case or wires everywhere makes your work hard when you want to debug or update. With this, everything is wired correctly, everything is easy access and if you want to change something you can just remove and replace the shield with a spare one. This is also designed to fit nicely in a network rack-cabinet.
What?
A shield in a Arduino Uno dimension, using softSPI for the radio SPI communication to allow an ethernet shield in between the Arduino UNO and the gateway shield. There is a dedicated powersupply (LM1117 3.3) that can support up to 800mA current allowing a Nrf24l01+ PA/LNA to run without power issues. Using RFM69 (3.3v logic level) each SPI line has its own logic level converter using BSS118. Easy to access reset and inclusion mode on the front as well as 3x status LEDS.
How?
Nrf24l01+
Buiding the gateway is straight forward, with good space and common components. Solder pinheaders, radio, caps, voltage regulator, led+resistors and buttons for reset and inclusion mode(optional) and atsha chip (signing, optional).
old image - updates has been made to LED alignment and outer dimensions
Thats it - hook it up to your Arduino uno, attach ethernet shield in between if you want to run it as a Ethernet gateway (otherwise it will be a serial gateway).
old image - updates has been made to LED alignment and outer dimensions
Upload your gateway code using Arduino IDE.
Ethernet Gateway (MySensors 2.3)
#define MY_DEBUG
#define MY_RADIO_NRF24
#define MY_RF24_PA_LEVEL RF24_PA_MAX
#define MY_GATEWAY_W5100
#if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD)
#define MY_SOFTSPI
#define MY_SOFT_SPI_SCK_PIN 14
#define MY_SOFT_SPI_MISO_PIN 16
#define MY_SOFT_SPI_MOSI_PIN 15
#endif
#ifndef MY_RF24_CE_PIN
#define MY_RF24_CE_PIN 5
#endif
#ifndef MY_RF24_CS_PIN
#define MY_RF24_CS_PIN 6
#endif
#define MY_IP_ADDRESS 192,168,1,8
#define MY_PORT 5003
#define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0x01, 0x08
#define MY_DEFAULT_LED_BLINK_PERIOD 300
#include <SPI.h>
#if defined(MY_USE_UDP)
#include <EthernetUdp.h>
#endif
#include <Ethernet.h>
#include <MySensors.h>
void presentation(){
}
void setup(){
}
void loop() {
}
RFM Radio
Solder radio, pinheaders, caps, voltage regulator, led+resistors and buttons for reset and inclusion mode(optional) and atsha chip (signing, optional). If you are using the RFM69 radio you will also have to add resistors and logic level converters for the radio SPI bus. At this point, its not possible to use RFM69 radio with softSPI so you need to attach 4 wires, (D13<>A0, D12<>A2, D11<>A1, 10<>D6)
Cases
Im using this mount for the Arduino UNO + Shields, but any mount would probably do.
Work in progress / To next revision
- Confirmed working for Ethernetshield + Nrf24l01+ PA/LNA
- NOT confirmed for RFM69 > Issues with softSPI or SoftSPI in combination with logic level conversion using RFM driver (Logic level conversion works fine without softSPI). Not possible at this time to use RFM with Ethernet Module.
- Its possible to hardwire (cut pinheader and solder wires directly to hardware SPI on the uno for a RFM Serial Gateway)
- Add RX/TX led on shield?
Notes
Created in Kicad5 (rescued from Kicad4 - I hope this does not create issues importing the files)