Button box construction, connection

Hello,
I wanted to make a button box, and I wonder if I will be able to connect it properly.

I would like to use:
Momentary Rocker Switch KCD4 (on-off-on) x6
JH-D400X with build in button , but there is 2 options x1 R2 5k, and R4 10k and I wonder what the difference is between them.
ky 023 x1 with build in button
momentary push button x6
bistable button with led, that turn on when u press(i forgot to add led pin in schematic) x1
ignition- 1x
rocker switch ,bistable, 0n-off, with built in diode, that's turn on when u press the button 6x
B3F-4055 d-pad, I treats it as 5 buttons

Have I connected them correctly?

ky 023 joystick

JH-D400X joystick

momentary push button

bistable led push button

You can prferably skip picturing the parts. Using accepted eletrical symbols saves space as they only contain electrical aspekts.

1 Like

ok, thanks for the advice, but in general is it connected well?

[image]

Post links to the detailed specs of each of these components.

Learn the schematic symbols for each type. Then draw a schematic diagram showing how you would connect them. The schematic should show all wires and pins and all pins should be labelled. Hand-drawing the schematic is ok but keep it neat.

1 Like

rocker diode

ignition

rocker 3 position momentary

d pad

And the rest is in the post (because I can't add more than 4 links in one post)

Thanks for those links. Unfortunately, none of them contain the necessary detail to allow us to check your schematic. Only the momentary pushbuttons require no further detail, because they have only 2 terminals.

Where is the schematic?

Your wiring diagrams seem to show 5 separate circuits, each with it's own Arduino Nano 3. None of these circuits will work.

Arduino Nano 3 is not suitable to build button boxes. The keyboard.h, jostick.h, mouse.h and similar libraries will not work with this type of Arduino

Arduino Micro or Pro Micro would be suitable.

1 Like

Thanks for the info. at first i wanted to make a button box on the pro micro. but i noticed that i would run out of analog pins for joysticks, and i thought to use nano, but luckily you warned me. in that case i guess i will have to get rid of one joystick so i have enough analog pins on the pro micro. I'll send the diagram later, thanks for your help!

Pro micro has 9 analog inputs. Nano has 8. So I'm not sure why you wanted to switch to Nano?

There are ways to get more analog inputs, such as analog multiplexers or external ADC chips.

1 Like

I have it here, maybe it's not very readable, but I did it somehow. And there is one pin missing in my arduino

Oh boy, it's going to take a while to understand your schematic! But at least it is a real schematic, so thanks for making that. Can you improve it to maker it easier to understand and less of a tangle of wires?

Good news, on Pro Micro, you can use pins 0 & 1 as digital pins. Unlike Nano/Uno etc, these pins are not used for uploading code or serial monitor.

I did spot that some of your switches are wired incorrectly, 1/5 to 5/5.

I can't tell if the switches U3 to U8 are wired correctly without knowing what the function of each pin is.

It looks like you are attempting to wire these buttons/switches as a matrix. But if any of the buttons/switches are not momentary, then you will need to wire a small diode in series with every button/switch in the matrix.

Thanks, for helping me! Don't worry about these switches u3-u8, and 1/5-5/5 because I will check them with a multimeter and connect them as buttons, NO. I just wanted to show my idea and joysticks connect. I have some schotky diodes at home, so it's not a problem either

And yes, I will make one more readable

For SW1 - SW6, wiring the third terminal to ground may prevent the matrix from being scanned. I can't think of a good way to use the LEDs in these switches when they are wired into a matrix. They will be dim because their internal series resistors were chosen for a 12V supply. If you try to wire them into the matrix somehow, that will make them even more dim because they will be lit for only a moment each time the matrix is scanned.

The switch for the 2-axis joystick also can't be wired into a matrix, I think. If you want to use it, it will need it's own dedicated pin.

1 Like

Ok, but I still have enough pins because I can use pins 0 and 1 as digital, And I have one more question, did you mean that using buttons with a built-in diode can disrupt the matrix, or that because the switches are 12v they can disrupt the matrix. If the latter, then I can use these: Switches

I meant that if you connect only the NO pair of terminals to the matrix, it will be fine. But if you connect the 3rd terminal to ground, as you show in your schematic, that may prevent the matrix from being scanned correctly. When the switch is closed, the row or column will be connected to ground through the led and it's resistor, making it appear that all every switch on that row or column is also closed.

Can you? Again, there is no detail on the page about how the switch is internally wired, or the purpose of each terminal. It doesn't even say how many terminals the switch has!

1 Like

Thanks again for wanting to torment with me. So it's best to skip the backlit buttons? And does U9 Button also have the same problem as those?

[image]

I do not want to torment you.

Imagine you go out to buy a car. You ask the salesman what gas mileage this vehicle achieves. The salesman says "it's red". So you ask how long the warranty lasts. The salesman says "I got green too". Would you buy from that salesman?

You can have backlit buttons, but if you want them to work in a matrix and not require many extra Arduino pins, only buttons with particular pins and wiring will work like that.

1 Like

Maybe I would use a ws2812b led strip, and place it above the regular buttons and connect it to a free pin. and could I set it up somehow in the code so that a particular diode would light up when the button was turned on?

Sorry but my English is bad, I meant that you have to suffer with me, not that I suffers with you. Anyway it doesn't matter because I'll write some stupid things again ;(

1 Like

Hello, I would like to make a button box for farming using Arduino Pro Micro. I would like to use it:
Arduino pro micro

ignition

schot,tky diode

rectangle latching button with led built in / x5

ky-023 joystick with button

momentary push button /x8

3 axis joystick with button

latching round button with led built in /1x

momentary 3 position on-off-on rocker switch /x6

d-pad with B3F-4055 tact.

Additionally, I would like to use round latching button with led built in to change the 3-axis joystick function. Simply that when you press the button, the game detects it as joystick 1 and when you press it as joystick 2. Is that possible?

Below is a diagram, on the left side the connection of the joystick and LEDs in the buttons, and the ky-023 joystick button, on the right side the rest of the buttons. I ran out of pins but I heard that in the Pro Micro pins 1 and 2 can be used as digital ones. Does the diagram show a good connection?

[image]

Thanks for telling. No question so far.

1 Like