Skip to content

Dial Indicator Data Acquisition and Recording System ​

This project is part of the Physical Experiment System.

Overview ​

A complete desktop host application for digital dial indicators in laboratories and industrial settings. Traditional measurement relies on manual recording, which is slow and error-prone. This project implements a general-purpose acquisition application based on the Modbus RTU protocol: users can connect to the device, detect the baud rate automatically, take single or continuous readings, watch the waveform live and export the data in several formats through a graphical interface, without writing any serial-communication scripts.

Dial indicator acquisition software with connection settings, control buttons, a live displacement plot and a data table
The dial indicator software (click to enlarge)

Main features:

  • Automatic connection: scans serial ports and matches the baud rate automatically, with no manual configuration.
  • Live visualisation: a high-performance plotting component draws the displacement curve in real time.
  • Data export: export measurements to CSV, an Excel report or a SQLite database in one click.

Background ​

The physical experiment system must measure the tiny displacements of a sample during machining, which calls for a dial indicator. The indicator that was purchased only has a basic RS-485 hardware interface and no host software. Experimenters had to copy readings by hand, or read raw hexadecimal data in a crude serial-debugging tool, which is slow and makes trends such as jitter and rebound hard to see. This project fills that gap.

Requirements ​

Functional

  • Device control: RS-485 serial connection, and zeroing the device.
  • Data acquisition: single manual reads and continuous automatic reads at a user-defined rate.
  • Visualisation: a scrolling displacement-over-time plot and a table of historical data.
  • Persistence: export to Excel, CSV or SQLite.
  • Usability: automatic baud-rate detection to lower the bar for hardware configuration.

Non-functional

  • Responsiveness: the UI must not stutter or freeze during high-frequency serial communication (this requires a multi-threaded design).
  • Stability: serial packet loss, checksum errors and similar faults must be handled without crashing.
  • Compatibility: runs mainly on Windows and must be packaged as a standalone executable.

Development Workflow ​

Development workflow: dial indicator acquisition software Study the Modbus RTU protocol document → Write the low-level communication layer → Implement checksum and frame decoding → Add threading for continuous reading → Adopt an MVC structure → Design the main window and plot area → Add Excel and database export → Package and release 1 Study the Modbus RTU protocol document 2 Write the low-level communication layer 3 Implement checksum and frame decoding 4 Add threading for continuous reading 5 Adopt an MVC structure 6 Design the main window and plot area 7 Add Excel and database export 8 Package and release
Development workflow of the dial indicator software (click to enlarge)

Technology ​

LayerTechnology
Hardware controlPython + pyserial for Modbus RTU serial communication
Desktop front endPython + PyQt5 for the graphical interface and live waveform
Data back endPython + pandas / sqlite3 for statistics and multi-format export

Implementation Challenges ​

Hardware ​

AreaChallenge
DevelopmentThe indicator uses Modbus RTU, so command framing, CRC16 checksums and 32-bit big-endian data decoding had to be implemented by hand
EngineeringBaud-rate settings differ between devices and are unknown, so the handshake and connection had to be established without documentation or a known configuration
RequirementsContinuous acquisition above 10 Hz needs precise timing: commands must not pile up and cause bus collisions, and packet loss and similar faults must be handled

Software ​

LayerChallenge
Hardware controlBaud-rate auto-matching; dynamic calculation of the minimum safe read interval; a multi-threaded serial guard; disconnection detection and automatic reconnection
Desktop front endA non-blocking multi-threaded UI built on QThread; live waveform rendering with PyQtGraph; cross-thread signals and slots
Data back endBusiness logic decoupled with MVC; lightweight SQLite storage; automated statistics and Excel report generation with pandas

User Interface ​

RegionDescription
Connection settingsPort selection (auto-refreshing) and baud rate; an "Auto-detect" button adapts to the device in one click
ControlsLarge "Single read", "Continuous read" (with a custom interval), "Stop" and "Zero" buttons to prevent mis-taps
Live plotA PyQtGraph-based chart that supports scroll-wheel zoom, drag to review history and automatic Y-axis range
Data tableLive time-and-value pairs, sortable by column header
Menu barExport options for CSV, Excel and SQLite

Results ​

The software has been packaged as a Windows installer and distributed, and runs reliably on several computers in the experimental environment. It samples smoothly at more than 10 Hz, and in continuous tests lasting several hours showed no memory leaks or serial-port crashes. The exported Excel reports are used directly in later analysis of the experimental data, which has noticeably improved efficiency.

Personal Contributions ​

This project was designed and developed independently by Peler, apart from procuring the dial indicator.

AreaScope
ArchitectureDesigned the PyQt5-based MVC architecture, decoupling the UI from business logic
DriverWrote the GaugeReader class, implementing Modbus RTU framing and CRC checking by hand
Core featuresThe multi-threaded continuous-acquisition algorithm, the baud-rate auto-detection algorithm and the SQLite / Excel export module
InterfaceDesigned the UI in Qt Designer and wrote the PyQtGraph live-plotting logic
PackagingConfigured the PyInstaller spec file and wrote the Inno Setup script that builds the installer