I’m trying to configure a digital relay switch to turn on a fan during flight. The input is connected to a 12 VDC supply, the output connected to the fan, and the receiver signal input is connected to the M8 PWM port on my flight controller (CUAV 5).
The relay documentation specificies that ‘If the width of the pulse is more than 1600us, the mosfet switch will close, if less than 1400us, the mosfet switch will open.’ The actual pulse width at which the switch opens is dependant on the amplitude of digital signal, so it may be different for different flight controllers. I verified that the switch works by connecting the signal input port to servo tester and measured 0.5 V to be the the signal voltage at which the switch opens.
When I wire the switch to the fan and flight controller and connect to Mission Planner, manually toggling the pulse width from min (100 us) to max (20,000 us, corresponding to 3.3V) in Data → Servos/Relay → output 8 does not turn on the switch.
Is there an additional parameter that needs to be configured in the params list or anything that I’m missing here?
@Yuri_Rage , @dkemxr and @BrunoBagarini I have SERVO8_FUNCTION set to 0, so it should be configured to output PWM signals, but it’s still not turning the switch on. I also verified with an oscilloscope that M8 is indeed sending an output signal when commanded in the GCS.
It’s also possible that you have a voltage problem. Most modern RC devices will trigger on 3v3 logic, but some require 5V. The autopilot will only output 3v3 logic levels. (though rereading your first post…perhaps you’ve already ruled that out)
It also appears you may have misplaced a decimal in your parameters. Use SERVO8_MIN=1000 and SERVO8_MAX=2000. If using RC passthrough, ensure that your transmitter is commanding roughly 1000-2000µs.
I use a higher quality PWM relay from Dimension Engineering on some of my builds, and it always functions properly.
So I think I may have found the issue… I’m measuring 12 mV (basically 0 V) between GND and + pin on M8 port. Should this not be close to 3.3 V?
To clarify the original post - the 12V is the supply to the power input port, not the signal port (I’m using 12V to power the fan which is downstream of the relay). The input signal port power is whatever the flight controller is running off which I believe should be 3.3 V.
To clarify the 20,000 PWM output - I set this arbitrarily high for checkouts to make sure I was testing the max PWM output voltage.
With regards to your comment on ‘conflating voltage with pulse width’:
When mentioning ‘PWM output voltage’ I am referring to the resulting average voltage of the signal when the pulsewidth/duty cycle is changed. When mentioning ‘input voltage’ I’m referring to the voltage upstream of the relay which is used to power the fan.
Understood 20000 may be above the limit, but the intention was to set to 100% duty cycle. Concerns noted, will stick to 2000.
To close the loop here, It looks like all I need to do is connect an external power supply or BEC (tapped off from main battery) to the servo rail (via one of the available Aux ports). Wanted to clarify that this will not cause issues on the FC (given that it is powered by the main module) or impact the performance of other flight critical servos/ESCs.