relay with PixHawk

Good morning all,
I am currently working on a surface drone project. I use the PixHawk 4 as a flight controller. I want to control a 12V lamp that I will activate or not this lamp. For this, I tried to control it simply with the light function but since this one works in 5V I was not able to use these functions.
So I turned to the use of a relay but I can not control this relay with the existing function.
I want to control the output like a GPIO to turn my 5V relay on or off.
If anyone knows how I can go about it that would be wonderful.
Thanks everyone.

https://ardupilot.org/copter/docs/common-relay.html provides the instructions for how to do this.

Thank you @james_pattison !
But, I’ve already done this :
I connected my 5V relay to my AUX5 output as indicated in the document.
The relay does not change state. Only the LED turns on or off.
When I measure the tension I have

  • = 4.8V
    but when I look at the voltage of my signal when the relay is on I have 3.28V which is not enough to switch my relay.
    Can you help me ?

How frustrating for you!
Sounds like you need to revisit your design.

I’m a little bit stuck on the changes i can do because it’s not only my project…
If somebody knows how to resolve my problem it will be great.
Thank you all.

get a new, better relay that is less power hungry.

like a 3V relay ?
Thank you

Are you fix it ? I have same problem.

Get a small 3V relay. It will work fine.

Thanks your reply .I will buy a relay compatibled with 3.3v for testing.

If possible, can you provide the purchase address or specific product pictures of the relay?

Google “3.3v relay” you will find many.

Can you use a solid state relay instead ?

I found that when I used 5v relay with separately 5v power,it work fine.