Im unable to control a relay connected to AUXPIN 7 in servo/relay tab. (Pixhawk 6c)
Coil pins one goes to signal and the other to GND.
relay1_function 1
relay1_pin 56
relay1_default On
My output: RCOut: PWM:1-8 DS600:10-14 PWM:15-16
I tried another option just in case only the first 6 aux work for relays by moving the DS600 to 5-8 and use AUX 2 for the relay but nothing changed.
Also tried to set servo15_function as GPIO but not work.
I have tested the relay independently by connecting coil pins one to GND and one to 5V, I was able to hear clicking sound.
anything I miss !!
I think you have most of the correct parameters, but there is not enough current supplied on the GPIO pins to actually drive most relay coils (and the output is 3v3, not 5v). You should set SERVO15_FUNCTION to -1 in addition to (not in lieu of) the rest of the relay parameters. Once the parameters are correctly set, you risk damaging the GPIO pin by attempting to directly drive a relay coil, so use caution there.
You should use a solid state relay, RC relay (that operates on RC signals), or a logic-based relay board designed for use with microcontrollers. Let me know if you need specific examples of that hardware.
According to its datasheet, the coil draws 450mA, which will almost certainly damage your autopilot. Thatās about an order of magnitude more than the max current you should ever expect out of any GPIO pin.
Iāve been using the 8 channel version of this board for several years without failure.
And here is an RC-based relay that is fairly high quality. I use them in several projects. You donāt have to set them up as relays at all - just drive them with a 2-position RC switch (SERVOx_FUNCTION=RCINx - or similar, depending on use case).
I reviewed the TE relay datasheet and found that the coil power is rated at 450mW. For a 5V relay, this results in a current draw of approximately 90mA. Could you clarify where the 450mA current figure you mentioned is coming from? Iām looking to understand this better and would appreciate your guidance on this. https://www.te.com/en/product-2-1419128-9.datasheet.pdf
Pending PR to update the docs with a warning regarding GPIO current limits. Per the STM32 datasheet, you really ought to limit any given pin to 8mA, though you might get away with up to 20mA. There is also a max current draw across all IO pins of ~150mA, so thereās not much headroom.