Digital output to switch +24VDC

Im currently working on a project which requires an Arduino to supply a control unit with +24VDC as a logic input.

Ill try and write out a diagram of what I have shortly, but in essence it's a 24VDC battery source with a 5VDC buck converter with linked common for the Arduino.

There's a pull down resistor for PIN 2 on the Arduino.

The control unit connects to the 24VDC supply and has a single logic input for +24VDC to trigger an internal function.

I was looking to use a relay (+ diode) and a resistor to provide the switch as fast switching isn't necessary, but it looks like a MOSFET might be an option to make this faster and dissipate less energy.

I've looked at a logical MOSFET but haven't yet got one to test with.

Could anyone assist with whether a logical MOSFET is a suitable option for switching +24VDC from the Arduino digital 5v pin, please?

I've come across a few similar topics, but they don't quite seem to fit.

Sorry for being a noob.

Thanks.

Get the MOSFET data sheet and check the maximum Vds.

Yes, that works. I successfully uses an IRLIZ44N to control a 24V LED strip.

IRF8721PBF

You'll have to explain that a little more.
Maybe you don't need a MOSFET.

1 Like

Ok, so I've tried to draw up what I was intending to do with a relay, then what I thought might work with a MOSFET.

Sorry, it's a bit rushed and on paper. Hopefully it's enough to roughly explain it. Assume R values are suitable for their purpose (not yet calculated).

Arduino PIN 2 is pulled down until triggered high.

The control box PIN A input only expects to see B+ (24v) with negligible current draw as a logic input. I have yet to test this.

Is the second drawing with the MOSFET correct? I saw some diagrams with an additional transistor for controlling the FET gate, but not sure if that's required if the FET is a logic variant with suitable 5v gate saturation?

Thanks.


1 Like

Thanks for redrawing it, although wouldn't PIN A be in a 'high' state all the time, if connected directly to the + before the FET? Or is that what R3 achieves by limiting it until the 'switch' is closed?

Do you know what a suitable replacement would be? I know these are available on the 'slow boat' but would rather buy from a trusted source and this part is obsolete. The end of life notice doesnt give a suitable replacement, unfortunately. Thanks.

If you are only switching a low current logic signal (<10mA), I would use an optocoupler.
pc817xnnsz_e-1.pdf (320.9 KB)
https://media.digikey.com/pdf/data%20sheets/lite-on%20pdfs/ltv-817_827_847(m,s,s_ta1).pdf
opto24V

Thanks for the suggestion. I hadn't looked at optocouplers.

It will be HIGH when the FET is Off.

Another possibility is to use an NPN transistor.
A BC547C would be a good choice.
In stock Digi-key and Mouser, only $0.35 USD

Well, we don't know if the signal is HIGH true or LOW nor the current magnitude, so...

I think an IRLIZ34NPBF is a usable replacement that still can be ordered.

Thanks jim-p. I've got one of those to hand and gave it a go, but it's doing the opposite of what I need.

It currently gives +24VDC when the base is unpowered, and nothing when the base is powered.

Whilst I can change the code to swap the logic, the issue is that PIN A will be active while the Arduino boots up for a couple of seconds, until it can output HIGH, which could have undesirable consequences for the control unit.

Is there a way to easily swap this so it's off by default, then +24VDC when PIN 2 is HIGH?

Thanks.

Update: PIN A only draws a couple of mA at most.

Add a pullup resistor to Vcc to keep the transistor ON by default.

1 Like

This will ensure that PIN A is LOW when the Arduino is OFF, UNPOWERED, BOOTING or DEAD.

1 Like