Diurnyx User Guide
Version 0.1.0 - Last updated: 2026-04-21
Note: Diurnyx is intended for research use only and is not a medical device. Recorded data is not suitable for diagnostic or clinical use.
Diurnyx is a USB-C powered system for measuring and recording sleep-related biosignals. It acquires data from connected sensors and stores recordings as EDF (European Data Format) files on an SD card.
A typical workflow is:
- Prepare an SD card with a valid configuration
- Power the device via USB-C
- Start a recording with a short button press
- Stop the recording with a long press
- Remove the SD card and copy the EDF file or files
Each recording session is saved as a separate EDF file.
System Overview
Diurnyx includes:
- A central acquisition unit powered over USB-C
- Connected biosignal sensors
- An SD card for configuration and data storage
- A single-button user interface
- A USB connection for logging and firmware update
During operation, the device:
- Loads configuration from
config.json - Configures the sensor interfaces
- Initializes the configured sensors
- Collects and buffers samples
- Resamples data into EDF record intervals
- Writes the recording to the SD card
Requirements
Before use, make sure you have:
- A compatible SD card formatted with a supported FAT filesystem
- A valid
config.jsonfile in the root directory of the card - The required sensors connected for your setup
- USB-C power
Recorded files are written to:
/DATA/
If the DATA directory does not already exist, the device creates it automatically.
SD Card Preparation
Required card structure
The SD card must contain:
- A standard MBR partition table
- A valid FAT filesystem partition
- A
config.jsonfile in the root directory of that partition
A typical card layout looks like this:
SD_CARD/
├── config.json
└── DATA/
└── 20260421_143015.edf
Before the first recording, the card may contain only:
SD_CARD/
└── config.json
Notes
- The device searches for the first valid FAT partition on the card
config.jsonmust be placed in the root of that partition- The
DATAdirectory does not need to be created manually - Unsupported filesystems such as exFAT or NTFS should not be used
If there is any doubt about the card format, reformat it using standard FAT settings and then copy
config.json back to the root directory.
Configuration
Diurnyx is configured using a config.json file located in the root
directory of the SD card.
Configuration Schema
The full configuration structure is documented in the generated API documentation:
View configuration schema documentation
Example Configurations
A collection of sample configuration files is available to help you get started:
These examples demonstrate typical setups for different sensor combinations and use cases. You can copy and modify them as needed.
Controls
Diurnyx uses a single button.
While idle
- Short press: start a new recording
- Long press: no action
While recording
- Long press: stop the current recording
- Short press: no action
Starting a Recording
- Insert the SD card
- Power the device via USB-C
- Wait for the device to become idle
- Short-press the button
When recording starts, the device:
- Detects and mounts the SD card
- Loads
config.json - Applies interface configuration
- Initializes the configured sensors
- Creates a new EDF file
- Begins recording data
If any of these steps fail, recording will not start.
Stopping a Recording
To stop a recording, long-press the button while recording is active.
The device then finalizes and closes the EDF file before returning to idle.
Do not remove power or remove the SD card until recording has fully stopped.
Recorded Files
Recordings are stored in:
/DATA/
Each recording session is written as a separate EDF file.
File names are based on the recording start time using the device clock:
YYYYMMDD_HHMMSS.edf
Example:
20260421_143015.edf
The timestamp used for the filename is derived from the internal real-time clock. If a timezone is configured, local time is used for file naming and EDF metadata.
Timekeeping
Diurnyx uses its internal real-time clock for timestamps.
This affects:
- EDF start time metadata
- Recording identifiers
- Output file names
If configured, a timezone offset is applied when generating the recording timestamp.
The device may also update its real-time clock from the SD card configuration file timestamp when appropriate, for example if the stored file timestamp is newer than the current real-time clock value or if a clock reset is requested in configuration.
USB Logging
Diurnyx provides USB logging over a virtual COM port using USB CDC-ACM.
When connected to a host computer, the device can appear as a serial port for development and troubleshooting. Log output may include:
- Startup messages
- SD card and filesystem status
- Sensor initialization and retry behavior
- Recording progress
- Error messages
The logs are timestamped and intended for development, testing, and troubleshooting. They should not be treated as validated diagnostics.
A serial terminal program such as minicom, screen, or PuTTY can be used to monitor
the log output.
Firmware Update (DFU)
Diurnyx supports firmware update over USB using Device Firmware Upgrade.
DFU behavior
The firmware exposes a USB Device Firmware Upgrade interface. When Device Firmware Upgrade mode is requested by the host, the device resets into the STM32 system read-only memory bootloader.
After that reset:
- The device disconnects from normal application mode
- USB re-enumerates as a Device Firmware Upgrade-capable bootloader device
- Firmware can be transferred using a compatible Device Firmware Upgrade utility
Notes
- Device Firmware Upgrade uses the microcontroller unit built-in system bootloader
- Entering Device Firmware Upgrade mode interrupts normal recording operation
- USB power must remain connected throughout the update process
- Any recording in progress should be stopped before performing a firmware update
Troubleshooting
Recording does not start
Check the following:
- The SD card is inserted correctly
- The card contains a valid FAT filesystem
config.jsonis present in the root directory- The connected sensors match the intended hardware configuration
- USB logging is available and shows no startup or configuration errors
Recording starts but no useful data is captured
Check the following:
- Sensor wiring and connections
- Sensor power and interface compatibility
- Configuration matches the installed hardware
- USB logs for sensor initialization failures, read failures, or timeouts
Timestamps look wrong
Check the following:
- Real-time clock initialization
- Timezone configuration, if used
- The timestamp on
config.json, since it may be used to update the real-time clock