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
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).
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.
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.
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.
@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.
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.