For this new project we will go a little further and make a case by 3D printing. We will stay on the 433MHz frequency by integrating a Superheterodyne KSA6 radio receiver. It is the most used radio frequency for home automation devices in Europe. If you live in other European countries or in the world, you can choose another frequency. For this project, I ordered the 3V3 version with an FTDI module from the Chinese manufacturer RobotDyn
I opted for the worst scenario when I bought my Arduino Mega. I bought the version 3V3 without integrated serial / USB converter 🙄 I preferred to buy the least user friendly version, just to wipe the plasters :D.
Unless special need, to build your Gateway, I advise you to opt for the version 5V with integrated FTDI converter. The board is slightly different (2mm longer, the implantation of fixing holes is substantially identical) but will be plug and play to install the firmware.
Regarding the rest of the material, you will need:
- Jumper Dupont male-male 10cm
- A mini breadboard
- A soldering SMA female connector
- One 433MHZ Superheterodyne receiver kSA6 or RXB6
- A 433MHz transmitter (often included with the Superheterodyne receiver), otherwise a low cost FS1000A receiver will do the trick.
- A 433MHz amplified 6dBi (or better) antenna with SMA connector
Count a budget of about €20, excluding printing of the case (about 7.6m, about 60g of PLA or ABS).
If you prefer to order from Amazon directly, everything is available except the Arduino Mega Pro Mini.
How to install the RFLink firmware on the Arduino Mega 2560 Pro Mini
Before we take care of the cabling, we must first upload the firmware. Go to the download page here to get the latest firmware image. The firmware is stored on a Google Drive. If the link is broken, please let me know in the comments.
Unzip the ZIP archive. The folder contains the firmware as well as a utility to upload the firmware to the Arduino. Sorry for Mac or Linux users, the installation tool is only available for Windows. If you are deadlocked, I can look how to do on macOS (and Linux). We should be able to get by with avrdude for Linux from the command line.
Connecting the FTDI module
The FTDI connector on Arduino Mega from Robotdyn is not standard. It is not possible to use (directly) the FTDI cable connector. As I had bought the module FTDI RobotDyn at the same time (less than €1 on AliExpress), the connection was no problem. Do not forget to cross the pins RX and TX so that the FTDI module can communicate with the Arduino Mega 2560. I plugged the RST pin as a precaution but it does not seem to me that it is necessary.
Install the RFLink firmware
Once everything is ready, plug the Arduino into a USB port and wait for the drivers to install. Then start the RFLink Loader program. Select the firmware binary file by clicking Select File. If the Arduino is not visible in the list, scan again after checking that the driver is correctly installed. Finally click on Upload / Program Firmware to device. The operation takes about 30 seconds. A display bug (on Windows 10) prevents to see the progress of the installation.
At the end of the installation, a window confirms that everything went smoothly. Open the serial port (Serial Port Logging) to verify that everything is working fine. If this is the case, you can switch to wiring and assembling the 3D printed box.
The Arduino Mega 2560 Pro Mini is not visible on the COM port
If the Arduino is not visible on the COM port, it is probably that the CH340 converter driver is not (correctly) installed. Go to the Windows Device Manager to install it manually. You can also follow this tutorial.
Rather than making a circuit on a PCB, I preferred a mini breadboard. It’s less expensive (logically, you’re only going to make one Gateway RFLink for your home automation system) and more flexible to add or replace a radio module. In addition, no welding to achieve, everyone can get started!
KSA6 or RXB6 Superheterodyne radio receiver module
To wire the 433MHz Superheterodyne receiver KSA6 or RXB6, connect the following pins
- + 5V. If you opt for the 5V model, you can use the + 5V broach on the Arduino Mega. If you chose the 3V3 model, use the 5V power pin on the FTDI module
- D16 on the DER pin
- D19 on the DATA pin
To increase the range of the gateway, I advise you to add an external antenna with SMA connector. Buy a 2.54 mm pitch SMA female solder connector that easily attaches to a breadboard. It takes a little force to insert it but once in place, it holds enough to support the weight of the antenna.
The external antenna must be powered with the + 5V of the Arduino board or FTDI module. Connect the GND pin (ground) of the SMA connector (outer pins) to the GND pin of the RXB6 or KSA6 radio receiver. Connect the antenna (ANT pin) to the center pin of the SMA connector.
433MHz FS1000A Radio Transmitter Module
The FS1000A radio module is powered directly from pin D15 of the Arduino Mega. Data is sent through pin D14. Connect the GND pin to the GND of the Arduino.
Here is an overall diagram that summarizes the connection of the two radio modules and the SMA connector on the mini breadboard.
Here are some photos of the circuit to help you realize your editing
RFLink Circuit: Arduino Mega 2560 Mini Pro FTDI 3V3 - 433MHz Superheterodyne Receiver KSA6 - SMA Connector - FTDI Module - Transmitter 433MHz FS1000A
RFLink mini housing box by 3D printing
I am not a very good designer. I propose you here a simple and effective form that will receive the Arduino Mega 2560 Pro Mini, the wired circuit on a mini breadboard, the serial / USB converter and the antenna. The box has two outputs for the micro-USB connector depending on the Arduino Mega2560 Pro Mini you choose. Normally, the hole in the cover is designed to receive most external antennas. However, if you need to make changes or want to improve the box, you will find the Fusion 360 (f3d), STEP and IGES files on Thingiverse and Cults3D.
Print settings used
I used an Anet A8 3D printer to make the prototype by printing directly to USB from Cura 3.1.1 with the following settings:
- Material used: PLA, diameter 1.75mm
- Head temperature: 200 ° C
- Preheating: 60 ° C
- Glass plate printing Neoceram 4mm (heat resistant)
- Hanging: styling spray
- Adhesion layer: Skirt (priming net before printing)
- Thickness of layer: 0.2mm
- Filling: 20%
- Print speed: 90mm/s
- Thickness of walls: 0.8mm
Assembling the case printed in 3D with the Anet A8
Nothing complicated for assembly. The Arduino Mega is placed in the bottom of the case. It is held in place with two pins. The FTDI module is placed vertically on the side of the Arduino Mega. Finally the mini breadboard comes to take place above the Arduino Mega.
Screw on the external antenna then close the housing with the cover. The lid just fits into the case.
That’s it, it’s over. All you have to do is follow the previous tutorials to integrate your compatible home automation devices with your home automation server Domoticz, Jeedom, Home Assistant (to name a few).
There are still some small adjustments to make on the case, feel free to use the 3D model to adapt to your needs.
- Gateway RFLink with RobotDyn Arduino Mega 2560 Pro Mini and 3D printed case
- #Guide: list of components to build an home automation RFLink 433MHz gateway (RFXCom clone)
- How to Include RFLink Radio Home Automation Devices at Home Assistant (HASS)
- How to build a RFLink 433MHz radio smarthome gateway for €10.50. Test with Domoticz
- ser2net: Serial USB Gateway to Ethernet. Test on RFLink with Domoticz