Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
IngovM
Created January 28, 2020

The Fire Patrol Drone

Combining autonomous drone patrolling with heat spot detection, alarms, and providing a possibility for live analysis via FPV video stream.

AdvancedFull instructions providedOver 1 day72

Things used in this project

Hardware components

Melexis MLX90614 IR heat sensor
×1
VM275T 5.8GHz 25mW 48CH NTSC/PAL Mini VTX 600TVL FPV Camera
×1
Turnigy 5000mAh 3S 20C Lipo Pack w/XT-60
×1
Quanum Cyclops FPV goggles with integrated monitor and receiver
×1
RDDRONE-FMUK66
NXP RDDRONE-FMUK66
×1
KIT-HGDRONEK66
NXP KIT-HGDRONEK66
×1

Software apps and online services

PX4
PX4
MAVLink
PX4 MAVLink
QGroundControl
PX4 QGroundControl

Story

Read more

Schematics

Melexis MLX90614 IR sensor to NXP Hovergames drone

Connecting Melexis MLX90614 IR sensor to NXP Hovergames drone

Source: https://nxp.gitbook.io/hovergames/addons/melexis-mlx90614

Code

QGroundControl custom widget

XML
Custom widget written in QML for QGroundControl that
o reads and displays the received temperatures from the QGroundControl fact system;
o compares the temperatures against a threshold value. Lower temperatures are reported as Temperature OK, exceeding temperatures cause a Temperature ALARM.

To enable our custom widget click Widget -> Custom Command -> Load hovergames.qml.
import QtQuick 2.2

import QGroundControl.Controls      1.0
import QGroundControl.FactSystem    1.0
import QGroundControl.FactControls  1.0
import QGroundControl.Palette       1.0
import QGroundControl.ScreenTools   1.0
import QGroundControl.Controllers   1.0

Rectangle {
    anchors.fill:   parent
    color:          qgcPal.window
    property var threshold: ({ value: '30.0' })
    

    function testTemperature(temperature) {
        if (temperature < threshold.value) {return "Temperature OK";}
        else {return "Temperature ALARM";}
    }

    function getTemperatureColor(temperature) {
        if (temperature < threshold.value) {return qgcPal.colorGreen;}
        else {return qgcPal.colorRed;}
    }

    CustomCommandWidgetController {
        id:         controller
        factPanel:  panel
    }

    QGCPalette { id: qgcPal; colorGroupEnabled: enabled }

    Column {
        spacing: ScreenTools.defaultFontPixelHeight
        property var    _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle
     
        QGCLabel {
            text:           "Measured Temperature"
        }  
        
        FactTextField {
            // Display the currently measured temperature
            // You can replace it with a specific component id if you like
            fact: _activeVehicle.temperature.getFact("temperature1")
        } 

        QGCLabel {
            text:           "Threshold"
            anchors.right:  parent.right
            anchors.left:   parent.left
            wrapMode:       Text.WordWrap
            visible:        true
        }

        QGCTextField {
            text:           threshold ? (threshold.value ? threshold.value : "") : ""
            visible:        true
            showUnits:      true
            unitsLabel: { return "C" }
            anchors.right:  parent.right
            anchors.left:   parent.left
            inputMethodHints: Qt.ImhFormattedNumbersOnly
            onAccepted: { threshold.value = parseFloat(text) }
            onEditingFinished: { threshold.value = parseFloat(text) }
        }

        QGCLabel {
            text:   { return testTemperature(_activeVehicle.temperature.getFact("temperature1").value) }
            color:  { return getTemperatureColor(_activeVehicle.temperature.getFact("temperature1").value) }
        }  
    }
}

Forked PX4 Firmware

Customized PX4 Firmware • Defined a custom uORB message sensor_hg_mlx90614.msg. • Introduced a new example “hovergames“ in src/examples/hovergames. When started, it reads values from the temperature sensor and publishes them as custom uORB messages. • Added a MavlinkStream for “scaled pressure“-messages in src/modules/mavlink/mavlink_messages.cpp. The code subscribes to our custom uORB sensor message and transmits the measured temperatures via Mavlink MAVLINK_MSG_ID_SCALED_PRESSURE to QGroundControl. • Configured ”SCALED_PRESSURE“ stream to be sent with 1Hz in src/modules/mavlink/mavlink_main.cpp

Credits

IngovM

IngovM

1 project • 0 followers
NXP employee

Comments