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

Moderators: TomKerekes, dynomotion

Post Reply
dmo9
Posts: 3
Joined: Wed Jun 12, 2019 4:27 am

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

Post by dmo9 » Wed Jun 12, 2019 4:33 am

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?

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

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

Post by TomKerekes » Wed Jun 12, 2019 5:37 am

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.
Regards,

Tom Kerekes
Dynomotion, Inc.

dmo9
Posts: 3
Joined: Wed Jun 12, 2019 4:27 am

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

Post by dmo9 » Wed Jun 12, 2019 6:02 pm

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?

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

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

Post by TomKerekes » Thu Jun 13, 2019 9:33 am

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
Regards,

Tom Kerekes
Dynomotion, Inc.

dmo9
Posts: 3
Joined: Wed Jun 12, 2019 4:27 am

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

Post by dmo9 » Thu Jun 13, 2019 11:31 pm

Thanks for the advice, I actually ended up just using an NPN transistor!

Post Reply