RAK13007 WisBlock Relay Module Quick Start Guide
Prerequisite
What Do You Need?
Before going through each and every step on using the RAK13007 WisBlock module, make sure to prepare the necessary items listed below:
Hardware
- RAK13007 WisBlock Relay Module
- Your choice of WisBlock Base
- Your choice of WisBlock Core
- USB Cable
- Li-Ion/LiPo battery (optional)
- Solar charger (optional)
Software
- Download and install the ArduinoIDE.
- To add the RAKwireless Core boards on your Arduino board, install the RAKwireless Arduino BSP. Follow the steps in the GitHub repo.
Product Configuration
Block Diagram
The RAK13007 uses one relay to isolate the output of the MCU. The dielectric strength between coil and contacts of a relay is 2500 VDC, 50/60 Hz 1 min.
Hardware Setup
RAK13007 is a WisBlock Interface module that extends the WisBlock system to be used on isolated digital output applications. There is one digital output that is isolated by an electromechanical relay. The RAK13007 digital output is used to programmatically switch on/off devices operating at high voltage or high current applications.
For more information about RAK13007, refer to the Datasheet.
Assembling and Disassembling of WisBlock Modules
Assembling
The RAK13007 module can be mounted on the IO slot of the WisBlock Base board, as shown in Figure 4. Also, always secure the connection of the WisBlock module by using compatible screws.
Disassembling
The procedure in disassembling any type of WisBlock modules is the same.
- First, remove the screws.
- Once the screws are removed, check the silkscreen of the module to find the correct location where force can be applied.
- Apply force to the module at the position of the connector, as shown in Figure 7, to detach the module from the base board.
If you will connect other modules to the remaining WisBlock Base slots, check on the WisBlock Pin Mapper tool for possible conflicts.
After all this setup, you can now connect the battery (optional) and USB cable to start programming your WisBlock Core.
- Batteries can cause harm if not handled properly.
- Only 3.7-4.2 V Rechargeable LiPo batteries are supported. It is highly recommended not to use other types of batteries with the system unless you know what you are doing.
- If a non-rechargeable battery is used, it has to be unplugged first before connecting the USB cable to the USB port of the board to configure the device. Not doing so might damage the battery or cause a fire.
- Only 5 V solar panels are supported. Do not use 12 V solar panels. It will destroy the charging unit and eventually other electronic parts.
- Make sure the battery wires match the polarity on the WisBlock Base board. Not all batteries have the same wiring.
Software Configuration and Example
In the example, you will be using the 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_IO4
for Relay Output pin
Initial Test of the RAK13007 WisBlock Module
Arduino Setup
Figure 8 is an illustration on how to use the RAK13007 relay for switching applications. You can connect any module or device to the RAK13007 as long as it operates on its recommended voltage rating.
If you have 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.
RAK4631 Board
RAK11200 Board
RAK11310 Board
- 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, as shown in Figure 12 and Figure 13.
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.
- 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.