Should I solder a resistor in this scheme? Or isn't it necessary?

Hi guys! I've got a little question. Should I solder a resistor in my scheme? It's a rangefinder. It works properly and well without it but I'm a little bit confused. I'll be glad for any answers. Thanks in advice.

It is likely that the display you have will already have pull up resistors on the data and clock pins of the I2C bus.

However you have connected that switch up wrong.
You either need a pull down resistor of 10K between the input and ground. Or Connect the switch between input and ground and activate the pull up resistors in the pin mode call. Then look for a LOW when the switch is pressed not a HIGH.
See :-
http://www.thebox.myzen.co.uk/Tutorial/Inputs.html

You can't guarantee it always will because when the button is not pushed the pin will be floating and liable to read anything due to interference pickup.

1 Like

Thanks for the answer I appreciate. I have extra questions if you don't mind.

  1. Do you mean that I2C has already resistors in there?
  2. "switch up" is it a right button near the battery compartment?
  3. What if I leave it as it is?

The display itself is likely to contain them, they usually do. Without them the waveforms are not good enough as the I2C software enables the internal pull up resistors which are not strong enough.

No it is the push button going to pin blurred - your physical layout diagram has too low a resolution for me to see it. When asking for help this sort of diagram is next to useless, you really should post a schematic.

I told you, it will not work reliably. Try touching the pins on that push button and see it will act just like you pushed it. Try turning on and off a florescent light close to the circuit and it might look like you have pressed the button.

1 Like

Lol it's the truth. I haven't thought about that. I'll try that one from your website. Thanks for the answers It's really useful.