Idea

Seeking for an alternative to the ibutton logger for a research project, a sensor probe and a small LiPo battery were hooked up to the XIAO ESP32C3, creating a simple environmental data collection device. This solution works and is cheap, but is also too simple and misses out on the potential design upgrades for this dev board.

That's when the idea for a PCB hat for the XIAO board, that could measure temperature, humidity luminosity and monitor device battery level came up. 

Schematic

The design incorporates the SHT40 temperature sensor, the popular BH1750 ambient light sensor and the PCF8563 RTC chip to correct the godawful internal clock. The RTC is powered by the 3V3 and the two sensor chips are powered through pin D10 to reduce overall power consumption in sleep mode. Communication is done through I2C pins D4 (SDA) and D5 (SCL). The hat also includes a battery voltage divider that is enabled through D10 and the halved voltage can be read on pin A3. This circuitry requires wiring the battery power to a through-hole pad on the hat. The PCB and components costs for this module sum up to 9.81 RMB (1.37 USD).


PCB

The board outline is the same as the XIAO board so they fit neatly together. All the component footprints have enlarged pads and additional silkscreen lines to facilitate manual soldering.


Assembly

The populated PCB is soldered on the header pins of XIAO with an adequately-sized lithium battery sandwiched between the two boards. For the battery voltage reading, a wire must be added from the battery to the through hole pin.

An acrylic cuboid was designed to tightly encase the entire system with holes for the USB-C connector, the U.FL antenna connector and access to the reset button. The complete assembly measures just 23.3 mm x 20 mm x 16.2 mm (without antenna) and costed about 46.65 RMB (6.52 USD).