A minimal MATLAB class for reading data from a UTS T11 USB temperature sensor — an IP67-rated probe that communicates over a virtual serial (USB) port at 9600 baud and works under Windows, Linux, and on Raspberry Pi.
The class wraps MATLAB's serialport interface, handling connection setup, sending the probe's query commands, and parsing its text responses into numeric temperature readings.
- MATLAB with the Instrument Control Toolbox (for
serialport) - A UTS T11 USB temperature probe connected to your machine
% Connect to the probe (use your probe's serial port name)
T = uts_temp_probe('/dev/ttyUSB0'); % or e.g. 'COM3' on Windows
% Read the current temperature
temp = T.readtemp
% Print the firmware and hardware version
T.UTSVersion
% Log a single reading, with timestamp, to a file
T.writeTempToFile('log.txt')
% Log a reading every 60 seconds, indefinitely (blocks the CLI)
T.writeTempToFile('log.txt', 60)
% Same, but non-blocking: logging runs in a background timer
T.writeTempToFile('log.txt', 60, true)
T.stopLogging % stop the background loggingThe serial connection is closed automatically when the object is cleared or goes out of scope.
Released under the MIT License — see LICENSE.