# Problems with Pix Relay

**URL:** <https://discuss.bluerobotics.com/t/problems-with-pix-relay/9671>\
**Category:** ArduSub\
**Created:** [May 14, 2021, 9:27am UTC](https://discuss.bluerobotics.com/t/problems-with-pix-relay/9671 "2021-05-14T09:27:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![josef](https://avatars.discourse-cdn.com/v4/letter/j/ec9cab/32.png) [@josef](https://discuss.bluerobotics.com/u/josef)\
**Post date:** [May 14, 2021, 9:27am UTC](https://discuss.bluerobotics.com/t/problems-with-pix-relay/9671/1 "2021-05-14T09:27:23Z")

</div>

I am trying to setup a simple on/off switch for my lights but cant get it working and think I am doing something wrong (and stupid) with the wiring. Anyway the issue - Have custom built lights that I wanna turn on and off with the pix relay function. I have read through all the “relay” posts in the forum and (think) I understand the configuration.

I have tried with aux 4 (after configuring BRD\_PWM\_COUNT to 3) assigning relay 3 toggle function to the controller button (in my case the nr: 13 that normally operates the lumen brightness) and the relay parameters.

My question is since I only have one PWM cable from the lights I assume it is connected to the Aux 4 where the signal is supposed to go (lowest pin) I also connected a BEC ground cable to the upper pin on AUX 4 but get very small V change when pressing the button, like 0.003v. Also do I need a + input to AUX 4 for this to work and in that case from a bec (mains would fry the PIX right)?

I have checked the lights by connecting the PWM signal cable to 5v and works so I know the lights are fine. So in summary, in AUX4 what line goes to what pin and from where?

Appreciate any help.

---

<div class="post-metadata">

**Author:** ![josef](https://avatars.discourse-cdn.com/v4/letter/j/ec9cab/32.png) [@josef](https://discuss.bluerobotics.com/u/josef)\
**Post date:** [May 14, 2021, 6:32pm UTC](https://discuss.bluerobotics.com/t/problems-with-pix-relay/9671/2 "2021-05-14T18:32:08Z")

</div>

Figured it out eventually. It seems that there is not sufficient power for the pwm cable, when lights are connected the voltage drops under 0.02v while it gives 3.3v when disconnected. I guess I need to use this:

 ![gpio setup](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/9/99e43b11b10d43f0c31867e6a8970b2135dea8fa.jpeg)

I do however have this from an earlier project:  
 ![turnegy switch](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/3/3e4ca7c772a5df4da3e7d9b913a11a6b6fefeb75.jpeg)

Would that maybe work with servo signal?

---

<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:** [May 18, 2021, 2:32am UTC](https://discuss.bluerobotics.com/t/problems-with-pix-relay/9671/3 "2021-05-18T02:32:26Z")

</div>

Hi @josef,

As per the [pixhawk documentation](https://ardupilot.org/copter/docs/common-powering-the-pixhawk.html#overview), the pixhawk doesn’t actually supply power to the servo rail - it’s intended that either something else does, or you can [power the pixhawk itself from that rail](https://ardupilot.org/copter/docs/common-powering-the-pixhawk.html#powering-backup-off-the-servo-rail), or the servo rails can be used for just the signals and you power your devices externally.

> [@josef](#):
>
> I guess I need to use this:
> 
> ![gpio setup](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/9/99e43b11b10d43f0c31867e6a8970b2135dea8fa.jpeg)

Your suggested connection diagram should work, except I’d recommend also connecting the ground wire to the pixhawk ground. Ground is used as an electrical reference point, so if your signal voltage is relative to a different reference to the transistor then it could float and give unexpected/undesired results.

> [@josef](#):
>
> I do however have this from an earlier project:  
> ![turnegy switch](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/3/3e4ca7c772a5df4da3e7d9b913a11a6b6fefeb75.jpeg)
> 
> Would that maybe work with servo signal?

From a brief search, I wasn’t easily able to find out what kind of signal the turnigy switch requires to turn on and off. The [hobbyking listing](https://hobbyking.com/en_us/turnigy-receiver-controlled-switch-1.html?___store=en_us#qa%5BbW9kZT03JnBhZ2U9MSZxdWVzdGlvbl9zZWFyY2hfY29udGVudD0=%5D) mentions that “The Turnigy switch will complete a circuit when the radio channel passes 50%”, in which case I would assume it should work to give it a DC input (as in the [relay toggle pixhawk option](https://ardupilot.org/copter/docs/common-relay.html) you’ve said you’re trying to use).

---

<div class="post-metadata">

**Author:** ![josef](https://avatars.discourse-cdn.com/v4/letter/j/ec9cab/32.png) [@josef](https://discuss.bluerobotics.com/u/josef)\
**Post date:** [May 19, 2021, 8:04pm UTC](https://discuss.bluerobotics.com/t/problems-with-pix-relay/9671/4 "2021-05-19T20:04:51Z")

</div>

Dear Eliot,

Many thanks for your support really appreciate that.

> [@EliotBR](#):
>
> From a brief search, I wasn’t easily able to find out what kind of signal the turnigy switch requires to turn on and off.

Never got it working. There is many posts about this switch, on how unreliable it is so I scrapped it.  
I believe i have two viable options, one is a simple pwm relay:

 ![20210519_212252](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/9/9d17a7c9c42ccfeacf43aca72ace1fbefc35d9e7.jpeg)  
I connect the signal and ground to pix (aux5) and assign relay toggle to a button and it works fine toggling 0.20v and 3.3v. The issue with this is that even with 0.2v the relay switches on so lights are on all the time. Maybe a resistor can fix this?

The other option is a cheap pwm switch similar to the turnigy one.

 ![20210519_212315](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/d/da5e31569fdfebcea9908ab4e4cb79616c8feab1.jpeg)

I got it working fine through a servo tester where it turns on on high and off on low. I just need to grasp on how to adjust the limits on the pix servo channels.

I would much rather use the relay, seems simpler.

---

<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:** [May 19, 2021, 10:57pm UTC](https://discuss.bluerobotics.com/t/problems-with-pix-relay/9671/5 "2021-05-19T22:57:11Z")

</div>

> [@josef](#):
>
> The issue with this is that even with 0.2v the relay switches on so lights are on all the time. Maybe a resistor can fix this?

I would probably suggest using a diode (or LED if you want) over a resistor, but I believe both should work.

> [@josef](#):
>
> I got it working fine through a servo tester where it turns on on high and off on low. I just need to grasp on how to adjust the limits on the pix servo channels.

This approach should also work if it accepts a signal the pixhawk can create (e.g. PWM between 1100-1900us, or On/Off), but up to you what you decide to use 🙂
