I have the stepper motors for my drawing robot connected to the Adafruit motor shield via a bank of 4 double relays.
The reason for this is PURELY to protect the arduino from voltage created by me spinning the stepper motors while setting the thing up.
I have currently got the coils for all 4 (double switch) relays connected to the 5V line on the arduino.(in parallel, if that makes any difference)
As long as the board has power, the relays are closed, and the motors can operate. By unplugging the power from the arduino (powered via usb) the relays open, and i can spin the motors to my hearts content without putting power backwards into the motorshield (or arduino).
I want to add a little more control!
ie, have the arduino automagically, power up the relays when the motors are needed, but have them "normally" disconected the rest of the time, to save me from having to unplug the usb cable every time i want it to do anything!
Can i just move the 5v coil wire directly to a pin, which i set high, or low using the sketch, or should i build in a transistor?
If i should build in a transistor, would 1 do? or should i use one for each relay?
Ideally a hard wired LED indicator would be good (ie, one not affected by code). i could just drop this on in parrallel with the coils with a suitable resistor perhaps?)
a little basic electronics guidence would be greatly appreciated.
I have done this very thing with Shift register. One like an 74HC595. It will be more like two pins ffrom uC though, but you will have 6 more output pins.
During the physical set up of the device, the motors can end up spinning enough to cause the shield power led to light up. Not cool. The addition of the normally open relays Is to stop this. I tried running all the coils through on transistor, but ir didn’t work. I guess the transistor couldn’t provide enough current. If I only isolate one side of each coil, it will still work I pressume? That would halve me coil current requirements…
I ask because, unipolar steppers break out the ground. Given that, it should then be fairly easy to disconnect the ground with a single transitor/MOSFET as suggested. However, I could be completely, and, totally WRONG.