[Solved]Problem with button reading

Hello, I am trying to make a midi controller using arduino. The circuit is very simple, it contains 8 potentiometers(right side in picture) and 9 arcade buttons(left side). After soldering the components, i am not able to read values from any button, although the potentiometers readings are all fine. I think I have soldered the yellow wires of buttons in the wrong place(the wires they read values from buttons).Thanks in advance, any help will be apreciated!

OP image

All yellow wires on left side components are shorted out by the black wires.

Always start with a SCHEMATIC!

Really thanks for the reply. You are absolutelly right about the schematic and thank you for the advice(that was my first circuit). I didnt actually understand what i did wrong, should i desolder the yellow wires and solder them in other place ?

Switches are usually wired in one of three ways.

See the 3 examples in this drawing:

2017-08-05_20-33-24.jpg

Show us a schematic of what you are attempting to wire up.

It is possible the yellow wire should be moved to the top of the red component but we need to be told what that component is and ‘we need a link to the data sheet of that switch’ !

It seem like your switches should be wired as S1 in the above schematic.

Thank you all for your responses, you helped me a lot! I just desoldered the yellow wires and soldered them before the 10k resistor and everything works perfect!!!

You are an expert now !

akiskaps:
Thank you all for your responses, you helped me a lot! I just desoldered the yellow wires and soldered them before the 10k resistor and everything works perfect!!!

You don't need the resistors at all, the Arduino has them built-in. You can just connect a button between the Arduino pin and ground, and enable the internal pull-up resistor using pinMode(pin, INPUT_PULLUP). (See the leftmost switch in the picture of reply #3.)

Pieter

PieterP:
You don't need the resistors at all, the Arduino has them built-in.

Pieter

It appears the OP has those resistors as pull downs, red wire might be +5v, black wire GND, yellow wire INPUT pin.

But, who knows without a schematic :frowning:

larryd:
It appears the OP has those resistors as pull downs, red wire might be +5v, black wire GND, yellow wire INPUT pin.

I think so too, but just so he knows for his next project :slight_smile:

PieterP:
You don't need the resistors at all, the Arduino has them built-in. You can just connect a button between the Arduino pin and ground, and enable the internal pull-up resistor using pinMode(pin, INPUT_PULLUP). (See the leftmost switch in the picture of reply #3.)

Pieter

Oh that is very interesting and usefull for future projects. Can you please tell me if all pins(Digital & Analog) have this ability? And if so i have to use them as pull-up resistors or I can use them as pull-down resistors too?

larryd:
It appears the OP has those resistors as pull downs, red wire might be +5v, black wire GND, yellow wire INPUT pin.

But, who knows without a schematic :frowning:

Yes, I am using them as pull-down resistors and you described the wires correctly. I learnt from my mistake and i will make a schematic before any soldering etc.

akiskaps:
Oh that is very interesting and usefull for future projects. Can you please tell me if all pins(Digital & Analog) have this ability?

Yes. The analog pins on most Arduinos are full-fledged digital pins, with analog functionalities as an "extra".
The only exception I'm aware of are the analog-only A6 and A7 pins on ATmega328P TQFP boards like the Arduino Nano.

akiskaps:
And if so i have to use them as pull-up resistors or I can use them as pull-down resistors too?

They are pull-up only, but there is absolutely no need for pull-down resistors for buttons. You just invert the logic in software.