Samstag, 30. Dezember 2017

BME280 USB adapter: microsoldering practice

Motivated by the videos on Louis Rossman's YouTube channel 
I wanted to try a small scale project myself. I've chosen to build small size USB adapter for the Bosch Sensortec BME280 sensor. It measures pressure, temperature, and relative humidity in a super tiny package. For the USB connection I use an AVR ATMEGA8 microcontroller with the V-USB software-only USB implementation.
The sensor is connected to the MCU using the SPI interface. Schematics below
The firmware is based on the V-USB reference project called PowerSwitch.

Using the sensor requires to read the factory calibration coefficients from the sensor memory. Then read the raw data and apply the calibration. For the calibratoin, some functions are given in the BME280 datasheet. The calibrated output is transfered over USB to a program running on a PC.

The PCB was produced on https://oshpark.com/ for less than 3 EURO for 3 pieces. The USB connection is of mini-B type. The 6-pin programming header is only needed for firmware upload and can be removed once the firmware development is done. For the soldering of the QFN packaged ATMEGA chip a microscope is really helpul. The soldering itself might be possible without microscope, but the optical inspection of the joints to the pins is impossible with the naked eye. Passive components are 0603 size.

To get an impression of the data quality from this sensor, I took data for about 30 hours. Here is the result:
The large spike in temperature around 3-4 hours after starting the measurement was because the sensor was too close to the laptop and the warm air from the CPU fan reached the sensor. The dips in temperature or humidity occurred after opening the window. The straight upwards slope in the humidity curve between hours 12 and 22 was during the night and shows the water evaporation from a single adult person in a small room (~30 cubic meters of air, doors and window closed).