0
\$\begingroup\$

I have a joystick that I wish to connect to my Arduino uno. However, there's no VCC or 5V or GND pins to connect to. I do see a COM pin, but I'm unsure how I should wire that to the Arduino. My objective is to take an input that determines whether LEDs should be emitting light or not.

I can't find any model number on the PCB or on the listing where I bought it from. The only information provided on the listing:

\$\endgroup\$
5
  • \$\begingroup\$ How should we know by just looking at the picture? We can only guess. Please put a link to datasheet or manual. Or at least tell the make and model of the device. \$\endgroup\$
    – Justme
    Commented Jun 11, 2020 at 15:09
  • \$\begingroup\$ I'm guessing it needs pullup resistors \$\endgroup\$
    – DKNguyen
    Commented Jun 11, 2020 at 15:10
  • \$\begingroup\$ @Justme Please see the new edits, Thank you \$\endgroup\$
    – user5423
    Commented Jun 11, 2020 at 15:27
  • \$\begingroup\$ the device consists of seven switches connected to a common line ... apparently, you did not read the documentation you included ... it talks about Vcc and GND \$\endgroup\$
    – jsotola
    Commented Jun 11, 2020 at 15:37
  • 1
    \$\begingroup\$ What to check for when buying an electronic component or module?. \$\endgroup\$
    – Andy aka
    Commented Jun 11, 2020 at 16:15

2 Answers 2

2
\$\begingroup\$

The device is likely a just a set of passive switches. There is no "VCC".

  • "COM" would be the "common" pin. You can supply it with a voltage (5V for example) and then each signal (UP/DOWN/etc) would go to something like inputs on your microcontroller.
  • You could also use it the other way around by connecting COM to ground, and the signal pins could have their own pull-ups.

enter image description here

\$\endgroup\$
4
  • 1
    \$\begingroup\$ You will probably also need pull-down or pull-up resistors in the MCU inputs, or enable internal pull-ups/downs in the microcontroller. \$\endgroup\$ Commented Jun 11, 2020 at 18:41
  • \$\begingroup\$ Sorry for my late reply. I appreciate the answer, If you have time, could you briefly explain pull-down and pull-up resistors in layman's terms? \$\endgroup\$
    – user5423
    Commented Jun 18, 2020 at 12:50
  • \$\begingroup\$ @user5423 - If you look at my diagram above, you will see there is 5V on the left side of the switches. However, between the switches and the microcontroller inputs, there is no voltage. You might think that equals "0V", but since it's not connected to ground, there is actually no particular value. The voltage is "floating". This can be problamatic, as the reading on the micro may be LOW some of the time, but it can actually fluctuate due to things like radio waves or your hand being near it. A "pulldown" is a high-resistance resistor (eg: 100kΩ) that "pulls" the voltage down to 0V (LOW). \$\endgroup\$
    – Bort
    Commented Jun 18, 2020 at 13:37
  • \$\begingroup\$ @user5423 - The value of the resistor must be high so that if the switch is closed, the 5V can"override" the 0V. Note that many microcontroller have optional built-in pullup or pulldowns. In the case of Arduino Uno, the input pins have built in pull-ups. You can enable them by setting the pinmode to INPUT_PULLUP (instead of just PULLUP). When you do that, the pins will "rest" at 5V, and to change the reading, you must pull the inputs LOW. (This is opposite of how we typically think). Thus instead of connecting 5V to the left side of the switch in the diagram, you would instead connect ground. \$\endgroup\$
    – Bort
    Commented Jun 18, 2020 at 13:40
2
\$\begingroup\$

It is apparently just a group of switches with one side of each switch connected to a common pin, like so:

schematic

simulate this circuit – Schematic created using CircuitLab

You may connect the common pin to Ground of Vcc, whichever is convenient, and add pull-up or pull-down resistors on the MCU pins as needed.

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.