Transferring MAVLink data to MicaSense sensors
MicaSense sensors accept several MAVLink protocol messages, mostly regarding GPS information, aircraft attitude, and camera control. A list of commands and specifically how the camera interprets each message is located on our RedEdge Serial API Page
When sending these messages to the camera, they should come through telemetry ports 1 or 2 (TELEM 1 and TELEM 2 on the Pixhawk), which will likely need to be configured prior to use if you have not used it before. This can be done through mission planner, for TELEM 2 for example, by setting the SERIAL2_BAUD field to 57. The camera expects a baud rate of 57600 for MAVLink messages. Additionally, ensure that the SERIAL2_PROTOCOL is set to 1 for GCS MAVLink.
For each of the TELEM ports, pin #2 is the TX line, pin #3 is the RX line, and pin #6 is GND. These will need to be hooked up to their respective counterparts on the camera.
The “COMM” port on the camera is where these messages will be sent and received, pin #1 is the serial RX (Output from camera) line, and pin #2 is the serial TX line (Input to camera). Pin #3 is serial ground. A full pinout for the camera can be found in the your sensor's Integration Guide.
The 8-pin DF13 pigtail connector that is provided with the camera can be used to connect to the COMM port on the camera, though you will need to solder the wires on the lines listed above to another set of wires, which will need to have DF-13 crimped ends which can be placed in a 6-pin DF13 connector to plug into the Pixhawk’s TELEM 2 port.
In Mission Planner you will need to configure a few parameters based on the MAVLink messages that you are intending to send to the camera. For example, when using TELEM2 as your transmitting port, the SR2_XXXX fields will correspond to the update rate for various messages being sent from the pixhawk.
SR2_EXT_STAT will send the GPS_RAW_INT message
SR2_POSITION will send the GLOBAL_POSITION_INT message
SR2_EXTRA1 will send the ATTITUDE message
SR2_EXTRA3 will send the SYSTEM_TIME message
The rate at which these messages are sent can be adjusted by clicking on the CONFIG/TUNING icon and then clicking Planner on list on the left side.
The “Telemetry Rates” field is where you will be able to tune the update rates:
Attitude will control the ATTITUDE message
Position will control the GLOBAL_POSITION_INT message
Mode/Status will control the GPS_RAW_INT message
Sensor will control the SYSTEM_TIME message
The values correspond to the update rate in Hertz (Hz), so a value of 1 will send the message once per second. A value of 4 (Hz) will ensure that each capture has reasonably accurate metadata.
You will likely encounter one of two wiring scenarios when setting up your pixhawk-to-MicaSense connection; either you will have one of the telemetry ports free to use for the MicaSense MAVLink communication, or you will need to “Y-off” the TX and GND from another connection if you are already using both ports. This can be done by soldering the wire coming out from the pixhawk to two other wires, forming a “Y” shape.
Now that you have all your data rates and connectors configured, you are ready to plug a connection from the pixhawk into your MicaSense camera and start capturing data!
Triggering RedEdge through PWM
The camera can be triggered through a PWM signal coming from the pixhawk’s auxiliary out pins. The camera expects to see a PWM trigger in the range of 1.0ms to 2.0ms and can be rising edge or falling edge triggered. On the pixhawk, you will need to configure one of the sets of pin to be a camera trigger, then you will be able to set your trigger style; this can be done in software such as mission planner.
Additionally, you will need to setup your camera such that it is expecting the proper edge for triggering. This can be done through the Advanced Settings page by setting the Auto-Capture Mode to “Ext. Trigger” and setting the Ext Trigger Mode to your signal of choice. More detail can be found in the User Guide for MicaSense Sensors.
Once this is set up, connect the pixhawk’s auxiliary out port that you assigned as a camera trigger to the Camera's trigger input pin (check your integration guide).