Using mosfet relay module for custom lumen light

Is it possible to use a mosfet relay module to switch the lumen led on and off optionaly dim i am using a 20W smd led and the relay module shown in this link

Easy answer: Yes
I use Solid State Relays on a lot of automation products that I need to control higher voltages / current than what I can source with my microcontrollers etc.

Hi @angelorisonk,

It’s not clear to me what you’re asking.

Our Lumen Lights can be switched on/off by pulling the signal wire high or low, and it would be roughly equivalent to tie the signal wire to the power wire and then use a relay to connect/disconnect the power, but for progressive (dim) brightness values it’s expected to send servo-style pulses with durations in the range 1100 - 1900µs.

If you’re making a custom light that’s just an LED connected directly to power then you can control it by switching it on/off, and should be able to achieve dim values using the duty-cycle of a PWM signal (e.g. when it’s on for 30% of the cycle then it’s operating at roughly 30% brightness). Note that PWM brightness should either be significantly higher frequency than a viewing camera, or an integer multiple of the camera’s frame-rate, to avoid the light level flickering in the video stream.

1 Like

Yah i mean i am making a custom waterproof light that the image i shown below i want to just on and off the light PWM dimming is not necessary for me now so i want to use that MOSFET module that i given in the first response to control my light like you did with blue robotics lumen light

Our Lumen includes a controller PCB internally that translates the servo-style pulse commands into the desirable current supplied to the LED (for the commanded brightness level).

For on/off control of a MOSFET you’ll need to provide an on/off signal to it, which (assuming you’re using an autopilot board for running ArduSub) you can achieve by specifying the relevant PWM output pin as a relay output, and controlling that with the joystick buttons.

It’s perhaps worth noting that our Lumen has an exponential brightness curve to give extra control in the dim regions, because too much light can lead to excess backscatter that makes it hard to see anything. You may find that brightness control is quite valuable for practical applications.

1 Like

As mosfet is a voltage controled device by varying voltage we can control the brightness right is it possible to use with autopilot?

Assuming you’re using the MOSFET as a switching device, it is possible to control the LED brightness by providing a PWM signal that you change the duty-cycle of (i.e. rapidly switch the signal voltage between its high and low levels over time, where the proportion of high time determines how bright the perceived light is).

ArduSub’s PWM outputs can be used for that, but you’ll need to adjust the minimum and maximum pulse durations of your lights output pin (using the SERVOn_MIN/MAX parameters) to provide reasonable duty-cycles for the PWM frequency (which I believe is set using RC_SPEED, but that applies to all the outputs, including for the inputs to the thruster ESCs).

1 Like

One clarification @angelorisonk -
The PWM outputs from ArduSub are servo style, NOT traditional PWM. This means a pulse is send that varies between 1 and 2 milliseconds, every 20 milliseconds. As @EliotBR mentioned, you could adjust this duty cycle, but doing so may affect all connected devices that rely on a standard servo signal for control.
You could use the Relay function to turn a light on an off, by sending 3.3v or 0V from a navigator pin (continuously.) Dimming is a more complicated solution, I think your best solution would be to setup a microcontroller to interpret the standard servo signal and convert that to traditional PWM, as is done in the Lumen light.

A further clarification (:stuck_out_tongue:):

The flight controller has a generic PWM driver, and while the autopilot typically uses that to create servo-style signals[1], it is not fundamentally limited to doing so.

The camera mount controls (e.g. Cam Tilt and Cam Pan) are based on SERVOn_MIN/MAX parameter ranges (which can be “force” set to pulse durations that represent desirable duty cycles given a known output frequency - e.g. 0-5000µs pulse-durations for the standard 200Hz PWM frequency gives 0-100% PWM duty-cycle). I have just verified that this works as expected on the Navigator flight controller, using an oscilloscope to probe the relevant pin.

I assumed the lights were the same, but because they’ve been implemented as a pseudo RC passthrough the relevant limit parameters are instead the RCn_MIN/MAX ones.

Note that the frequency is shared across multiple PWM outputs, so changing that is ill-advised without considering the carry-on effects (e.g. if a common servo-style signal requires pulses with durations up to 2000µs then the frequency should be kept below 500Hz, and preferably lower for some extra head-room), but since the durations are controllable per pin it’s fine to change those as relevant.

  1. These are 1-2ms pulses, but the frequency is not critical. A 20ms period would be 50Hz, which is the default for the Pixhawk AUX pins, but the Navigator and the Pixhawk’s MAIN pins use 200Hz by default (5ms period). ↩︎

Thank you for your assistance. I’ve decided to proceed with fabricating Blue Robotics lumen PCB design, as I believe it will allow me to dim the light more efficiently without encountering any issues. However, I have a question regarding the use of a 12V, 20W SMD LED: Will I need to make any adjustments on the programming side to regulate the voltage, or is there something specific I should do to ensure proper operation?

I wasn’t involved in the design of our driver, but it is apparently set to run up to 2 amps, so if your LED is incapable of handling that then you’ll need to either avoid the top of the output range, or modify the circuit components to suit your application (you should be able to check an A6211 datasheet for the relevant details).

mine is approx 1.7 amps only should i increse the resistance value?

The datasheet specifies

Accordingly I’d expect that for a desired current of 1.7 A you would want R_{SENSE} \approx 0.118\Omega.

For reference the value in our schematic is 0.082\Omega, although that has an expected i_{LED} = 2.44 A, so I’m not sure if @rjehangir’s original statement about 2A being the designed current in our schematic is incorrect, or if there’s more to the calculation for R_{SENSE} that I’ve missed from my quick peruse of the datasheet.