# How to set up leak sensor on non-pixhawk hardware

**URL:** <https://discuss.bluerobotics.com/t/how-to-set-up-leak-sensor-on-non-pixhawk-hardware/11589>\
**Category:** Blue Robotics Software\
**Tags:** ardusub\
**Created:** [February 20, 2022, 6:11am UTC](https://discuss.bluerobotics.com/t/how-to-set-up-leak-sensor-on-non-pixhawk-hardware/11589 "2022-02-20T06:11:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yeclek](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/yeclek/32/8578_2.png) [@yeclek](https://discuss.bluerobotics.com/u/yeclek)\
**Post date:** [February 20, 2022, 6:11am UTC](https://discuss.bluerobotics.com/t/how-to-set-up-leak-sensor-on-non-pixhawk-hardware/11589/1 "2022-02-20T06:11:10Z")

</div>

Does anyone have any experience setting up the leak sensor on non-pixhawk hardware? I’m using a Matek H743-Wing V2. I have attached the sensor to S10 and manually selected pin 59 in QGC according to the mapping chart below.

 ![Screenshot 2022-02-19 220249](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/e/e9767d10ac696f1d312424a4ecce2c023c76ee8d.jpeg)

So far it doesn’t seem to work. I feel like I’m missing something with the pin resource assignment but I can’t find any further information. The autopilot does not have a BRD\_PWM\_COUNT parameter but I’m thinking there must be some way to define the pin as GPIO instead of PWM.

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [February 20, 2022, 11:22pm UTC](https://discuss.bluerobotics.com/t/how-to-set-up-leak-sensor-on-non-pixhawk-hardware/11589/2 "2022-02-20T23:22:35Z")

</div>

> [@yeclek](#):
>
> The autopilot does not have a BRD\_PWM\_COUNT parameter but I’m thinking there must be some way to define the pin as GPIO instead of PWM.

Historically [`BRD_PWM_COUNT`](https://www.ardusub.com/developers/full-parameter-list.html#brdpwmcount-auxiliary-pin-config) has been **the** way to configure which pins are PWM vs GPIO, [across ArduPilot](https://ardupilot.org/copter/docs/common-gpios.html). Seems like [last year there were some changes](https://github.com/ArduPilot/ardupilot/pull/18018) to increase flexibility, so more recent firmwares just require setting the relevant [`SERVOn_FUNCTION`](https://www.ardusub.com/developers/full-parameter-list.html#servonfunction-servo-output-function) to Disabled (-1), or alternatively using [the new `SERVO_GPIO_MASK` parameter](https://github.com/ArduPilot/ardupilot/pull/18208) 🙂

This is something we’re yet to document because it doesn’t yet affect the stable firmware, but we’re currently in the process of improving our documentation system to support multiple software/firmware versions, so in future these kinds of changes should be documented pretty much as they occur 🙂

---

<div class="post-metadata">

**Author:** ![yeclek](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/yeclek/32/8578_2.png) [@yeclek](https://discuss.bluerobotics.com/u/yeclek)\
**Post date:** [February 25, 2022, 4:49am UTC](https://discuss.bluerobotics.com/t/how-to-set-up-leak-sensor-on-non-pixhawk-hardware/11589/3 "2022-02-25T04:49:08Z")

</div>

Thank you for your help! I see that the servo channel I’m using is currently disabled but it’s still not working. At least I know I’m on the right track. 🙂

---

<div class="post-metadata">

**Author:** ![williangalvani](https://avatars.discourse-cdn.com/v4/letter/w/6f9a4e/32.png) [@williangalvani](https://discuss.bluerobotics.com/u/williangalvani)\
**Post date:** [February 25, 2022, 3:34pm UTC](https://discuss.bluerobotics.com/t/how-to-set-up-leak-sensor-on-non-pixhawk-hardware/11589/4 "2022-02-25T15:34:57Z")

</div>

I suspect this is the issue:

> <https://github.com/ArduPilot/ardupilot/blob/Sub-4.0/libraries/AP_LeakDetector/AP_LeakDetector.cpp#L73>

apparently we don’t accept numbers above 55. I don’t really know the historical reasoning behind that. Try increasing that number and check if it works on your setup.

---

<div class="post-metadata">

**Author:** ![yeclek](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/yeclek/32/8578_2.png) [@yeclek](https://discuss.bluerobotics.com/u/yeclek)\
**Post date:** [February 26, 2022, 2:54am UTC](https://discuss.bluerobotics.com/t/how-to-set-up-leak-sensor-on-non-pixhawk-hardware/11589/5 "2022-02-26T02:54:51Z")

</div>

Thank you! I’ll try it out this weekend.
