## Limit Switch Wiring?

jwright
Posts: 2
Joined: Fri Nov 21, 2014 3:54 pm

### Re: Limit Switch Wiring?

Hi all, long time lurker first time post.

So can I confirm before I solder this up. What all was said here wasn't immediately apparent to me till I drew it out quick, and I think it would help others like me that aren't quite as circuit savvy as a lot of you.
Yup - I agree with this, resistor should be added, hence the name RC filter;) For simplicity I left it out, but to be correct it should be there.
So a low pass filter configuration like this:

I also wanted to confirm that the 10K resistor in that last drawing is not ideal if we are dropping a 0.47uf cap in there. 680 ohms was stated earlier in the post and it looks correct for the RC filter?

C = 0.47uf
f = 490 - 500Hz
R1 = 677 - 691 ohms

EDIT
I removed the rest of my post as it had PWM calculation results that were wrong and confusing to the point of wiring this circuit
Last edited by jwright on Fri Nov 21, 2014 7:10 pm, edited 1 time in total.

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

### Re: Limit Switch Wiring?

That's not a low-pass filter. That's just a capacitor with a (very weak) pull-up resistor. If you want a proper low-pass filter, you need a series resistor. Wire it like this: from switch contact, pull-up resistor to 5V (say 680 ohm), series resistor (say 10 K), then capacitor to GND (say 100 nF). You can then fiddle with the series resistor and the capacitor to ground to change the impedance and the time constant of the filter, but a ceramic 10-470 nF capacitor will work better than an aluminium electrolytic capacitor at suppressing RF, and you don't want to go much above 10 Kohm because there's a weak internal pull-up on the input pin.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

jwright
Posts: 2
Joined: Fri Nov 21, 2014 3:54 pm

### Re: Limit Switch Wiring?

OK got it.
I removed the PWM part of my original post so it didn't add to any confusion...mostly mine!

Thanks again

Dhpenner1
Posts: 97
Joined: Fri Sep 19, 2014 1:30 pm

### Re: Limit Switch Wiring?

Does anyone have a drawing for limit switches on a tinyG?

AlBorland
Posts: 75
Joined: Mon Jun 23, 2014 5:26 pm
Location: Austria

### Re: Limit Switch Wiring?

Tinyg v8 has capacitors and pullups built-in, so you just connect one side of the switch to GND, the other to xmin, xmax, ymin, ymax, zmin, zmax.
Shapeoko2, 4xNEMA23, tinyg, Kress 1050, various Z axis modifications

ykornx
Posts: 10
Joined: Tue Feb 03, 2015 7:34 pm

### Re: Limit Switch Wiring?

Hello,
I just assembled my shapeoko 2, and now i want to put the limit switches. My shapeoko is full kit with arduino uno and gshield v5b.
I have read about the limit switches and tried the schematics in this thread on the first page, but it doesn't work. I have tested with one limit switch on the X-axis but when i move the shapeoko and press the limit switch button nothing happens.
My scheme is https://drive.google.com/file/d/0ByFvao ... sp=sharing.
What i am not sure about is:
1.What is my version of grbl (have read on http://www.shapeoko.com/wiki/index.php/ ... t_Switches The pin numbers in this schematic apply to grbl 0.8 and the default configuration on 0.9.). How can i see what is my grbl version?
2.Do i have to make some programming to make the limit switches function active?
3.I've read here https://github.com/grbl/grbl/wiki/Connecting-Grbl this: "Afterwards, once you decide that you're ready or would like to enable homing and/or hard limits, you'll need to connect a normally-open limit switch to each of the limit pins (D9-D11). Homing and hard limits use the same switches. These limit pins are already held high with an internal pull-up resistor, so all you have to do is wire them to ground. So when you close a switch, the switch will pull the limit pin to ground."
So, this is telling me that there is no need for the resistor because the limit switch already has a internal pull-up resistor.

Can you please tell me where am i going wrong with these limit switches?

Thank you!

scott216
Posts: 228
Joined: Thu Oct 10, 2013 12:35 pm
Location: New Jersey

### Re: Limit Switch Wiring?

ykornx wrote:Hello,
I just assembled my shapeoko 2, and now i want to put the limit switches. My shapeoko is full kit with arduino uno and gshield v5b.
I have read about the limit switches and tried the schematics in this thread on the first page, but it doesn't work. I have tested with one limit switch on the X-axis but when i move the shapeoko and press the limit switch button nothing happens.
My scheme is https://drive.google.com/file/d/0ByFvao ... sp=sharing.
What i am not sure about is:
1.What is my version of grbl (have read on http://www.shapeoko.com/wiki/index.php/ ... t_Switches The pin numbers in this schematic apply to grbl 0.8 and the default configuration on 0.9.). How can i see what is my grbl version?
2.Do i have to make some programming to make the limit switches function active?
3.I've read here https://github.com/grbl/grbl/wiki/Connecting-Grbl this: "Afterwards, once you decide that you're ready or would like to enable homing and/or hard limits, you'll need to connect a normally-open limit switch to each of the limit pins (D9-D11). Homing and hard limits use the same switches. These limit pins are already held high with an internal pull-up resistor, so all you have to do is wire them to ground. So when you close a switch, the switch will pull the limit pin to ground."
So, this is telling me that there is no need for the resistor because the limit switch already has a internal pull-up resistor.

Can you please tell me where am i going wrong with these limit switches?
Limit switch wiring is the same for v0.8 as v0.9, so it doesn't matter what version you're using.

You're Google drive link doesn't work, you need to make it public.

You do need to enable the limit switches for them to work. See: https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.9
Command to enable limit switches for v0.9 is
\$21=1
First type \$\$ to list all your setting.

In noisy environments (which the shapeoko is in because of the stepper motors and spindle, probably other stuff too), the internal pull-up resistors are not as effective as lower ohm external pull-ups. I think the Uno has 20k internal pull-up resistors. Something like 330 ohms would be more effective in a noise environment; that's what I use.
Shapeoko v2 with DW660
GRBL v0.9i
Location: New Jersey

ykornx
Posts: 10
Joined: Tue Feb 03, 2015 7:34 pm

### Re: Limit Switch Wiring?

What i didn't do is to write the command to enable the limit switches. I'll try this later and i'll write how it goes.

Thank you!

ykornx
Posts: 10
Joined: Tue Feb 03, 2015 7:34 pm

### Re: Limit Switch Wiring?

Hi again,
my grbl version is 0.8c so i saw that the hard limit comand is \$16. I put it on \$16=1 and it worked.
Now i must read a little more for understnding GRBL.
Thanks for the help.

sailorpcb
Posts: 3
Joined: Wed Jun 03, 2015 8:20 pm

### Re: Limit Switch Wiring?

cvoinescu wrote:That's not a low-pass filter. That's just a capacitor with a (very weak) pull-up resistor. If you want a proper low-pass filter, you need a series resistor. Wire it like this: from switch contact, pull-up resistor to 5V (say 680 ohm), series resistor (say 10 K), then capacitor to GND (say 100 nF). You can then fiddle with the series resistor and the capacitor to ground to change the impedance and the time constant of the filter, but a ceramic 10-470 nF capacitor will work better than an aluminium electrolytic capacitor at suppressing RF, and you don't want to go much above 10 Kohm because there's a weak internal pull-up on the input pin.

Can I check that I have this correct (attached photo)? Kind regards
RC circuit.png (21.87 KiB) Viewed 2636 times