<b>+5V -> resistor (e.g. 10k) -> diode part of an opto coupler -> switch -> ground</b>