I want to log analog data from Arduino into the Pixhawk SD card

I have 4 potentiometers that are connected to an arduino that read analog data. I need to log this data into the pixhawk, want to store this data on the SD card available on the Pixhawk.
How do i do this ?

There might be a better solution, but here is mine.
Connect your Arduino to your flight controller using a serial connection.
Look at this tutorial.
Create a message from your Arduino, my personal choice is STATUSTEXT.
You can save these values as a string like:
POT,VAL1,VAL2,VAL3,VAL4
If you want to process this data later, you can filter STATUSTEXT messages starting with POT. And then, for example, you can open this log with pymavlink and then float(string.split(",")[1]) will be VAL1 and so on when you are filtering and processing STATUSTEXT messages.
Let us know when you get there.

Thank you so much for your answer i will try this out for sure.
I am new to this process so I might take some time.
I’ll keep you posted

1 Like

You might also find the NAME_VALUE_FLOAT message useful. Messages (common) · MAVLink Developer Guide

Ok check this also thank you.

I was trying this out but how to use the NAME_VALUE_FLOAT( ).
What is the syntax ?
Should i use serial.write( ) to send data to pixhawk ?
I am very new to this platform, a detailed overview would be very helpful.

You should look at the tutorial.
Everything is in there.

share your code when you get it working, this could be useful for other autopilot users.