# Unable to use relay output on pixhawk or RPi

**URL:** <https://discuss.bluerobotics.com/t/unable-to-use-relay-output-on-pixhawk-or-rpi/12540>\
**Category:** QGroundControl\
**Created:** [July 19, 2022, 1:24pm UTC](https://discuss.bluerobotics.com/t/unable-to-use-relay-output-on-pixhawk-or-rpi/12540 "2022-07-19T13:24:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![etienne](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/etienne/32/1942_2.png) [@etienne](https://discuss.bluerobotics.com/u/etienne)\
**Post date:** [July 19, 2022, 1:24pm UTC](https://discuss.bluerobotics.com/t/unable-to-use-relay-output-on-pixhawk-or-rpi/12540/1 "2022-07-19T13:24:09Z")

</div>

Hi @EliotBR ,

Hope you are well.

A client of mine is asking how to control our LASER via the pixhawk and I thought I’d give it a try.

To turn the laser off, the control wire must be set to 0V, to turn it on, anything other than 0V.

I was thinking the relay output would be the key but I guess I am not understanding how this work.

I have the LASER signal pin only connected to PWM sig on AUX1 on the Pixhawk.

I have a button assign to button input 9 and assigned that to Relay 1 Toggle (on/off). I then configured relay 1 to be on AUX1.

I would expect either 0 or 3.3V to appear on AUX 1 signal but got nothing.

What am I doing wrong?

FYI I also tried to map it to GPIO pins 5 or 6 and still no results.

I guess I am missing something.

Cheers,  
E.

---

<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:** [July 19, 2022, 1:30pm UTC](https://discuss.bluerobotics.com/t/unable-to-use-relay-output-on-pixhawk-or-rpi/12540/2 "2022-07-19T13:30:41Z")

</div>

Hi @etienne,

I’m off to sleep now, but [this comment](https://discuss.bluerobotics.com/t/how-to-set-up-leak-sensor-on-non-pixhawk-hardware/11589/2) may be relevant - I expect it’s likely an issue with the pin(s) being incorrectly configured as GPIO or PWM.

If that doesn’t help, please specify which ArduSub version you’re testing with and I’ll try to verify the behaviour later in the week.

---

<div class="post-metadata">

**Author:** ![etienne](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/etienne/32/1942_2.png) [@etienne](https://discuss.bluerobotics.com/u/etienne)\
**Post date:** [July 19, 2022, 1:45pm UTC](https://discuss.bluerobotics.com/t/unable-to-use-relay-output-on-pixhawk-or-rpi/12540/3 "2022-07-19T13:45:44Z")

</div>

Thanks for the quick response.

I will have a look in the morning.

I am running the latest stable version and BLUOS.

Cheers,  
E.

---

<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:** [July 21, 2022, 4:37am UTC](https://discuss.bluerobotics.com/t/unable-to-use-relay-output-on-pixhawk-or-rpi/12540/4 "2022-07-21T04:37:34Z")

</div>

Did this end up getting resolved?

I’ve just tried with both ArduSub 4.1.0 (latest stable) and 4.0.3 (previous stable), and leaving the AUXOUT5 as the default `RELAY_PIN` works fine for me with the relay\_1 joystick functions.

I then tried to get AUX 1 working as a relay, which worked once I set `BRD_PWM_COUNT` to No PWMs (since they start counting from AUX 1) 🙂

---

<div class="post-metadata">

**Author:** ![etienne](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/etienne/32/1942_2.png) [@etienne](https://discuss.bluerobotics.com/u/etienne)\
**Post date:** [July 21, 2022, 5:51am UTC](https://discuss.bluerobotics.com/t/unable-to-use-relay-output-on-pixhawk-or-rpi/12540/5 "2022-07-21T05:51:19Z")

</div>

Hi Eliot,

I tried setting Servo9 to disabled and it didn’t do anything. On the Scope it was still a PWM.

I also tried GPIO6 and nothing happened. The output was always high.

I will give this another go.

Cheers,  
Etienne

---

<div class="post-metadata">

**Author:** ![etienne](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/etienne/32/1942_2.png) [@etienne](https://discuss.bluerobotics.com/u/etienne)\
**Post date:** [July 21, 2022, 6:46am UTC](https://discuss.bluerobotics.com/t/unable-to-use-relay-output-on-pixhawk-or-rpi/12540/6 "2022-07-21T06:46:44Z")

</div>

Hi Eliot,

We tried it and got the same results as you.

Unfortunately setting `BRD_PWM_COUNT` to No PWMs means AUX2 can’t be used for tilt and AUX3 can’t be used for Manip.

So we just connected it on AUX5.

Many thanks for your help.

Cheers,  
E.
