Infrared Beam Relay

Hey folks,
I have a set of infrared beam devices, where one sends a beam to another which is the receiver. The receiver has an inbuilt relay.
I want to to be able to get the arduino to do something when the beam is broken.

I have tried pushing a digital high signal into the relay and listening for the signal on another arduino pin - in the hope then when it closes the arduino will receive the signal. However it appears the arduino always receives the signal, even when the relay is open the arduino still activates as if it is getting a digital signal. I was under the impression a relay was a hardware switch?

I have also tried using an interrupt command - in the hope that something will change when the relay changes, however nothing at all happens in this case? I have measured through the relay with a multimeter and it is indeed open when open and closed when closed - however the arduino always seem to receive a signal through it regardless?

Is there a better way to accomplish my goal - or have i missed something?
Thanks

Do you have an pullup or pulldown resistor on the input?

Pelle

Ok, i fogot to mention i am new to electronics. :open_mouth:
Where would i need a pulldown/pullup resistor? I dont think i have one - i certainly haven't installed one. What is its purpose?

So i have read up on pull up/down resistors. And never new of this floating state phenomenon :slight_smile:
If the relay when not activated is CLOSED, and i am sending a digital high signal from one pin through the relay and listening on another pin i think i will use a 10K pull up resistor on the input (listening pin) from the arduinos vcc?
Also i read that i might need two resistors one from vcc to the input pin and one from the pin to ground (or is this second resistor not needed because it is already inbuilt into the arduino? But then i read that arduinos have an internal pull up pin and that can be enabled by code - do i need to use this?
Thanks