Pages: [1]   Go Down
Author Topic: Wiring a Button Box  (Read 583 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey everyone,

I have created a box with (3) input buttons, plus a reset button.  I think I wired it incorrectly, but before I go tearing into things and messing up my hard work I figured I would just ask. (Hopefully I can describe the situation correctly...)

I used a cable to attach my box to the arduino, with a total of (5) wires dedicated to buttons and reset button.  I made the assumption that the reset button works similar to a regular input button and have wired them to share the (+5v) line with each of the 3 buttons going to digital pins, and the Reset going to the reset pin.

As I learned, this does not work.  Reset works by connecting the Reset pin to ground.

As a mechanical engineer, my solution is to re-wire the box (this will take hours probably) but I am wondering if someone has another solution/something I don't know before I go this route.  The project is for a CNC machine running GRBL, and I am not a programmer by any means so modifying code is not an option.

Thoughts?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As usual, a solution usually shows itself AFTER one asks for help.  Here is what I did, let me know if I am going to let the magic smoke out...

I tied the RESET pin to my (+) line, then my reset button to (GND).  Therefore, connecting reset to ground.  I can't think of a reason why this is bad, but I am just a mechanical guy.

Thanks for the help!!
Logged

UK
Offline Offline
Shannon Member
****
Karma: 184
Posts: 11173
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tied the RESET pin to my (+) line, then my reset button to (GND).  Therefore, connecting reset to ground.  I can't think of a reason why this is bad, but I am just a mechanical guy.

I suspect a picture or diagram would make it easier to figure out what you mean there - as far as I can see, you seem to be shorting the + line to ground which is probably not a healthy thing to do.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 439
Posts: 23751
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ideally you would have this.


* switches_pots.jpg (47.55 KB, 960x720 - viewed 27 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the tips, I will have to stare at that diagram for a while to figure it out though...

So I made my own of what I have.  Its simple but will hopefully get the point across.  On CrossRoads diagram, it looks like there might be a resistor on the Reset line, so even though your "shorting" out, there is some resistance load there.  If that is the case, then I could just put a resistor inline with the "Green" wire.



* CNC Controller Circuit.png (20.15 KB, 1042x734 - viewed 22 times.)
Logged

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The buttons common pin should be to ground, not +Vcc. This way you can use internal pullup resistors and have buttons active low.

In your diagram the buttons are active high, but when they're not pressed the arduino input pins are floating, which could cause spurious readings.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 439
Posts: 23751
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"The buttons common pin should be to ground, not +Vcc. This way you can use internal pullup resistors and have buttons active low."
Exactly!
You do not want ANY button connecting directly to +5V. Only reset should be pulled high, and 10K resistor is all that's needed.
Everything connects to Gnd when pushed, with either the internal pullups used to hold the pins high when the switch is open, or external 10K resistors like on the reset line.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Interesting,
Thanks for the help!  Ill switch it around then (shouldn't be hard) and add the resistor on the reset line.

Thanks again for the help, I appreciate it.
Logged

Pages: [1]   Go Up
Jump to: