Project 7 (Keyboard) - Resistor Ladder question

So, the project explains how to build a resistor ladder for 4 switches:

1 - no resistor
2 - 220 ohm
3 - 10k ohm
4 - 1m ohm

My serial monitor gives me the following values when I press each button:

1 - 1023
2 - 1001
3 - 511
4 - 8

Which corresponds pretty well to what the code expects. So far so good.

Now, in the description, the book talks about how you're supposed to get different values when pressing more than one button and how you should be able to produce even more notes.

But that doesn't seem to really work. Pressing two buttons, any two buttons, only gives me the highest value on the serial monitor EXCEPT for pressing buttons 3 and 4, then I get 514 instead of 511, a minor difference...

What's going on? I'm very much new to the whole electrics and electronics thing so right now I don't know if I did something wrong or if I'm misunderstanding something...

1 Like

Many reads but no answers. You may get more response if you supply a drawing of the circuit for those that do not have the project book.

Weedpharma

Actually, it is because of the major difference between the size of the resistors. As it is really big, there's almost zero current flowing on the line with the biggest resistor. There is a minor change in the voltage, but it is really small, so your Arduino can't even detect it. Unfortunately, this feature cannot be used, this is a mistake in your book. If you want to go sure, apply Ohm's Law, calculate the currents, and you'll see the reason.

Sorry for bad English, I'm not a native and really unfamiliar with topic-specific vocab.
I hope, I could help.

Sokosz

1 Like