Something you might also want to consider (depending on your needs, of course, and the environment the system will be used in) is to add a beginning and termination character to the data packet being sent to the Arduino. When you do your reading for data on the Arduino, you can check for these characters, and if you don't see them, or the count (size) of the packet is wrong, you reject the packet and do nothing.
This is useful, for instance, if your design is to be used in a potentially electrically noisy environment (say within the electrical system of a vehicle), or your application needs the robustness from a safety or operations standpoint (perhaps in an autonomous robot, in which you are communicating with the Arduino via a PC, sending and received commands and telemetry data).
Just something to consider.
![]()