I find that using a dedicated Power Supply for the Servo, rather than using the power from the voltage regulator on the NANO is a better option.
So, I decided to make a driver board that would fit on one of the sockets on the NANO CNC Shield.
There are three sockets on the CNC Shield for Stepper Motor Drivers.
The schematic for the CNC Shield look like this:
Please Note! This is a cloned CNC Shield, pins are different on the original Keyestudio Shield.
Looking at the schematic we see that the Arduino pin D8 goes to all stepper enable pins, so that can't be used for the servo.
If we look at what other pins are used, we see that each driver has a direction and step pin, all of which are have independent Arduino pins.
So if we use one of the sockets there are two Arduino pin available to us.
But which socket to use?
Socket X uses: D2 and D5
Socket Y uses: D3 and D6
Socket Z uses: D4 and D7
If we look at what the pins can do:
We can see that D3, D5 and D6 have PWM output.
Socket Y, both pins have PWM, so that's the socket I use for controlling my Servo and auxiliary device.
The middle four pins on the driver socket adjacent to the header pins are just a straight link to each corresponding pin.
Pin 6 is GND
Pin 5 is 5 volt, from the regulator on the driver,
Pin 4 is linked to Pin 15 (see circuit below) which is connected to Arduino Pin D6. (Servo)
The header Aux+ in the middle is 5 volt from the voltage regulator on the driver.
The GND pin of this header is switched on/off by pin 16, which is connected to the Arduino pin D3. (Aux)
I have made the circuit and PCB details using KiCAD.
Here are the files: Tims_Servo_to_Driver_Socket_MK2.zip
I suppose if you wanted to make one of these without getting a PCB made, is use an old stepper driver that has been fried (I'm sure I am not the only one that has done this) and strip it of all components and copper, and make a perf-board, then solder components with wire.
If you like what I have done, or want to know more.
Please leave a comment below.