RAK13007 WisBlock Relay Module Quick Start Guide
Prerequisite
- Assemble the RAK13007 with a WisBlock Base and WisBlock Core by following the RAK13007 Installation Guide.
- Download and install the Arduino IDE, then add the RAKwireless Core boards by installing the RAKwireless Arduino BSP.
- USB Cable
- Li-Ion/LiPo battery (optional)
- Solar charger (optional)
Initial Test of the RAK13007 WisBlock Module
Before connecting high-voltage modules to the RAK13007, make sure to follow safety precautions. For RAK13007, the accessible pin assignment is defined as follows in the Arduino IDE:
WB_IO4for Relay Output pin
The RAK13007 relay can be used for switching applications. You can connect any module or device to the RAK13007 as long as it operates within its recommended voltage rating.
Figure 1: RAK13007 switching the LED- This guide uses the RAK4631 WisBlock Core to demonstrate the configuration process. You can also use the RAK11200 or RAK11310 as the WisBlock Core.
- When using the RAK11200, configure the BOOT0 pin correctly before uploading the source code. Otherwise, the upload may fail. For detailed instructions, refer to the RAK11200 Quick Start Guide.
- You need to select first the WisBlock Core you have.
Figure 1: Selecting RAK4631 as WisBlock Core- Next, copy the following sample code into your Arduino IDE:
/**
@file RAK13007_Relay_G5LE-14-DC3.ino
@author rakwireless.com
@brief Withstands impulse of up to 4,500 V
@version 0.1
@date 2021-8-28
@copyright Copyright (c) 2020
**/
#include <Wire.h>
void setup() {
pinMode(WB_IO2, OUTPUT);
digitalWrite(WB_IO2, HIGH);
pinMode(WB_IO4, OUTPUT);
// Initialize serial for output.
Serial.begin(115200);
}
void loop() {
digitalWrite(WB_IO4, LOW);
delay(5000);
digitalWrite(WB_IO4, HIGH);
delay(5000);
}
If you experience any error in compiling the example sketch, check the updated code for your WisBlock Core Module that can be found on the RAK13007 WisBlock Example Code Repository. This sample code in Github will work on all WisBlock Core.
- Once the example code is open, you can now select the right serial port and upload the code.
If you're using the RAK11200 as your WisBlock Core, the RAK11200 requires the Boot0 pin to be configured properly first before uploading. If not done properly, uploading the source code to RAK11200 will fail. Check the full details on the RAK11200 Quick Start Guide.
Figure 1: Selecting the correct Serial Port
Figure 1: Uploading the RAK13007 example code- When you have successfully uploaded the example sketch, you will now see the RAK13007 Relay module switches the LED on and off every 5 seconds. Also, notice that the built-in red led on the RAK13007 module lights on when there is contact, or it is normally closed, and then lights off when it is normally open. You'll also be able to hear clicking sounds from the RAK13007 module, which means that the relay is switching.
