Page 1 of 1

Is it possible to set a digital output to open collector?

Posted: Wed Jun 12, 2019 4:33 am
by dmo9
On my CNC, the spindle relay is currently controlled by an open collector on its ground. Is it possible to configure one of Kflop's digital outputs to be open collector or can they only drive high?

Re: Is it possible to set a digital output to open collector?

Posted: Wed Jun 12, 2019 5:37 am
by TomKerekes
It depends on the voltage and current. KFLOP IO are basically 3.3V Outputs that drive high and low. Changing to input mode basically makes it “open” but it is still diode clamped to the 3.3V supply.

Re: Is it possible to set a digital output to open collector?

Posted: Wed Jun 12, 2019 6:02 pm
by dmo9
Thanks for the quick reply - your reputation for responsiveness was a major deciding factor in my purchase decision.

To see if I understand correctly and assuming my 5V relay does not pull too much current, the way to do this would be to drive the digital I/O low when I want to turn the relay on and then switch the Digital I/O to an input when I wish I turn it off. Is that correct?

Re: Is it possible to set a digital output to open collector?

Posted: Thu Jun 13, 2019 9:33 am
by TomKerekes
Hi dmo9,

KFLOP IO can only sink 16ma max. It is unlikely a relay coil will work with that limited current.

It isn't usually a good idea to connect inductive coils directly to KFLOP. If you do, be sure to ad a reverse flyback diode across the coil.

Setting a KFLOP output high will essentially connect it to 3.3V. So the 5V relay will "see" ~1.7V and likely turn off.

Setting a KFLOP as an input will allow it to float to ~3.8V. So the 5V relay will "see" ~1.2V and likely turn off. Not much difference in your case but if opto couplers are involved where the LED begins to conduct at 1.4V it can make a difference.

Consider using a relay board with coil drivers such as this.

HTH

Re: Is it possible to set a digital output to open collector?

Posted: Thu Jun 13, 2019 11:31 pm
by dmo9
Thanks for the advice, I actually ended up just using an NPN transistor!