Custom sensors and Real-Time logging

Hi everyone,

Does anyone have experience with configuring their own sensors onto the Pixhawk (I have an IRIS)? I purchased a gas sensor that I'd like to wire to it, does anyone know of any good resources to help me get started? I've downloaded the PX4 development environment from the Pixhawk developers website and have gone through some of the "getting started" instructions on there, I have been able to install the firmware through Eclipse as opposed to the Mission Planner. I also purchased 3-position and 5-position connectors for the analog inputs.

I was also wondering if there is a way to view the telemetry log data on Mission Planner during flight? If I did add this sensor, would data be saved through the telemetry logs or dataflash logs?

I appreciate whatever help I can get, thank you!

Kate

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

    • Wow, this is great. Can't thank you enough for this.

      Just to clarify, you did this with an Arduino communicating between the sensor and Pixhawk? Do you know if there is a way to eliminate using the Arduino?

      Thank you!

      • Sorry to be unclear. The second post was referring to using the Pixhawk only with a sensor connected to pin 13 on the ADC3.3 port. The output is the voltage present on this pin. The code in the first post was not used - only those changes listed.

        pixhawk11-212x300.jpg

        • James,

          I've made the changes as you've described, but how are you reading pin 13 into sonar_alt? I will be using pin 15 and am not sure where/how that needs to be changed in the code.

          Thank you!

          Kate

          • Kate,

            Please alter the line:

                test_adc = hal.analogin->channel(13);

            to

                test_adc = hal.analogin->channel(15);

            It also looks like GCS_Mavlink.pde has changed in master...

            Please ignore the above and alter your code like this starting from line 402:

            #if CONFIG_SONAR == ENABLED
            static void NOINLINE send_rangefinder(mavlink_channel_t chan)
            {
                // exit immediately if sonar is disabled
                if (!sonar.healthy()) {
                    // return; commented out
                }
                mavlink_msg_rangefinder_send(chan, sonar_alt * 0.01f, 0);
            }
            #endif

            You are welcome!

        • Got it. Once I get my connectors in the mail, I'll start testing. Thank you so much for your help!!

  • Hi Kate,

    This is not exactly what you want but it may give you some ideas. It is an example of using an external Arduino (Nano) to collect data from a number of sensors and communicate the data back to the APM 2.5 via i2c where it is logged (dataflash).

    http://diydrones.com/forum/topics/incporating-sensor-data-into-the-...

    I have not done a lot with the telemetry logs but I suspect that the easiest option would be to substitute your data for some existing parameter that is passed over the telemetry link.

    I will have a go at compiling this example with the Pixhawk and report back

This reply was deleted.

Activity