In this tutorial, we demonstrate how to use the Renesas EK-RA4M2 MCU, the Renesas RRH62000 All-in-One Air Quality Sensor Module, and the BleuIO Bluetooth Low Energy (BLE) USB Dongle to collect and transmit air quality data wirelessly. The RRH62000 sensor module measures key environmental parameters such as:
- eCO₂ (Equivalent Carbon Dioxide)
- Humidity (%)
- Temperature (°C)
- Particulate Matter (PM1, PM2.5, PM10) (µm/cm³)
- Total Volatile Organic Compounds (TVOC) (mg/m³)
- Indoor Air Quality Index (IAQ)
The EK-RA4M2 MCU reads data from the sensor via I²C, processes the information, and transmits it over BLE using the BleuIO USB dongle. The advertised data can be monitored using BLE scanning applications, and the sensor values can also be displayed in RTTViewer on a connected PC.
Requirements
Before getting started, ensure you have the following hardware and software:
Hardware
- EK-RA4M2 MCU
- BleuIO – Bluetooth Low Energy USB Dongle
- Renesas RRH62000 All-in-One Integrated Air Quality Sensor
- USB OTG Cable (USB-A to micro-B)
- Micro USB cable (for debugging)
Software
- FSP Platform Installer (e² studio IDE & toolchain, FSP version ≥ 5.7.0)
- J-Link RTT Viewer
- BLE Scanning App (e.g., nRF Connect)
You can download the complete example project here:
➡️ GitHub Repository
Hardware Setup
Connecting EK-RA4M2 and BleuIO Dongle
- Connect EK-RA4M2 to your PC using a micro-USB cable via the J10 (Debug1) port.
- Plug the BleuIO dongle into a USB OTG cable and connect it to J11 (USB Full Speed) on the EK-RA4M2 board.
- Set jumpers:
- Place J12 on pins 1-2.
- Remove J15 completely.
Reference Diagram:
Connecting RRH62000 Air Quality Sensor
Connect the RRH62000 sensor module to EK-RA4M2 as follows:
- Power: Connect 5V and GND from RRH62000 to 5V and GND on EK-RA4M2.
- I²C Communication:
- SCL (Clock) → SCL on EK-RA4M2
- SDA (Data) → SDA on EK-RA4M2
- GND → GND on EK-RA4M2
Reference Diagrams:
Importing the Project into e² Studio
- Open e² Studio IDE and choose a workspace. Click Launch.
- Download or clone the project from GitHub and place the “bleuio_ra4m2_rrh62000_example” folder inside your workspace.
- Go to File → Import and select Existing Projects into Workspace under the General tab.
- Click Browse… and locate the project folder.
- Select the project and click Finish to import it.
Importing Example Project:
Building and Running the Example
- Build the project by clicking the build icon.
-
Set up debugging:
- Click the down arrow next to the Debug icon and select Debug Configurations…
- Under Renesas GDB Hardware Debugging, choose bleuio_ra4m2_sensor_rrh62000_example Debug_Flat and click Debug.
- Click the down arrow next to the Debug icon and select Debug Configurations…
-
Run the program:
- Open RTTViewer and connect using the following settings:
- Connection to J-Link: USB
- Target Device: R7FA4M2AD
- Interface & Speed: SWD, 4000 kHz
- RTT Control Block Address: 0x200009dc
- Open RTTViewer and connect using the following settings:
-
The program starts running:
- All LEDs turn on for 1 second, then only the red LED remains on.
- The red LED turns off when BleuIO is initialized.
- The green LED turns on when advertising starts.
Scanning and Decoding BLE Advertising Data
Scan the Dongle using nRF Connect
Use a BLE scanning app like nRF Connect to view the advertised data:
Decoding the Advertising Message
Example raw BLE advertisement:
02010619FF3600016491803010300030105060306080192
All air quality sensor values except eCO2 is split into two bytes. The first byte is the whole number and the second byte is the decimal. For example
1649 is the temperature value. The whole number is 16 and the decimal is 49. Converting it from hex gives
us: 23.73 °C
The eCO2 value is 2 bytes, big endian.
Breaking it down:
Data | Description | Decoded Value |
---|---|---|
020106 |
Advertising flag (connectable) | – |
19 |
Message size | – |
FF |
Manufacturer Specific Data | – |
3600 |
Renesas Manufacturer ID (Little Endian) | – |
Air Quality Advertised Data | ||
1649 |
Temperature (°C) | 23.73°C |
1803 |
Humidity (%RH) | 24.3% RH |
0103 |
IAQ Index | 1.3 |
0003 |
TVOC (mg/m³) | 0.3 mg/m³ |
0105 |
PM1 (µm/cm³) | 1.5 |
0603 |
PM2.5 (µm/cm³) | 6.3 |
0608 |
PM10 (µm/cm³) | 6.8 |
0192 |
eCO₂ (ppm) | 402 ppm |
This project successfully demonstrates how to use the BleuIO Bluetooth dongle, EK-RA4M2 MCU, and Renesas RRH62000 sensor to wirelessly monitor air quality. The BLE advertisements can be scanned and decoded to extract real-time air quality data.
For the full source code and updates, visit:
➡️ GitHub Repository