The project is based on CP2112 USB-SMBus converter IC manufactured by Silicon Labs. Besides of the protocol conversion it is also equipped with an 8-bit I/O port and 3.3V voltage regulator that can power the external circuit. This way our project gets powered from the computer USB port. An interesting feature of CP2112 is hardware implementation of the USB HID protocol. This allows to use standard USB drivers of any modern OS to communicate with it. The project is assembled on a proto-board, and was used for testing the converter IC.
Schematic | Protoboard | |
As it follows from the schematic, CP2112 controls two digital sensors on the shared I2C bus. One of them (IC1) is a temperature/humidity sensor and the other one (IC2) is a barometric pressure sensor. The later sensor is an improved version of the popular pressure sensor BMP085. Compared to the older model, this one has better resolution and less noise. It will probably be replaced with an even newer one (BMP280) as it becomes widely available.
A particularity of the temperature and humidity sensor Si7005 is in its /CS pin which is typical for devices with the SPI interface but not I2C ones. This pin should be grounded if there are other devices on the same I2C bus. Otherwise, the sensor blocks the SDA line by accessing the other devices, which makes the bus unusable. Alternatively, to prevent blocking the SDA line one can ground the VDD pin. This design uses the second approach. The sensor is powered via GPIO5 pin of IC3, which is configured for output.
The format of CP2112 HID reports can be found in appnote AN495 which is available from the Silicon Labs website (silabs.com). Besides of that, they even developed a special library for a higher level communication with CP2112. The library is available for download in the .dll formal for Windows and in the .dylib format for MacOS. We used the first format which can be ported into programs written in C/C++, C#, or VB. The APIs of this library are described in appnote AN496.
Our program for reading the sensor data is written in C# and developed in Microsoft Visual Studio 2012. It requests new data from sensors every 2 seconds and displays it in a window shown below. The temperature is displayed in °C and the pressure in mmHg.
All project files can be extracted from the archive linked below.
Last modified:Mon, Jan 23, 2023.