Gnd vs open output pin

Hi all.

I'm trying to get a brushless DC motor running by driving a motor driver board with a PWM signal from my Arduino UNO. The motor driver board is a ZS-X11D1 from aliexpress, and accepts the PWM signal and runs my motor well.

The problem I have is to reverse the direction of the motor I need to ground a pin on the motor driver. If I physically connect the ground wire to the Arduino then the motor reversed perfectly.

So my question is, can I ground an output pin on the Arduino programmatically, but not have it as +5v the rest of the time? I think I need the pin to be in either of the states of GND, or otherwise disconnected. Is this possible? Any examples"

Thanks for any help/suggestions. Would be much appreciated
Jalac

sounds like you need an open-collector output. you may need to add a npn transistor and resistor (e.g. 1k)

You can make the pin LOW when that pin is set to output.

You can make the pin an input (pullup turned off), leaving the pin floating.

However, keying an open collector/drain transistor might be best.

Wow that was fast. Thanks so much @LarryD and @gcjr.

So I already have a pin that goes to 5v for one direction and 0v for the other. It sounds like the open-collector idea might work off that already? I'll have to research it some more, and see what I can find in my garage regarding transistors (as we're in lockdown prison right now).

cheers guys

Where this discussion should start is with a schematic of what’s being suggested.
Then all contributors are in sync, rather than guessing at the physical arrangement.

An ink on paper is fine for this simple circuit.
Have fun.

When the projects finished and a vague memory, your dev notes and circuit diagram will bring it back to life in minutes.

1 Like

Couldn't you just make that pin an input? then it would look like an open circuit (up to 5V) above 5v it will start to conduct to the supply.

1 Like

Would a diode work for that?

Mentioned, but we need to know if there is a possibility the load can feed back into the input protection diodes.

But, as mentioned many times, a schematic is best when asking hardware questions.

Yes I agree. I only mentioned the effect so the OP didn't think it was really an open circuit. The board he is driving is 5V based so it should not be a problem.

No.

This is called "open collector" or "open drain" output. The UNO can't do it, you would need to use an external diode or transistor.

If that makes something impossible that would otherwise be possible, perhaps you are making an unwarranted assumption as to its importance.

You guys are the greatest! But I'm a little slow at understanding these things as haven't really done a lot of electronics in recent years... I'll figure it out though.

@JohnRob, would your suggestion of making the pin an Input be able to give me an open circuit, and then GND (not 5v)

@LarryD to be honest I'm not really sure how to draw this schematically as it feels like my requirement is too simple. My understanding is that I need a pin that gives me 2 states, GND or Open Circuit.

THANK YOU!

@herbschwarz just a diode connected to the current pin that is outputting 5v or nothing (gnd?). Does this mean the 5V state is effectively blocked by the diode?

@anon57585045 yes, maybe I'm incorrect in my assumption maybe the current pin going high/low would work as it is but I've already killed one of these driver boards by getting something like that wrong. I'll definitely look into the external diode/transistor idea. Can you explain how to connect the external diode as I'm sure I have a supply of those in my garage.

You guys are also the greatest!

THANK YOU!

Perhaps. But you have no evidence that it is the cause.

Yes, but we need to know why your input needs an open circuit ?

Cathode to Arduino pin anode to your load, but, what is the input of the load look like ?

image

Yes as an input the pin looks like an open circuit.

My caveat is it only looks like an open circuit up to 5V. Your motor board is a 5V board so there should be no problem.

Said another way is. The input pin looks like an open circuit but if you connected 6 volts the pin would look like it was connected to 5V

Note: it is likely if you set your pin to HIGH your motor board would be happy.

The only information I have found on this motor driver board is the diagram in my first post. There is simply nothing else I can find out there. Since it shows that pin being grounded, I'm assuming that 5v on that pin is not a good idea. I have blown one driver board already, and I have 3 in total. Willing to give it a try, as I need to order more now anyway.

The better assumption would be, leaving the motor driver input floating will smoke the driver as the input is neither HIGH or LOW !

OK, I agree.

And overall there's so much good information here now. I don't want to waste more of your time.

Wish I could buy you guys a beer or something.

Please leave it with me to have a bit more of a go at it, and I'll let you know where I get to.

Cheers

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.