RAK16002 WisBlock Coulomb Szenzor User Guide

June 12, 2024
RAK

RAK16002 WisBlock Coulomb Szenzor

RAK16002 WisBlock Coulomb Szenzor

What Do You Need?

Before going through each and every step on using the RAK16002 WisBlock Coulomb sensor module, make sure to prepare the necessary items listed below:

Hardware

RAK16002 WisBlock Coulomb Sensor Module
WisBlock Base
Your choice of WisBlock Core
USB Cable
Li-Ion/LiPo battery (optional)
Solar charger (optional)

Software

Arduino

Product Configuration

Hardware Setup

RAK16002 is a Coulomb sensor module based on LTC2941IDCB that features programmable high and low thresholds for the accumulated charge. If a threshold is exceeded, the device communicates an alert by setting a flag in the internal status register. It can measure the battery charge state in battery-powered IoT devices. For more information about the RAK16002, refer to the Datasheet.

The RAK16002 WisBlock Coulomb sensor module can be mounted on the IO slot of the WisBlock Base board, as shown in Figure 1. Also, always secure the connection of the WisBlock module by using compatible screws. In this example, we use J2 shorted pin1 and pin2 (internal charge/load) and J4 shorted pin1 and pin2 (internal battery measurement). See Figure 2 for jumper and battery connector settings.

Figure 1: RAK16002 connection to WisBlock Base Board

Figure 2: RAK16002 jumper and battery connectors

NOTE

  • J2 charge/load select
    • short pin1 and pin2, Internal charge/load
    • short pin2 and pin3, External charge/load
  • J4 battery select
    • short pin1 and pin2, Internal battery measurement
    • short pin2 and pin3, External battery measurement
  • J3
    • pin1, Connect to external charge+/load+
    • pin2, Connect to external charge-/load- & battery
    • pin3, Connect to external battery+

Assembling and Disassembling of WisBlock Modules

Assembling Procedure

The RAK16002 module can be mounted on the IO slot of the WisBlock Base board, as shown in Figure 3. Also, always secure the connection of the WisBlock module by using compatible screws.
Figure 3: RAK16002 mounting connection to WisBlock Base module

Disassembling Procedure

The procedure in disassembling any type of WisBlock module is the same.

  1. First, remove the screws.
    Figure 4: Removing screws from the WisBlock module

  2. Once the screws are removed, check the silkscreen of the module to find the correct location where force can be applied.
    Figure 5: Detaching silkscreen on the WisBlock module

  3. Apply force to the module at the position of the connector, as shown in Figure 6, to detach the module from the baseboard.
    Figure 6: Applying even forces on the proper location of a WisBlock module

NOTE
If you will connect other modules to the remaining WisBlock Base slots, check on the WisBlock Pin Mapper tool for possible conflicts.

Now, you can connect the battery (optional) and USB cable to start programming your WisBlock Core.

Software Configuration and Example

In our example, you can measure voltage and DC current from a sensor.

These are the quick links that go directly to the software guide for the specific WisBlock Core module you use:

  • RAK16002 in RAK4631 WisBlock Core Guide
  • RAK16002 in RAK11200 WisBlock Core Guide
  • RAK16002 in RAK11310 WisBlock Core Guide

RAK16002 in RAK4631 WisBlock Core Guide

Arduino Setup

  1. Select the RAK4631 WisBlock Core.
    Install the RAKwireless Arduino BSP to find the RAK4631 in the Arduino Boards Manager.
    Figure 7: Selecting RAK4631 as WisBlock Core

  2. Next, copy the following sample code into your Arduino IDE:
    Click to view the example

  3. Once the example sketch is open, install the GROVE-Coulomb_Counter library by clicking the red-highlighted link, as shown in Figure 8 and Figure 9.
    Figure 8: Install GROVE-Coulomb_Counter Library

    Click on the Install button to finish the library installation.
    Figure 9: Arduino Library Manager GROVE-Coulomb_Counter

  4. Now, you can select the right port and upload the code, as shown in Figure 10 and Figure 11.
    Figure 10: Selecting the correct Serial Port

    Figure 11: Uploading the RAK16002 Sample code

    After a successful upload, open the Arduino Serial Monitor by clicking Tools->Serial Monitor and check the charge, capacity, and charge percentage.
    Figure 12: RAK16002 serial monitor

NOTE

If you experience any error in compiling an example sketch, check the updated code for the RAK16002 WisBlock Core Module that can be found on the RAK16002 WisBlock Example Code Repository .

RAK16002 in RAK11200 WisBlock Core Guide

Arduino Setup

  1. Select the RAK11200 WisBlock Core.
    Install the RAKwireless Arduino BSP to find the RAK11200 in the Arduino Boards Manager.
    Figure 13: Selecting RAK11200 as WisBlock Core

  2. Next, copy the following sample code into your Arduino IDE:
    Click to view the example

  3. Once the example sketch is open, install the GROVE-Coulomb_Counter library by clicking the red-highlighted link, as shown in Figure 14 and Figure 15.
    Figure 14: Install GROVE-Coulomb_Counter Library

    Click on the Install button to finish library installation.
    Figure 15: Install GROVE-Coulomb_Counter Library

  4. Now, you can select the right port and upload the code, as shown in Figure 16 and Figure 18.
    Figure 16: Selecting the correct Serial Port

    Before uploading your sketch, short circuit BOOT0 and GND pin and press the reset button. Then click the Upload button.
    Figure 17: Force ESP32 download mode

Figure 18: Uploading the RAK16002 sample code

After a successful upload, open the Arduino Serial Monitor by clicking Tools -> Serial Monitor and check the charge, capacity, and charge percentage.

Figure 19: RAK16002 serial monitor

NOTE

If you experience any error in compiling an example sketch, check the updated code for the RAK16002 WisBlock Core Module that can be found on the RAK16002 WisBlock Example Code Repository .

RAK16002 in RAK11310 WisBlock Core Guide

Arduino Setup

  1. Select the RAK11310 WisBlock Core.
    Install the RAKwireless Arduino BSP to find the RAK11310 in the Arduino Boards Manager.
    Figure 20: Selecting RAK11300 as WisBlock Core

  2. Next, copy the following sample code into your Arduino IDE:
    Click to view the example

  3. Once the example sketch is open, install the GROVE-Coulomb_Counter library by clicking the red-highlighted link, as shown in Figure 21 and Figure 22.
    Figure 21: Install GROVE-Coulomb_Counter Library

    Click on the Install button to finish library installation.
    Figure 22: Install GROVE-Coulomb_Counter Library

  4. Now, you can select the correct port and upload the code, as shown in Figure 23 and Figure 24.
    Figure 23: Selecting the correct Serial Port

    Figure 24: Uploading the RAK16002 Sample code

After a successful upload, open the Arduino Serial Monitor by clicking Tools -> Serial Monitor and check the charge, capacity, and charge percentage.
Figure 25: RAK16002 serial monitor

NOTE

If you experience any error in compiling an example sketch, execute the following steps:

  1. Run the post_install script to install the missing drivers. You have to go to %userprofile%\AppData\Local\Arduino15\packages\rakwireless\hardware\mbed_rp2040\0.0.6 and run post_install.bat .
  2. Check the updated code for the RAK16002 WisBlock Core Module that can be found on the RAK16002 WisBlock Example Code Repository .

Logo

References

Read User Manual Online (PDF format)

Read User Manual Online (PDF format)  >>

Download This Manual (PDF format)

Download this manual  >>

Related Manuals