Overview
In this tutorial, we will learn about the REYAX RYB080I BLE Module & its interfacing with the Arduino. The REYAX RYB080I is an ultra-low-power Bluetooth module from Reyax Technology. The Bluetooth is based on Texas Instrument Chip & called Reyax RYB080I BLE Chip. We will go through the features, specifications & power consumption of this Bluetooth module and compare it with other classic Bluetooth modules like HC-05 or HC-06. Earlier we learned about HM-10 BLE 4.0 Module & also NRF52840 BLE 5.2 Module.
Then we will make a few projects using this REYAX RYB080I BLE Module & Arduino. First, we will make a Smart Pulse Oximeter project and measure our Blood Oxygen & Heart Rate. The BPM & SpO2 value be displayed on Android App. In the second example, we will send the DHT11 Humidity Temperature Data to Android Application wirelessly. This will be like a weather station. In the 3rd example project, we will control multiple LEDs by sending some commands from the Android Application.
Bill of Materials
Following are the list of components used in this tutorial. All the components can be easily purchased from Amazon. The component purchase link is added as well.
S.N. | Components Name | Quantity | Purchase Links |
---|---|---|---|
1 | Arduino Nano Board | 1 | Amazon | AliExpress |
2 | MAX30100 Pulse Oximeter Sensor | 1 | Amazon | AliExpress |
4 | 0.96" I2C OLED Display | 1 | Amazon | AliExpress |
5 | Reyax Bluetooth Module RYB080I_lite BT | 1 | Amazon |
6 | LED 5mm Any Color | 3 | Amazon | AliExpress |
7 | DHT11 Sensor | 1 | Amazon | AliExpress |
8 | Connecting Wires | 10 | Amazon | AliExpress |
9 | Breadboard | 1 | Amazon | AliExpress |
REYAX RYB080I BLE Module
This is an RYB080I Bluetooth v4.2 & v5.0 Bluetooth Low Energy Module. The module is very small in size and powerful enough to add wireless connectivity to your projects. This BLE Module is based on Texas Instrument CC2640R2F ARM Cortex M3 industry-standard chip. The ultra low power BLE module can be used in a project where the size and power matters a lot.
While comparing the size of this RYB080I Bluetooth Module with a classic Bluetooth module like HC-05 or HC-06, you will know the size is lesser than half. All of them are UART Modules & work on AT Commands.
There are 5 pins on this BLE Module. They are VDD which needs a 3.3V Power supply. Then it has pins like Tx & Rx for UART Communication. It has a Reset pin for resetting the module. And finally a GND ground pin. It is preferred to use this module with low power controllers. Since, its UART pins are only compatible with 3.3V, we cannot connect the module to the 5V digital UART pins of the microcontroller. You can power this module using a coin cell or any lithium-ion battery.
Features
• Bluetooth v4.2 & v5.0 with Bluetooth Low Energy
• TI CC2640R2F ARM® Cortex®-M3 industry-standard chip
• Can connect two Bluetooth devices at the same time
• Support Host-Client role.
• Designed with PCB integrated antenna
• Metal cover against EMI interference
• Transmitting, Receiving, Wake-up by only 2 UART pins
• Control easily by AT commands
• Standard Generic Attribute Profile (GATT)
Power Consumptions
The module operates between a minimum of 1.8V to 3.8V maximum. The output ranges from -21 to +5 dBm. The active current is around 1.5mA in broadcasting mode. In broadcast mode, the average advertising current is around 0.2mA. You can go through the RYB080I datasheet to learn more about the advertising current. Similarly, the standby current is only 2uA and takes 2 milliseconds to wake up from sleep mode.
You can choose the baud rate either 9600 or 115200. The Radiofrequency is around 2.4 GHz normally 2483.5 MHz. It can work up to 100K Erase cycles.
Applications
• Smart phone/Tablet accessories
• Remote monitoring and control
• Smart home
• Indoor positioning
Smart Pulse Oximeter using REYAX RYB080I BLE Module & Arduino
Circuit Diagram & Connections
Now let’s see some of the example projects using REYAX RYB080I BLE Module & Arduino. The first one is Smart Pulse Oximeter Project. In this project, we will measure the Blood Oxygen Percentage (SpO2) & Heart Rate BPM & Display on OLED Display & also in Android Application. The circuit diagram for this project is given below.
We are using MAX30100 Pulse Oximeter Sensor & an OLED Display. Both are the I2C Module. Similarly, the Bluetooth Module RYB080I is powered with a 3.3V Supply. The UART Pin is converted to a 3.3V Logic level using Voltage Divider Network.
Source Code/Program
The code for Pulse Oximeter is given here. The code requires some library for compilation. You can get the libraries & detail of the project here: Arduino Pulse Oximeter Project
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
#include <Wire.h> #include "MAX30100_PulseOximeter.h" #include "Wire.h" #include "Adafruit_GFX.h" #include "OakOLED.h" #define REPORTING_PERIOD_MS 1000 OakOLED oled; PulseOximeter pox; uint32_t tsLastReport = 0; const unsigned char bitmap [] PROGMEM= { 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x18, 0x00, 0x0f, 0xe0, 0x7f, 0x00, 0x3f, 0xf9, 0xff, 0xc0, 0x7f, 0xf9, 0xff, 0xc0, 0x7f, 0xff, 0xff, 0xe0, 0x7f, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xf7, 0xff, 0xf0, 0xff, 0xe7, 0xff, 0xf0, 0xff, 0xe7, 0xff, 0xf0, 0x7f, 0xdb, 0xff, 0xe0, 0x7f, 0x9b, 0xff, 0xe0, 0x00, 0x3b, 0xc0, 0x00, 0x3f, 0xf9, 0x9f, 0xc0, 0x3f, 0xfd, 0xbf, 0xc0, 0x1f, 0xfd, 0xbf, 0x80, 0x0f, 0xfd, 0x7f, 0x00, 0x07, 0xfe, 0x7e, 0x00, 0x03, 0xfe, 0xfc, 0x00, 0x01, 0xff, 0xf8, 0x00, 0x00, 0xff, 0xf0, 0x00, 0x00, 0x7f, 0xe0, 0x00, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; void onBeatDetected() { Serial.println("Beat!"); oled.drawBitmap( 60, 20, bitmap, 28, 28, 1); oled.display(); } void setup() { Serial.begin(9600); oled.begin(); oled.clearDisplay(); oled.setTextSize(1); oled.setTextColor(1); oled.setCursor(0, 0); oled.println("Initializing pulse oximeter.."); oled.display(); Serial.print("Initializing pulse oximeter.."); if (!pox.begin()) { Serial.println("FAILED"); oled.clearDisplay(); oled.setTextSize(1); oled.setTextColor(1); oled.setCursor(0, 0); oled.println("FAILED"); oled.display(); for(;;); } else { oled.clearDisplay(); oled.setTextSize(1); oled.setTextColor(1); oled.setCursor(0, 0); oled.println("SUCCESS"); oled.display(); Serial.println("SUCCESS"); } pox.setOnBeatDetectedCallback(onBeatDetected); } void loop() { pox.update(); if (millis() - tsLastReport > REPORTING_PERIOD_MS) { Serial.print("Heart BPM:"); Serial.print(pox.getHeartRate()); Serial.print("-----"); Serial.print("Oxygen Percent:"); Serial.print(pox.getSpO2()); Serial.println("\n"); oled.clearDisplay(); oled.setTextSize(1); oled.setTextColor(1); oled.setCursor(0,16); oled.println(pox.getHeartRate()); oled.setTextSize(1); oled.setTextColor(1); oled.setCursor(0, 0); oled.println("Heart BPM"); oled.setTextSize(1); oled.setTextColor(1); oled.setCursor(0, 30); oled.println("Spo2"); oled.setTextSize(1); oled.setTextColor(1); oled.setCursor(0,45); oled.println(pox.getSpO2()); oled.display(); tsLastReport = millis(); } } |
So after uploading the code, the OLED Display will start displaying the BPM & SpO2 value. Now turn on the Bluetooth on your mobile phone. To control the BLE Module you need a REYAX BLE UART Application installed on your phone.
So after installation, click on connect. And from the list select the REYAX BLE Module. The Android app will connect to the Reyax Bluetooth quickly and start displaying the BPM & SpO2 value. Place the finger on MAX30100 Sensor, the BPM & Oxygen Percent get displayed. Thus you can use RYB080I Bluetooth Module & Arduino in Health Monitoring Devices.
Weather Station using REYAX RYB080I BLE Module & Arduino
Circuit Diagram & Connections
Now let us do another project now. It’s about monitoring the sensor data on smartphones via Bluetooth. So, for this, I have taken DHT11 Humidity & Temperature Sensor as a reference. The circuit diagram is given below.
The Arduino & RYB080I Bluetooth connection is still the same. But DHT11 is added to the circuit. Its output pin is connected to D2 of Arduino
Source Code/Program
Here is the code for this project. Using the DHT11 Arduino Library, we are retrieving the humidity & Temperature Data from the sensor. You can copy this code upload it to the Arduino Nano Board.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
#include "DHT.h" #define DHTPIN 2 // what digital pin we're connected to #define DHTTYPE DHT11 // DHT 11 DHT dht(DHTPIN, DHTTYPE); void setup() { Serial.begin(9600); Serial.println("Temperature and Humidity Test"); dht.begin(); } void loop() { float h = dht.readHumidity(); // Read Celsius float t = dht.readTemperature(); // Read Fahrenheit (isFahrenheit = true) float f = dht.readTemperature(true); // Check errors if (isnan(h) || isnan(t) || isnan(f)) { Serial.println("Failed to read from DHT sensor!"); return; } // Compute heat index in Fahrenheit (the default) float hif = dht.computeHeatIndex(f, h); // Compute heat index in Celsius (isFahreheit = false) float hic = dht.computeHeatIndex(t, h, false); Serial.println("Humidity: "); Serial.print(h); Serial.println(" %"); Serial.println(" "); Serial.print("Temperature: "); Serial.print(t); Serial.println(" C"); delay(2000); } |
Now again connect the Android App to the Reyax Bluetooth Module. So after the mobile phone is connected to Reyax Bluetooth, the temperature and humidity data will start retrieving.
The humidity and temperature of my room are shown here. This is how you can make a simple weather station project using RYB080I Bluetooth & Arduino and monitor it wirelessly on your smartphone.
Multiple LED Control using REYAX RYB080I BLE Module & Arduino
Circuit Diagram & Connections
Now, let us see the third example now. In this example, we will control 3 different LED by sending some command from our mobile phone. So here is the connection diagram for the project. You can follow the circuit.
Source Code/Program
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
int led1 = 2; int led2 = 3; int led3 = 4; char junk; String inputString = ""; void setup() { Serial.begin(9600); pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); } void loop() { if (Serial.available()) { while (Serial.available()) { char inChar = (char)Serial.read(); inputString += inChar; } Serial.println(inputString); while (Serial.available() > 0) { junk = Serial.read() ; } if (inputString == "a") { digitalWrite(led1, LOW); } else if (inputString == "b") { digitalWrite(led2, LOW); } else if (inputString == "c") { digitalWrite(led3, LOW); } else if (inputString == "x") { digitalWrite(led1, HIGH); digitalWrite(led2, HIGH); digitalWrite(led3, HIGH); } inputString = ""; } } |
All the LEDs are powered via 3.3V pins and connected to Digital output pins for GND Connection. Now again connect the android app to Reyax Bluetooth.
After wireless connection, send the a, b, c, or x command. So you can the turning ON & OFF the LEDs. In a similar way, you can do some other projects using this REYAX RYB080I Bluetooth Module & Arduino.
Video Tutorial & Guide
Some other products from Reyax Technology like RYS8830 & RYLR890/RYLR896 may be useful in some other wireless applications.