Sensor Data Outputs¶
The uThing::MNL provides a set of data related to motion, noise and light. This page details each output field and the available reporting formats.
Data Dictionary¶
This section serves as a reference for every data point the device can report.
Noise - RMS- Units: dB (SPL)
- Range: +20 to +130
- Description: The ambient RMS (Root Mean Square) noise level, measured over a 125ms window.
Noise - Base- Units: dB (SPL)
- Range: +20 to +130
- Description: The ambient base noise SPL level.
Noise - Peak- Units: dB (SPL)
- Range: +20 to +130
- Description: The ambient peak noise SPL level.
PIR - detections- Units: Count
- Range: 0 to 10k
- Description: The number of motion detections during the last sampling period.
PIR - detPerHour- Units: Count
- Range: 0 to 10k
- Description: The number of motion detections triggered during the last hour.
Light - Last- Units: lux
- Range: 0.01 to 64k
- Description: The most recent luminosity level measurement.
Light - Average- Units: lux
- Range: 0.01 to 64k
- Description: The averaged luminosity level, calculated using an exponential moving filter.
MEMS microphone and SPL
The MEMS microphone is used to measure the ambient noise and the MCU uses digital signal processing to calculate the SPL (Sound Pressure Level), which is a logarithmic measure of the pressure level of a sound. By no means the microphone is used to sample intelligible voice or audio data, the only sound information transmited to the USB host are the SPL level measured over a 125ms time window, as in a Sound Level Meter (decibel-meter).
Output Formats¶
The device can report the data above in three different formats. You can change the format by sending a configuration command.
JSON (Default)¶
The default format is JSON, which is easily parsed by most applications.
{
"noise": {
"rms": 30.8,
"peak": 33.5,
"base": 29.4
},
"pir": {
"detections": 0,
"detPerHour": 59
},
"light": {
"last": 40.97,
"average": 65.28
}
}
CSV¶
For applications where a simple mean for data-logging is needed, the board can be configured to output the data in CSV format (comma separated values).
The column order is:
noise_rms, noise_peak, noise_base, pir_detections, pir_lastHourD, light_last, light_average
35.3,35.3,30.0,0,65,31.72,39.39
Tip: Logging to a CSV File
As a quick way to do simple datalogging, the sensor data can be sent to a plain text file with the following command:
cat /dev/ttyACM0 > uThingMNL.csv &
& symbol runs the process in the background. The generated file can then be opened in Excel or any spreadsheet application.
For a long therm and reliable data logging, check the uBridge CSV plugin.
Human-Readable¶
The 'human-readable' format reports a more descriptive output that includes the measuring units.
Noise: [rms: 33.2 dB, Peak: 37.8 dB, Base: 33.2 dB], PIR: [detections 0, detections/hour 67], Light: [Last 27.89, Average 32.98]