Real-Time CO2 Monitoring with Renesas EK-RA4M2, RRH47000 CO2 Sensor, and BleuIO Pro Dongle
October 20, 2024Introduction
This project demonstrates how to integrate the Renesas EK-RA4M2 development board with the Renesas CO2 Sensor (RRH47000) and the new BleuIO Pro Dongle (SSD025) by Smart Sensor Devices, built on the Renesas Bluetooth Low Energy SoC DA14695. In this setup, the dongle advertises sensor data from the CO2 sensor, including CO2 concentration, humidity, and temperature.
The sensor data is displayed using the RTT Viewer.
Requirements
- EK-RA4M2
- BleuIO – Bluetooth Low Energy USB Dongle
- FSP Platform Installer (Includes e² studio IDE, toolchain, and FSP packs)
- J-Link RTT Viewer
- USB OTG Cable (USB-A, USB-B micro)
- Renesas RRH47000
- Our example project [Download from GitHub]
Setup
- Connect a Micro USB device cable (Type-A male to Micro-B male) between J10 (Debug1) on the EK-RA4M2 and a computer’s USB port.
- Plug in the BleuIO Dongle using a USB OTG Cable (Type-A female to Micro-B male) and connect it to J11 (USB Full Speed).
- Ensure that Jumper J12 is placed on pins 1-2.
- Remove Jumper J15 pins.
Setting up PMOD1
The RRH47000 sensor connects via PMOD1. Since the sensor requires 5V, and PMOD by default provides 3.3V, some modifications are necessary:
- For 5V the PMOD1 Config trace cut jumper E17 must be Short and E16 be Open.
For I2C SCL E18 need to be Short and E14 need to be Open.
For I2C SDA E19 need to be Short and E15 need to be Open.
- The PMOD1 config can be found on the back of the RA4M2:
Importing the Project
- Open e² studio IDE
- Choose a workspace and click ‘Launch’
- Download or clone the example project. Place the folder ‘bleuio_ra4m2_co2_monitor_example’ in workspace.
- Choose Import Project
- Select ‘Existing Projects into Workspace’ under the ‘General’ tab:
- Click the ‘Browse…’ button and open folder where the ‘bleuio_ra4m2_co2_monitor_example’ project folder is located:
- Finally select the project and click ‘Finish’. You have now imported the the project!
Running the Example
Build the project by clicking the building icon:
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…’
Under ‘Renesas GDB Hardware Debugging’ select ‘bleuio_ra4m2_co2_monitor_example.elf’ and click ‘Debug’.
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: USB
Specify Target Device: R7FA4M2AD
Target Interface & Speed: SWD 4000kHz
RTT Control Block: Address 0x200009ac
On the debugger screen in e² studio click the ‘Resume’ icon twice to run the project.
- The application is now running. When starting up you should notice all LEDs lighting up for one second then only the red LED will be on. It will turn off as soon as the BleuIO is configured and the green LED will turn on when advertising start.
- You should now see the output on the RTTViewer.
Scanning the Dongle
To view the advertised data, use an app like nRF Connect.
Decoding the Advertising Message
The advertising data format is as follows:
- 020106: Default advertising flag for connectable devices.
- 09FF3600026E173E1D27: Manufacturer-specific data.
- 09: Message size.
- FF: Manufacturer Specific Data flag.
- 3600: Renesas Manufacturer ID (little-endian).
- 026E: CO2 value in hex (622 in decimal).
- 173E: Temperature value, split into two bytes (23.62°C).
- 1D27: Humidity value, split into two bytes (29.39%).
This example serves as a foundational guide for integrating the Renesas EK-RA4M2 development board with a CO2 sensor and the BleuIO Pro Dongle for real-time monitoring. With its flexible setup, you can extend this project to suit your specific applications, such as real-time air quality monitoring, smart building systems, or other IoT-based environmental solutions. By leveraging the capabilities of the BleuIO Pro and Renesas platform, you can create robust, scalable solutions for your next Bluetooth Low Energy (BLE) project.