Fix Cloned Arduino NANO CNC Shield

Introduction: Fix Cloned Arduino NANO CNC Shield

Modifying Clone Keyes CNC Shield.

One the web are Chinese cloned Keyes CNC Shields for the Arduino NANO.

They are cheep and good value. BUT.

If you want to set Micro Stepping as they are, you can't.

Who ever cloned/made this shield made a mistake and put the pins that should go to Vcc, to GND.

As the pins that set the Micro Step Mode are already pulled down to GND internally as default, and to change there state, they need pulling up to Vcc.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Ways to Identify a Cloned Arduino NANO CNC Shield

1. The original Keyes Nano CNC Shield has a dark solder mask. (it looks blackish)

2. there are some print errors. Pins D9 and D10 are incorrectly identified. Control is spelt Contr01.

3. Look at the circuit track and see if the pins are connected to GND.

Step 2: Isolating Pins Top Side

The first step to put things right, is to isolate the pins from the GND rail.

This needs doing in Eight places.

First Two are on the top side.

I found, warming the header pins, made it easier to slide off the plastic supports.

Step 3: Isolating Pins Bottom Side

The next Six are underneath.

Step 4: Check That the Pins Have Been Isolated

After isolating the pins, check that they Are Isolated, using a circuit tester.

Check that they are no longer connected to ground.

Step 5: Connect Broken Ground Track

Isolating the pins from the GND track has separated the GND track and need reconnecting in two places.

Solder two pieces of tined copper wire in the place shown.

Step 6: Connecting Pins to Vcc

Now the isolated pins need connecting to the Vcc circuit.

Luckily there are pins connected to this circuit close by to the isolated pins.

Using tined copper wire make solder bridges to these pins as shown.

Be sure to keep the tined wire away from the track that runs under the bridge.

Step 7: All Finished

That's it.

The Micro-Step jumper Header Pins should now work as they should.

Step 8: GRBL Code

I write my own code when using this board, BUT.

As pointed out by FrancescP2 (in comments), If you are going to use gbrl firmware some changes to the code need making.

When you download the gbrl-master and unzip the file, in the folder you will find a folder called grbl, inside that folder you find a folder called cpu_map, inside that folder you will find 2 files, cpu_map_atmega328p.h and cpu_map_atmega2560.h.

As this shield is for the Arduino NANO, the file that needs changing is: cpu_map_atmega328p.h.

Open the file and you should see as shown (or similar) in the screenshot.

There are 2 ways to do this:

1. Only use cloned shield. If you don't intend to use a shield that is configured correctly.

Using screenshot as reference:

Line 39, change 2 to 5.

Line 40, change 3 to 6.

Line 41, change 4 to 7.

Line 47, change 5 to 2.

Line 48, change 6 to 3.

Line 49, change 7 to 4.

2. If you want to be able to quickly change from one type of shield to the other. (as shown by FrancescP2)

I will do this higher line numbers first so original line numbers (screenshot) I reference stay same for a time.

Lines 47,48 & 49 need replacing with:

#define X_DIRECTION_BIT   2  // CLONE NANO Digital Pin 2
#define Y_DIRECTION_BIT   3  // CLONE NANO Digital Pin 3
#define Z_DIRECTION_BIT   4  // CLONE NANO Digital Pin 4
#define X_DIRECTION_BIT   5  // Uno Digital Pin 5
#define Y_DIRECTION_BIT   6  // Uno Digital Pin 6
#define Z_DIRECTION_BIT   7  // Uno Digital Pin 7
#endif // KEYS_CLONE

Lines 39, 40 & 41need replacing with:

#define X_STEP_BIT      5  // CLONE NANO Digital Pin 5
#define Y_STEP_BIT      6  // CLONE NANO Digital Pin 6
#define Z_STEP_BIT      7  // CLONE NANO Digital Pin 7
#define X_STEP_BIT      2  // Uno Digital Pin 2
#define Y_STEP_BIT      3  // Uno Digital Pin 3
#define Z_STEP_BIT      4  // Uno Digital Pin 4
#endif // KEYS_CLONE

After line 30 insert a variable that can be changed to decide which shied is used?

#define GRBL_PLATFORM "Atmega328p"
#define KEYS_CLONE true

Changing the value of KEYS_CLONE:

true = using clone

false = using correct shield.

(FrancescP2 has given a link to a file he has alterd)

1 Hour Challenge

Participated in the
1 Hour Challenge

2 People Made This Project!


  • LED Strip Speed Challenge

    LED Strip Speed Challenge
  • Sculpting Challenge

    Sculpting Challenge
  • Clocks Contest

    Clocks Contest

13 Discussions


7 months ago on Step 8

Good realized !

I had made the changes last week for grbl with DRV8825 stepper-drivers.
Therefore I added 10 k resistors between 5V and M0, M1 and M3 pin.
I added 3 Pins and cut the Pins on 0V. So I can use the jumpers


Reply 7 months ago

That's another way of dong it.
Adding another header would save separating tracks on the top side.
Nicely done. :)
If you want to add current protecting resistors to the way I have done it, you could replace the wire bridge in step 6 with a resistor.
(drivers have 100k internal resistors pulling to ground)
I don't think the original shield has resistors, unless whom ever cloned it, got the one going to the enable pin wrong as well?


Reply 7 months ago

hello, thanks for the schematic !
I think with one resistor to the (old) header it must be ok and more easy to realize !
I think I would test it on the left driver, their I have fixed all M0,1,2 -Pins to 5V:

You can see in the picture, I have changed the Step and Dir-Pins back to the original -.h-file.
To realize it, it was more difficult with the iron on the other side because of the mounted pin-headers ...

The resistor to enable I think is wrong, but I will test it.


Reply 7 months ago

Now I have changed the Board for the x-Driver:

... and I have test it with different microsteps, all ok !


Reply 7 months ago

the pictures:


Reply 7 months ago

Hello Palingenesis,

I don't know if their is a problem with the inputs M0, M1, M2 connecting direct to 5V , I haven't tested it .
but look at this thread:

gururajkashikar :

"I connected the 5v pin to the M0, M1 and M2, the Micro Stepping Mode of
DRV8825 driver board as shown in the above picture. The AM1117 (5V reg
on Arduino Nano board) was burnt as soon as I switched ON the power to Nano CNC Shield.

Looks like we need to add pull up/series resistors (10K) instead of directly connecting Mode pins to 5V supply."
Perhaps he had tested it with jumper between 0V and 5V ?
Perhaps it's better to make a hint in step 6 .


Reply 7 months ago

As I mentioned to FrancescP2, I don't use grbl, so I have never needed to change the STP & DIR pins. But if I was to use it, I think using the modified header would be the easier option (step 8).
Although these three pins are getting current direct from the 5v regulator and are not signal lines from the controller, it is good practice to add the resistors.(I'm guessing the pins are a Gate to a FET)
I have had no issues not fitting resistors to these pins with my projects. (All has been fine without)
Perhaps I should add it as an option in step 6?
I put some more thought into this, internal resistors are 100k so if all 3 headers are bridged, resistance to ground would become 33K3 (3*R parallel), maybe a lower value resistor for bridge? say 5k?


Reply 7 months ago

I think with one resistor to 5V it's better to take 4.7k to threw the ports HIGH-level.


Question 7 months ago

Using GRBL, I need to do also that change in code (on cpu_map_atmega328p.h) for a normal use because this PINs are also wrong in comparison with the original Keyes board.

I not tested changing micro-stepping, is not needed for me at this time. But you know if this 2 changes are needed to work as the original board?


Answer 7 months ago

You are correct. Both changes will be needed.
I have not noticed this because I do not use GRBL.
I use this board because it is cheep. (obviously for these reasons)
I write my own code, and have written it to suit the shield.
Thank you for pointing this out.
Do you mind if I use you Picture?
And I will edit and add the information to the end of the Instruction.


Reply 7 months ago

Of course you can use it, maybe the full file for copy&paste content was better for new users reading this.

My "modified" file:
The original file:

And thanks to this post I learn a little more. I compare your fix with another project that I'm following called ESP32Controller from Simon Jouet, and as you can expect, the image contains the same you explain step by step to fix it.

I see some time before on Youtube about this problems, but I don't understand well what they are explaining, now I can also fix it.

The important conclusion all of us must to learn: Don't buy clones, they are bad copies of the original ;)


Reply 7 months ago

Thanks, I decided to write instruction on how to change the original file from grbl, just in case the file is ever revised.
Note to others reading this: Just change the file with the one FrancescP2 has given, the original hasn't change in the last 4 years.

I imagine now that all is sorted, there is an assembly line in China doing the alterations. hahaha