reading wireless doorbell


I have a wireless doorbell that runs on 3 AA batteries. I used y multimeter and found to contacts that gives 0V when the doorbell is not pressed, and 4,5V (from the 3 AA batteries) when it is pressed. how can I read this with the arduino uno R3?



Connect the battery ground to Uno ground and the 0-4.5V signal to a digital input (don't use D0 or D1 as they are for the serial port). You may need a pull down resistor (10K or so) so the input isn't floating with the switch open.

thanks, without resistor it worked fine.