Bluetooth Low Energy (BLE) technology is a wireless personal area network technology that has applications in healthcare, fitness, sensor beacons, and many more. Ruuvi, a Finnish startup, produces a BLE sensor beacon called the RuuviTag. It measures ambient temperature, relative humidity, barometric pressure, altitude and acceleration. They also provide a mobile app for both IOS and Android to track and respond to your RuuviTag data.
However, wouldn’t it be great to be able to manipulate and react this sensor data using your own devices such as an Arduino or Raspberry Pi? Luckily, there are development boards like the ESP32 that support Wi-Fi, Bluetooth, and BLE, and can be programmed using the familiar Arduino IDE. I use my ESP32 to track of my RuuviTag by sending its sensor data to an IoT Cloud platform for storage and visualization.
You can put your RuuviTag and ESP32 anywhere you like as they both have a strong network and are really compact.
Follow this tutorial on how to install ESP32 into your Arduino IDE to get started.
Next, select the ESP32 board that you are using. Once you determine which board you are using, you will need to download the ESP32 BLE Arduino library to utilize the ESP32’s BLE features. You will also need to know the MAC address of your RuuviTag, your Wi-Fi’s SSID and Password, and your IoT platform’s Gateway URL (we will discuss this later).
Upload the BLE_Scan_RUUVI code below and insert your MAC address, Wi-Fi info and your Gateway URL in the appropriate place. Finally, go to Tools -> Partition Scheme -> Huge APP (3MB No OTA/1MB SPIFFS). This allows us to upload larger programs, which is necessary since the BLE library is very big.
Once all of this is done, you can upload the sketch to your ESP32 and watch as your data gets collected from your RuuviTag by your ESP32 and sent by Wi-Fi to your IoT platform.
Send in the CloudWhat about the IoT Cloud platform that we mentioned earlier? The platform that we get our Gateway URL from? I recommend using the adaptive IoT platform of uBeac. Sign up for a free account here and you can access all of their awesome features. Look at my other tutorial about OS Monitoring to learn about how to setup uBeac and get your Gateway URL.
Visualize all DataOnce you have your RuuviTag data being collected by uBeac, you can visualize it on an IoT dashboard! Just drop a few widgets here and there, make a chart, add a map to determine its location, and voila! You have an easy was to view not just one, but all of your RuuviTags at once. Below is a sample of one of my dashboards.
If you have any questions on how uBeac works, or if you want to recommend future projects, please leave them in the comments below. Happy connecting!
Comments