Time Synchronize between two Arduino

Actually in our project, we have used two different Arduino Nano board with two accelerometer. and we have to measure the accelerometer (3-Axis) output with respect to time. we are measuring same things with this two accelerometer to compare. here to calculate the time, we use millis() function.

now we got output of both accelerometer for a moment but out put shows two different time. because Arduino start operating at different time.

but now we have to make time synchronization (with out any time delay) between this accelerometer output . that means we want to get output of both accelerometer with respect to same time for a specific moment ( outputs shows). So that we could compare the both output easily.

Can anyone help me to Solve this problem?

How far apart are the 2 units?
How accurate must the sync be? Second, millisecond, microsecond?

Common approach is to use a single external oscillator and drive both boards; a trigger starts both boards at the same instant.

GPS can be used if availability to sync to a future (common) start time. GPS is extremely easy to implement via serial and the parsing of the time is simple, no libs required although there is tinygps that is not a hog.

You can use fiber-optic (cheap, non-data) and a phototransistor to generate an interrupt to start both from a common LED flash.

You can use ESPnow to start both Arduinos at the same time...
or LoRa
or https://www.amazon.com/HiLetgo-Transmitter-Receiver-Arduino-Raspberry/dp/B00LNADJS6/ref=asc_df_B00LNADJS6/
or https://www.amazon.com/HiLetgo-NRF24L01-Wireless-Transceiver-Module/dp/B00LX47OCY/ref=asc_df_B00LX47OCY/

Without knowing the precision you need I would suggest "triggering" a reading one the 2nd Arduino from the 1st Arduino.

You can use NOP delays in the 1st arduino to match any delay in the receiving arduino

Take a view here to get some ideas.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.