RAK5802 WisBlock RS485 Interface Module Quick Start Guide
Prerequisite
- Assemble the RAK5802 with a WisBlock Base and WisBlock Core by following the RAK5802 Installation Guide.
- Download and install the Arduino IDE, then add the RAKwireless Core boards by installing the RAKwireless Arduino BSP.
- 2 x USB Cable
- Li-Ion/LiPo battery (optional)
- Solar charger (optional)
Software Configuration and Example
A ready-to-use SW library and tutorial make it easy to connect any sensor that is using the RS485 interface.
The sample code will require two sets of WisBlock Base, WisBlock Core and WisBlock RS485 Interface Module. You only need to connect the two wires of the RS485 bus.
Figure 1: Connection DiagramInitial Test of the RAK5802 WisBlock Module
- This guide uses the RAK4631 WisBlock Core to demonstrate the configuration and upload process. The example is also compatible with other WisBlock Cores, including the RAK11200 and RAK11310.
- When using the RAK11200 WisBlock WiFi Module, configure the BOOT0 pin properly before uploading the firmware. Incorrect BOOT0 configuration may cause the firmware upload to fail. For more information, refer to the RAK11200 Quick Start Guide.
If you already installed the RAKwireless Arduino BSP, the WisBlock Core and example code should now be available on the Arduino IDE.
- You need to select first the WisBlock Core you have.
Figure 1: Selecting RAK4631 as WisBlock Core- The Basic Sample Code for RAK5802 in GitHub will work on all WisBlock Core. You can open the example codes depending on your WisBlock Core.
Figure 1: Opening RAK5802 example code for RAK4631 WisBlock Core- Once the example code is open, install the Arduino RS485 library by clicking the yellow-highlighted link. Or, if you are using Modbus protocol, install the Arduino Modbus.
Figure 1: Installing the compatible library for RAK5802 Module
Figure 1: Accessing the library used for RAK5802 Module- After successful installation of the library, you can now select the right serial port and upload the 'Receiver' code to the first board and 'Sender' code to the second board.
Figure 1: Selecting the correct Serial Port
Figure 1: Uploading the RAK5802 example code- When you successfully uploaded the example sketch, connect the board with the 'Receiver' code, open the Serial Monitor of the Arduino IDE, and power the 'Sender' board via USB or Battery to see the reading logs. If you see the logs, then your RAK5802 is properly communicating to the WisBlock core.
Figure 1: RAK5802 data logs from 'Sender' boardResources
For software development with the RAK5802, refer to the following sample code and application examples for supported WisBlock Core modules.
WisBlock Core RAK4630:
- Sample Code: RAK5802 RS485
- Sample Code: Intelligent Agriculture
- Sample Code: Soil Conductivity Monitoring
- Sample Code: PAR Monitoring
- Sample Code: Soil pH_Monitoring
- Sample Code: Wind Speed Monitoring
WisBlock Core RAK11200:
WisBlock Core RAK11300:
