Help: Is this circuit safe?
I'm building a simple project that contains a motor, for which I'm using an 28BYJ-48 and ULN2003 to drive it. I understand that motors are inductors and should be driven with a different voltage source to avoid reverse current / voltage when the motor is powered off. However, that is an annoyance and I can't see why anyone would design a project that needs two separate power sources.
With that in mind, I've tried to come up with a circuit that allows me to power all the components with the same 5V power supply, but I am not 100% sure this is safe and / or efficient. Here's the schematic:
The voltage drop of the schottky is a source of energy wasted as heat and I'm not convinced it'll really protect the rest of the circuit. For instance, I wonder whether I need a way to discharge that motor with a path to ground through a resistor. There's also the matter of the capacitor, that I hope is enough to smooth the voltage across the motor.
Any input appreciated! I'd rather not burn the arduino nor waste unnecessary amounts of energy!
So looking into how the motor is wired I believe the problem will be with the coils and not the Vin of the stepper. I've made a change to the schematic to what I think is correct. Please check this one and let me know if this is right:
If you have your circuit wired as the schematic indicates then diodes D2 - D5 are having no effect at all. You are showing the diodes as being shorted between the leads.
The correct way to provide protection using Schottky diodes for this type of motor is to connect the anode of each of the 4 diodes to the A+, A-, B+ and the B-. Then connect all of the cathodes to the 5 Volt supply. However, if you look at the datasheet for your motor driver chip you will notice that it already has diodes connected in this fashion.
@ruplicator You're right! The diodes should be connected to 5V. I also noticed after posting that the motor driver has the diodes already. It does not seem to have a diode on the COM line, so I wonder if there could be reverse voltage there at any point. Should I worry about it and add a diode to the COM?
And one other question. The capacitor C1, what would be a good value or how would you go about finding the right value for it?
Should I worry about it and add a diode to the COM?
No, if you look at how the current flows when each motor driver circuit is turned off there is no need. When the motor driver circuit is turned off current flows in the opposite direction from the motor as it did when when it is turned on. This causes the current to flow through the diode in a closed loop until resistive losses dissipate the current.
The capacitor C1, what would be a good value or how would you go about finding the right value for it?
This is more complicated. First, this particular capacitor is used for electrical noise reduction that can be caused by more than just the motor. You can tell by its small value and it wouldn't be an electrolytic capacitor. If the circuit designer was trying reduce ripple noise from the power source the capacitance would be much larger, in the 10-100uF range, not the 10nF as C1 is. The high frequency noise this capacitor is used for is caused by the switching in digital circuits. Those square waves you see on oscilloscopes monitoring digital circuits create very high frequency harmonics each time they switch. So any of the circuits including the motor circuits can cause high frequency spikes but in this case the motor switching is the most likely cause of spikes. This is because these spikes are made worse by fast switching, high current and long wires; all of which the motor circuits have.
To your question on calculation of a value is beyond my ability and in reality a purely mathematical solution is too complicated for the hobbyist needs. If you really want to get into it you can review this paper
A 10nF with low internal resistance is a good rule of thumb value that is typically good for controlling unwanted high frequency noise.
@ruplicator, got it. Thank you for the paper, I'm reading it but I agree that it may be beyond the scope of a simple project like this one. Thanks!