Voltage drop across momentary switch

I'm working on powering a momentary switch with an external 9V battery (the 3.3V and 5V outputs on my arduino are being used by an LCD screen). I used a voltage divider with two 10K Ohm resistors to drop the current to 4.5 V for the button, but whenever I press the button, instead of going from 0 to 4.5V, the voltages drops to 3.2 V. This is messing up the digital input signal that is getting read from the board. Any ways to get around this?

You appear to have two 10k resistors in parallel (5k) connected in series with a 10k giving a 1:2 potential divider so 3 volts or so would be expected

You also state "..drop the current to 4.5 V..." Common mistake for newbies is to confuse terms of current and voltage. You should have said "..drop the voltage to 4.5 V..."

maybe your 9V battery is a little tired :wink: -
the resistors on the "schematic" (YAFS = yet Another Fritzing S...) are not 10k, but I think the actual ones are 10k ?
anyway, why do you think you need the 9V battery ? You could just connect one side of the button to the input (and activate the internal pull-up resistor), and the other side to 0V , and change your sketch accordingly (replace the "HIGH" with "LOW" for that input to do what you want it to do )

3.2V is quite enough for a digital pin. Have you measured the voltage at the battery with and without the
divider connected?

You do not need any resistors or battery. Just use INPUT_PULLUP as described here:

Are you under the misapprehension that you can only connect one wire to a given terminal?

That's what the breadboard - or a soldering iron - is for. Connecting more than one wire.

But as Archibald points out, for switches, you just connect them to the input and ground and set the pinMode to INPUT_PULLUP.

Breadboard/9V Gnd is not connected to the Arduino.