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

                  • It kept saying that a float was used in case of a char in id 157 

                    Weird, never seen that before. By the way i was using the console to do it. How do you build it from the eclipse?

                    -Rai Gohalwar

                  • Rai, I use make both from the command line and from Eclipse. What is the error you are getting? 

    • 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

DIY Robocars via Twitter
RT @donkey_car: Human-scale Donkey Car! Hope this makes it to a @diyrobocars race https://www.youtube.com/watch?v=ZMaf031U8jg
Jun 25
DIY Robocars via Twitter
Jun 25
DIY Robocars via Twitter
Jun 16
DIY Robocars via Twitter
RT @GrantEMoe: I won my first @diyrobocars @donkey_car virtual race! Many thanks to @chr1sa @EllerbachMaxime @tawnkramer and everyone who m…
Jun 13
DIY Robocars via Twitter
RT @gclue_akira: JetRacerで自動走行したコースを、InstantNeRFで再構築。データセットは別々に収集 #jetracer #instantNeRT https://t.co/T8zjg3MFyO
Jun 13
DIY Robocars via Twitter
RT @SmallpixelCar: SPC 3.0 Now the motor also works. This car is doable. I just need to design a deck to mount my compute and sensors. http…
Jun 13
DIY Robocars via Twitter
RT @SmallpixelCar: My new car SPC 3.0. https://t.co/CKtkZOxeNQ
Jun 7
DIY Robocars via Twitter
RT @SmallpixelCar: High speed at @diyrobocars thanks @EdwardM26321707 for sharing the video https://t.co/o4317Y2U1S
Jun 7
DIY Robocars via Twitter
RT @SmallpixelCar: Today at @RAMS_RC_Club for @diyrobocars. Used @emlid RTK GPS and @adafruit @BoschGlobal IMU. Lap time 28s https://t.co/R…
May 28
DIY Robocars via Twitter
May 15
DIY Robocars via Twitter
May 14
DIY Robocars via Twitter
May 13
DIY Robocars via Twitter
RT @f1tenth: Say hi to our newest #F1TENTH creation for @ieee_ras_icra next week in Philly. It’s going to be huge! 😎 🔥 @AutowareFdn @PennEn…
May 13
DIY Robocars via Twitter
May 11
DIY Robocars via Twitter
May 8
DIY Robocars via Twitter
RT @SmallpixelCar: Noticed my car zigzagged in last run. It turned out to be the grass stuck in the wheel and made the odometry less accura…
May 8
More…