Bluetooth Temperature and Humidity Gauge

Jinah Yoo

Overview

This project is designed to measure both the indoor and outside temperature and humidity. For measuring the indoor conditions, hts221 sensor is used, which is attached on the board. The outside conditions are measured by the implementation of a Bluetooth server which is continuously scanned by scanner. The client, which is the mainboard in my project, requests to the Bluetooth server for data communication. Since my project uses Bluetooh beacon, the client just prints the Bluetooth server name, which is temparature and humidity, once the scanner finds a Bluetooth server that matches with the server address saved in my program. For example, if the name of the Bluetooth server is "+20C 45%", the client will receive it as the data and print on the display. BTN0 button is used to switch between indoor conditions and outside conditions on the display. In addition, several timers are implemented in order to update the temperature and humidity periodically on the display.

Video

Hardware

My project has two separate parts, client and server. Client consists of three components: maindboard, temperature sensor, and the OLED display. The sensor and the display are attached to the mainboard. Server is made of a Bluetooth beacon and a temperature sensor attached to it.

Client parts:
- Microcontroller: BGM220 Explorer Kit Board
- OLED Display: I2C SSD1306
- Temperature Sensor: HTS221
Server parts:
- Temperature Sensor: SHT40-AD1B-R3
- Bluetooth beacon: BGM220PC22HNA2R
Beacon Assembly Schematic 1 Schematic 2

The microcontroller used for this project is BGM220 Explorer Kit Board from Silicon Labs. Makerfocus I2C OLED display module 0.91" I2C SSD1306 was used for the OLED display. With the OLED board, HTS221 temperature sensor was adapted to the BGM220 on a custom board in which it used I2C protocol to connect to the main board. HTS221 sensor is used to measure indoor conditions. For the Bluetooth server implementation, BGM220PC22HNA2R Bluetooth from Silicon Labs was used with SHT40-AD1B-R3 temperature sensor on it, which measures outdoor conditions.

Software

Simplicity Studio 5 was used to develop this project. The program first started by initializing the hts221, ssd1306, and GPIO interrupt. Additionally, the six digits of server address are saved in hex numbers and binary button state is set as 0 in the initialization phase. The default setting shows the home conditions on the OLED display. The temperature is updated every five seconds with the implementation of sleeptimer. When BTN0 button is pushed, the button state changes to 1, the display is cleaned, and LED is turned on. LED is for demonstration purposes only to indicate the mode. The new button state will send signal to start the scanner to search the bluetooth server address that matches with the address which was initially saved in the program as hex numbers. If the scanner finds it, it will print the broadcasted temperature and humidity data on the display. The data will be scanned and renewed periodically with the implementation of another sleeptimer, namely scanTimerHandler.

Home temp Street temp

Final Thoughts

I have taken a course in the previous semester using microcontroller. Doing this project was a delightful time that extends and enriches my knowledge and understanding on embedded systems design. The most challenging part of this project was to figure out how to convert from showing indoor conditions to the outdoor conditions on the display with the button push. On the other hand, the task I enjoyed the most was creating the plus, minus, and home signs with binary numbers to print on the display. Completion of this project helped me to better understand the BLE module as well as the overall ideas on microcontroller programming.

Downloads