MKR Relay Protoshield, question about the relays

Hello all,

I’m a bit of an arduino noob here, so please bear with me. I have a question regarding the relays on the MKR Relay Protoshield ( https://store.arduino.cc/usa/mkr-relay-proto-shield ).

It states that “The shield provides two relays, called RELAY1 and RELAY2 commanded by pin 1 and pin 2 respectively” My question is that if I wanted to monitor a change in state on the relays, would it send that as a signal to pin 1/2 to be read in the software, or is the other way around that the pins send signals to the relays to control other objects in a project?

Please let me know if there is not enough information here.

Thanks,
Arthur

The pin on your microcontroller will operate the relay when you set the pin to HIGH with a digital write. I hope that answers the question.

Paul

You need to distinguish between monitoring and controlling.

  • You can use the digitalWrite() function on pin 1 to control control the RELAY1
  • You can use the digitalWrite() function on pin 2 to control control the RELAY2

For checking the relay states, you can also wire pin 1 and pin 2 to two other pin on Arduino, For example, pin 3 and pin 3. And then:

  • Set pin 3 and pin 4 to digital input mode using pinMode() function
  • Monitor the state of pin 3 and 4 by using digitalRead()

Hey Paul and Hobbyist, thanks for the quick responses.

Regarding your statement Paul, what you mean is that when I set pin 1 or 2 to HIGH using digitalWrite(), it turns on the respective relays 1 and 2.

@Hobbyist, so if I did set pin 3 and 4 to receive inputs, this way I could monitor any change in states on the relays?

What I'm understanding here is that pin 1 and 2 control the relays by writing HIGH or LOW to it, and pin 1 and 2 can also receive the current state of the relays which can then be read by two other pins on the microcontroller. Do I understand this correctly?

Is there a reason why you cannot monitor the relays directly thru pin 1 and 2, or is it simply just set up this way?

Thanks for answering my original questions though, I feel it has been answered sufficiently,
Arthur