Go Down

Topic: Wiring a Button Box (Read 785 times) previous topic - next topic

rawkstar320

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?

rawkstar320

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!!

PeterH


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.
I only provide help via the forum - please do not contact me for private consultancy.

CrossRoads

Ideally you would have this.
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.

rawkstar320

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.


tuxduino

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.

CrossRoads

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

rawkstar320

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.

Go Up