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.
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.
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.
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)
// Enable debug prints to serial monitor
#define MY_DEBUG
// Enable and select radio type attached
#define MY_RADIO_NRF24
#define MY_RF24_PA_LEVEL RF24_PA_MAX
// Enable gateway ethernet module type
#define MY_GATEWAY_W5100
// Enable Soft SPI for NRF radio (note different radio wiring is required)
// The W5100 ethernet module seems to have a hard time co-operate with
// radio on the same spi bus.
#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
// When W5100 is connected we have to move CE/CSN pins for NRF radio
#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 // If this is disabled, DHCP is used to retrieve address
// Renewal period if using DHCP
//#define MY_IP_RENEWAL_INTERVAL 60000
// The port to keep open on node server mode / or port to contact in client mode
#define MY_PORT 5003
// Controller ip address. Enables client mode (default is "server" mode).
// Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere.
//#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 254
// The MAC address can be anything you want but should be unique on your network.
// Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use.
// Note that most of the Ardunio examples use "DEAD BEEF FEED" for the MAC address.
#define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0x01, 0x08 //AF-A0-F2-15-3B-1C
// Set blinking period
#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() {
}
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)
Im using this mount for the Arduino UNO + Shields, but any mount would probably do.
Created in Kicad5 (rescued from Kicad4 - I hope this does not create issues importing the files)
Name | Size | # Downloads |
---|---|---|
CHANGES.txt | 790 B | 288 |
COPYRIGHT.txt | 421 B | 290 |
License.txt | 8.94 kB | 289 |
License_howto.pdf | 55.06 kB | 168 |
PRODUCT.txt | 113 B | 301 |
Su_Mys_Gateway.pdf | 58.14 kB | 205 |
Su_Mys_Gateway.net | 23.75 kB | 414 |
Su_Mys_Gateway.kicad_pcb | 307.08 kB | 367 |
Su_Mys_Gateway.pro | 884 B | 368 |
Su_Mys_Gateway.sch | 26.82 kB | 400 |