Maker.io main logo

BLE Signal Strength Monitoring in real-time Using Renesas RA4M2

2024-08-19 | By Sheikh Shuhad

License: General Public License Bluetooth / BLE

Introduction

This project demonstrates how to leverage the Renesas RA4M2 microcontroller, combined with the BleuIO Bluetooth Low Energy (BLE) USB dongle, to perform a wireless signal strength scan. It provides a practical example of how to use the USB Host Communication Device Class (HCDC) driver to communicate with a BLE device, highlighting how easy it is to create BLE applications using the BleuIO dongle.

By integrating these technologies, the project enables users to scan for nearby BLE devices, parse the Received Signal Strength Indicator (RSSI) from advertising data, and display it in real time using the RTTViewer. This setup offers a hands-on approach to understanding BLE communication and signal strength analysis.

Requirements

Setup

  • Connect a Micro USB device cable (type-A male to micro-B male) between J10 (Debug1) and a Computer USB port.
  • Plug in a BleuIO Dongle in the USB OTG Cable (type-A female to micro-B male) and connect it to J11 (USB Full Speed).
  • Make sure Jumper J12 is placed on pins 1-2
  • Remove Jumper J15 pins

Importing project

  • Open e² studio IDE
  • Choose a workspace and click ‘Launch’
  • Download or clone the example project. Place the folder ‘bleuio_ra4m2_rssi_scan_example’ in workspace.
  • Choose Import Project
  • Select ‘Existing Projects into Workspace’ under the ‘General’ tab:



ble signal strength monitor

  • Click the ‘Browse…’ button and open the folder where the ‘bleuio_ra4m2_rssi_scan_example’ project folder is located:


ble signal strength monitor

  • Finally select the project and click ‘Finish’. You have now imported the project!

Running the example

  • Go to file ‘usb_hcdc_app.c’ under ‘src/’ and edit line 54 to the mac address of the desired:

#define ADDR_TO_SCAN "[0]D0:76:50:80:01:75"

  • [0] = public address
  • [1] = private addressOn a closebeacon the mac address is printed on the back of the box (it will need to be converted to Hex):


ble signal strength monitor

  • For example: 208-118-080-128-001-117 in Hex is: D0-76-50-80-01-75
  • Build the project by clicking the building icon:

ble signal strength monitor

  • Use Debug to download and run the project. The first time you need to configure the debug settings. Click down arrow to the right of the Debug icon and select ‘Debug Configurations…

ble signal strength monitor

  • ’Under ‘Renesas GDB Hardware Debugging’ select ‘bleuio_ra4m2_rssi_scan_example.elf’ and click ‘Debug’.


ble signal strength monitor

  • The debug is now configured, and the ‘Debug’ icon can be used next time to run the project.
  • Open RTTViewer. Connect and use these settings:
  • Connection to J-Link: USBSpecify Target Device: R7FA4M2ADTarget Interface & Speed: SWD 4000kHzRTT Control Block: Address 0x2000095c


ble signal strength monitor

  • On the debugger screen in e² studio click the ‘Resume’ icon twice to run the project.


ble signal strength monitor

  • You should now see the output on the RTTViewer. Notice that when you move the scanned device closer to the BleuIO the RSSI value will increase.

Output

Below is the output screen that displays the RSSI values in real-time as the BleuIO dongle scans for nearby BLE devices:

ble signal strength monitor

ble signal strength monitor

Practical Use Cases

The BleuIO RA4M2 RSSI Scan Project can be applied in various scenarios where monitoring BLE signal strength is critical:

 

  • Proximity-Based Applications: By tracking RSSI values, developers can create proximity-based applications where actions are triggered based on the distance between BLE devices, such as automated check-ins, asset tracking, or location-based services.
  • Signal Strength Mapping: The project can be used to map signal strength in different environments, helping to optimize the placement of BLE devices like beacons in smart homes, retail stores, or industrial settings.
  • Device Tracking and Monitoring: In IoT applications, RSSI can be used to monitor the presence and movement of devices within a specific range, useful in security systems, inventory management, or environmental monitoring.

 

This project not only showcases the capabilities of the BleuIO dongle but also serves as a foundation for developing more complex BLE applications. Whether you’re a hobbyist, developer, or engineer, this project provides valuable insights into BLE communication and its practical applications.

制造商零件编号 SSD005/4-V2B
BLUETOOTH 5 LOW ENERGY USB DONGL
Smart Sensor Devices
制造商零件编号 SSD005/4-V2W
BLUETOOTH 5 LOW ENERGY USB DONGL
Smart Sensor Devices
制造商零件编号 RTK7EKA4M2S00001BE
EK-RA4M2 EVAL KIT FOR RA4M2
Renesas Electronics Corporation
制造商零件编号 SC0727
OTG ADAPTER
Raspberry Pi
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum