Control and Measurement Systems – Laboratory Classes, Group Project

Data Acquisition System for Virtual Temperature Sensors – LabVIEW + Arduino Micro


1. Project Objective

The objective of this project is to develop a data acquisition application in LabVIEW that communicates with a virtual temperature sensor simulator based on Arduino Micro.

The application should implement:

Project requirements:

2. Simulator Description

The device simulates three temperature sensors. Measurement packets are transmitted over a serial port every 100 ms.

Some packets intentionally contain transmission errors:

The application must detect and distinguish different error types.


3. Transmission Packet Structure

Bytes Content Type Size Description
0–2 's' 'n' 'p' char[3] 3 B Synchronization header
3 X uint8 1 B Number of float values in the packet
4–7 TEMP1 float32 4 B Temperature sensor 1
8–11 TEMP2 float32 4 B Temperature sensor 2
12–15 TEMP3 float32 4 B Temperature sensor 3
16–19 TIME float32 4 B Time elapsed since startup [s]
20–21 CHKSUM uint16 2 B Checksum

The total size of a valid packet is 22 bytes.

All float32 values are transmitted using big-endian byte order.

4. Frame Synchronization

The transmission is implemented as a continuous binary data stream. If an error occurs, synchronization may be lost.

The application must not assume that every 22 received bytes form a valid packet.

Synchronization mechanism

Every valid packet begins with the sequence:

s n p
115 110 112
0x73 0x6E 0x70

The application should:

  1. search the incoming data stream for the snp header,
  2. read the remaining packet bytes after synchronization,
  3. verify packet length and checksum,
  4. discard invalid data and restart synchronization if an error occurs.
Improper frame synchronization will result in invalid data decoding.

5. Checksum Verification

The checksum is calculated as the sum of the first 20 bytes of the packet.

Procedure:

  1. Convert each byte to U8.
  2. Accumulate the sum using U16.
  3. Compare the result with the received CHKSUM value.

6. Example Packets

6.1 Valid packet

73 6E 70 04 41 A0 00 00 41 9C 00 00 41 A8 00 00 40 20 00 00 03 D5

Interpretation

Data Value
TEMP1 20.0 °C
TEMP2 19.5 °C
TEMP3 21.0 °C
TIME 2.5 s

Checksum calculation example

The first 20 bytes must be summed:

73 + 6E + 70 + 04 + ...

The calculated value should match:

03 D5

6.2 Packet with invalid checksum

73 6E 70 04 41 A0 00 00 41 9C 00 00 41 A8 00 00 40 20 00 00 00 00

This packet should be classified as: checksum error.


6.3 Truncated packet

73 6E 70 04 41 A0 00

This packet should be classified as: incomplete packet.


7. Functional Requirements

7.1 Data acquisition

7.2 Data visualization

7.3 Transmission statistics

The application should display:

Valid packets: X (A %)
Checksum errors: Y (B %)
Incomplete packets: Z (C %)

8. Data Archiving

Valid measurements must be saved into a CSV file:

Time,Temp1,Temp2,Temp3

Time format:

HH:MM:SS.xx

The filename should be provided by the user. The application must prevent accidental file overwriting.


9. Loading Archived Data

The application should support:

Mode Description
Read mode Display the complete dataset immediately
Simulation mode Replay measurements with real-time timing

10. Missing Sample Interpolation

Missing samples should be reconstructed using linear interpolation.

Example:

5.1 s → 20.0 °C
5.2 s → missing
5.3 s → 22.0 °C

Interpolated value:

5.2 s → 21.0 °C

11. Laboratory Workflow

Stage Tasks
1 UART communication setup
2 Frame synchronization and packet reception
3 Checksum and error handling implementation
4 Binary data decoding
5 GUI and plot implementation
6 State Machine and Event Structure implementation
7 CSV export implementation
8 Archived data loading
9 Simulation mode implementation
10 Testing and optimization

12. Grading

Project element Points
UART configuration 10
Frame synchronization 10
Checksum verification 10
Error type recognition 10
float32 decoding 10
Data visualization 10
State Machine + Event Structure implementation 10
CSV export 10
Data loading and simulation 10
Code readability and organization 10
Total 100

13. Bonus Tasks

Feature Bonus points
Automatic COM port detection +5
Transmission timeout handling +5
Limiting the number of samples displayed on plots +5
PNG export of plots +5

14. Final Notes