I have just started learning Arduino, so forgive me if I get things wrong.
I am working on a telemetry project for a scale plane used in an engineering competition. We are currently building a scale model (of a scale model, yes, ) for flight testing. Flight data comes from at least three sensors:
A MPU9250 accelerometer for attitude (where the nose is pointing) and lift forces (vertical acceleration minus gravity)
A pitot tube for dynamic pressure, which will also be used to determine airspeed
A rotary encoder attached to a small plate for angle of attack (AoA), or angle at which air hits the plane, relative to the wing.
Each would be connected to an Arduino nano board, and data fed to a micro SD card.
Many of these data points are tightly connected. For example, knowing the AoA and lift force at a certain time allows us to calculate the wing's lift coefficient (CL) and extrapolate what performance a longer wing would result in. However, this only works if all the data has been collected at the same time.
Problem is, I have no idea how to sync data collection on those three boards. I need all sensors to start collecting data at the same time, or have some kind of "time marker" on collected data so we can sync the results. Searching through the forum has given me some leads on connecting the boards to a central one, but not much more.
Thinking you need multiple Arduinos is usually a beginner's mistake.
A basic 16Mhz Nano is many times faster than the sensors you listed.
Combining/processing three data streams does not happen real time and in sync anyway,
and that process could be a lot slower that acquiring the data itself.
One processor, and writing fast non-blocking code is the key.
Then everything seems to happen in 'real time'.
Leo..
If you really need to do this, you can run a PPS (pulse per second) signal from one of the Nanos to the others. All you do is capture the value of millis() when it is received. The offset from that number gives you the subsecond time. The way you handle seconds is up to you...
Wawa:
Thinking you need multiple Arduinos is usually a beginner's mistake.
Thank you for the reply
How would you go about wiring these sensors though? It was my understanding that you can only hook up so many sensors to a nano board given the available pins