Fix Cloned Arduino NANO CNC Shield

41K78168

Intro: Fix Cloned Arduino NANO CNC Shield

Modifying Clone Keyes CNC Shield.

On 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.

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:

#ifdef KEYS_CLONE
#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
#else
#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:

#ifdef KEYS_CLONE
#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
#else
#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)

STEP 9: Some Pin Changes in Grbl

If using the latest version of grbl, check there web site for some pin changes.

STEP 10: Take a Photo of Your Work

Lets see how many "I Made It"s on this little instruction we can get.

I am sure there are a lot of these modules sold on the net.

  • Sign up (If you haven't).
  • Take a photo of your work.
  • Click the I Made It button.
  • Add your photo.
  • Click Post.

94 Comments

That is one way of doing it.

I'd say more of a work-around, than a correction/fix.

Thank you very much. It worked
That's great, thank you for leaving a comment.
hola, buen dia
alguien tendrá la librería grbl para Arduino nano atmega 168
he querido, hacer una cnc, no me fije en el chip cuando compre el Arduino, realmente no sabia que seria tan limitado el tema del grbl para el chip atmega168.
por favor si alguien lo tiene conmigo la puede compartir.
de antemano muchas gracias
hello good morning
Someone will have the grbl library for Arduino nano atmega 168
I have wanted to make a CNC, I did not pay attention to the chip when I bought the Arduino, I really did not know that the grbl issue for the ATMega168 chip would be so limited.
Please, if anyone has it with me, can you share it.
Beforehand thank you very muchThe Arduino NANO ATmega168 only has 16KB of FLASH memory, it will not have enough memory to hold grbl firmware,
You need at least an Arduino NANO ATmega328, it has 32KB of FLASH Memory.

Be carful of buying NANO clones on the web, always check what chip they are using.
Make sure it says: "ATmega328p" if you want to do a project like this.
Con tu modificacion puedo utilizar todos los jumper?
los de micro pasos y el jumper de los 12v?
"With your modification can I use all jumpers?
the micro steps and the jumper of the 12v?"

Yes this modification is to make the Micro-Stepping Jumpers work.
You will be able to set the Micro-Stepping on the Drivers.

The power Jumper will still work as it should. It links the Power from the Power-Jack (barrel jack socket) to the Motor Power.
Muchas gracias por tomar un poco de tu tiempo y responder.
ahora si tengo claro todo. Cuando lo tenga listo subire la imagen
No problem, hope you make some fun projects.
Thanks for the work you did with the instructions for modifying the board. I wanted to throw it away but I thought your solution might work. Thanks,
Thanks for leaving a comment.
Hope it goes the job you want.
Thank you for the excellent detailed, accurate instructions. Especially the top side cuts under the jumpers. Some instructions miss those. My board is working properly now.

I used wire wrap wire on the smaller ones connecting the jumpers to 5V.

P.S. I was ashamed of my shoddy work the first time, so redid it!
Glad you now have working board.
Thank you for showing, I love it when one of my instructions is done.
Well, it _was_ working. I have grbl v1.1 loaded in the nano to do CNC, and was changing configuration of it and rebuilding/uploading to see if I could get servo control working. The result so far is 2 dead nanos!

I've come across your blog and youtube videos. Impressive work! I really like the mini plotter, the pen lift is a very clean design.
I have just done an instructible for a multi-colour pen.
Tim's 10 Colour Plotter Pen : 23 Steps (with Pictures) - Instructables
In that instructible I have put a link to my github for a version of grbl to use a servo.
You will of course need to do the mod to it for stepper pin configuration as shown in this Step 8.

I am glad you like my mini plotter, I must turn it into an instructible one day.
There is quite a bit to it though.
Did the mods yesterday then it occurred to me that you don't need to. Just remove the jumpers, solder the three pins (not the earthed ones) together and connect them to +5v. do that on the three drivers and you're done. Much simpler, no track cutting or fine soldering.
Cheers.
But you cant use the jumpers that way.
You can't swop and change.
It is a permanent setting that way.
If you use jumpers that way you will short the board out.

Need to make sure people who are novice realize this.
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?
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.
More Comments