I am doing an experiment where I have relevant data being recorded on two separate machines. Let's say Machine 1 is measuring a voltage and when the voltage crosses a threshold it records the time of that event. Machine 2 is a load cell that measures the force being applied on a specimen. Machine 1 and Machine 2 run on completely separate hardware/software. They're not linked up and there's no way to do so. So in terms of initiating data recording, both machines begin roughly around the same time based on a verbal cue from two lab workers who run the machines. But the verbal cue is prone to error so the two datasets can still be off by several seconds and we need to precisely match them up.
So let's say Machine 1 begins recording at time t = 0 and it registers an event at t = 12 seconds. I want to know what the force is at the time of this event. But Machine 2 didn't begin recording until time t = 2. So on the timeline of the dataset from Machine 2, I want to look at what Machine 2 recorded at t' = 10. So basically by knowing the difference in time between when each machine started recording, I should be able to temporally match up the datasets from the separate machines.
I figured an easy way to do this is to use an Arduino to send one digitial signal to both Machine 1 and Machine 2. Both machines can take in a digital input signal and record it in parallel with the rest of its data. So basically, out of one pin on my Arduino Uno, I will have a wire coming out that splits into two wires that go into a coaxial cable that connects to each of the two machines. Each machine will be getting the same signal of a digital square pulse (that alternates in frequency).
void setup() {
// put your setup code here, to run once:
pinMode(10, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(10, LOW);
delay(1000);
digitalWrite(10, HIGH);
delay(1000);
digitalWrite(10, LOW);
delay(2000);
digitalWrite(10, HIGH);
delay(2000);
digitalWrite(10, LOW);
delay(3000);
digitalWrite(10, HIGH);
delay(3000);
digitalWrite(10, LOW);
delay(4000);
digitalWrite(10, HIGH);
delay(4000);
digitalWrite(10, LOW);
delay(5000);
digitalWrite(10, HIGH);
delay(5000);
}
So basically, this signal will be recorded on both Machine 1 and Machine 2, and then by measuring the time between when similar peaks (ex: the peak after the delay of 3 seconds) arrived on each machine, that will tell me the time difference between each dataset.
I'm still working on soldering a wire that I can use to send this signal to both machines, but I just wanted to post this to get some feedback. Theoretically, this should work right?