Close

First revision of the Sensor Tile

A project log for STM32L4 Sensor Tile

Small, connected device for smelling and hearing in any environment.

kris-winerKris Winer 06/18/2017 at 06:330 Comments

06/16/2017

I redesigned the Sensor Tile slightly replacing the power switch with a smaller ALPS SSAJ110100 switch, replacing the 3 mm x 3 mm MPU6500 with a 2mm x 2 mm BMA280 accelerometer but otherwise it's still the same concept. The accelerometer change is to reduce the cost and improve the performance. The BMA280 has two multiply-configurable interrupts, is much lower power than the MPU6500 (I never really had a use for the gyro anyway) and offers a rich variety of interrupt configurations (single and double tap, pan, tilt, portrait and landscape detection), as well as a high-pass and low pass filter. It is much more versatlie than the MPU6500 and a better choice for a low-power wearable device.

The goals of the project remain the same. And I expect the BMA280 will make achieving them a little easier since I can run the accelerometer at 2 kHz (unfiltered) which means I can detect vibration and sound up to 1 kHz or so. This nicely complements the ICS43434 I2S digital microphone (50 - 20,000 Hz).

While the board has been slightly modified, I finally got around to learning how to construct "proper" C++ libraries and rewrote the single, integrated Arduino sketch I started with into a series of individual sensor libraries (with .h and .cpp files) and now I am able to control the I2C sensors with proper constructors resulting in a slimmer main code (still ~400 lines) that is a little easier to manage. Here is the library.

I am using interrupts wherever possible (BMA280, CCS811, and RTC) but for the devices that have no interrupt (ICS43434 and BME280) I am using the RTC alarm to interrupt in order to set the duty cycle for reading and reporting data, either to the serial monitor or to the smartphone via the UART bridge provided by the BMD-350 (nRF52) BLE module.

I still need to figure out how to efficiently transfer the data via BLE so I can run the Sensor Tile at the lowest CPU clock speeds (~1 MHz) and use the lowest power mode (STM32.stop between interrupts) to cut the average power usage down as low as possible while still getting useful data via BLE to a laptop.

To this end I have designed an nRF52 add-on for the Butterfly (STM32L433 development board, sister to the STM32L432 used as host MCU for the Sensor Tile) that will allow the nRF52 to operate in central role and pass data to the Butterfly via its own UART bridge and then on to the laptop via the USB cable. Thus I expect to have a wireless Sensor Tile spewing lots of data wirelessly to the laptop for capture and analysis.

Still a lot to do but the path is getting clearer and I see no showstoppers along the way to prevent eventual success.

Discussions