Weeks 3 and 4 - Smart Environmental and Activity Logger

This project used the sensing and wireless capabilities of the Xiao nRF52840 Sense to create a data logging system. A key feature of the design was the inclusion of a voltage divider, allowing us to monitor the battery power to halt or continue data logging relative to the voltage provided by the battery.
Voltage Divider
We implemented voltage divider comprised of three resistors rated at 680Ω, 2.2kΩ, and 10kΩ. Two resistors are connected together in series, while the third resistor is connected to ground.

This is how we calculated the voltage for our battery monitor.

The image below shows how the circuit was implemented on a breadboard.

Data logging
The function on the next page uses the reading from pin A0
to calculate the battery voltage from the analog-to-digital converter (ADC) and prints the system status on the OLED. Our full code can be downloaded here.

Bluetooth connectivity




Voltage measurement and sensor output
These screenshots show how our sensor readings and system status messages are printed to the serial monitor and written to the SD card. The datalog.txt
file can be downloaded here.


Displaying battery voltage and data logging status on the OLED


Demo
Video of the functional prototype