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.
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 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.
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?