I have an Arduino Uno device that uses the following modules:
- 16 PIN LED w/ Backlight
- RFID - RC522 (RFID Reader)
- HR911105A (LAN Module - HanRun)
These three modules use every digital pin available in the Uno (2-13) and
it works correctly. The problem is that I want to add a relay to this board. I am new to Arduino so I use tutorials and right now I do not fully understand how this works. So I have connected the IN
pin of the relay to Uno pin 8 and the NO
pin of the relay to Uno pin 13.
The problem is that when I don't use other modules the relay works correctly (using this code).
int relay_pin = 8;
int led_pin = 13;
void setup() {
pinMode(relay_pin,OUTPUT);
pinMode(led_pin,OUTPUT);
digitalWrite(led_pin,HIGH);
}
void loop() {
digitalWrite(relay_pin,HIGH);
delay(5000);
digitalWrite(relay_pin,LOW);
delay(5000);
}
The remaining ports are 1 and 0, which I assume are TX/RX, and can't be used for relay (am I wrong?).
So obviously I should not be using those pins but I wonder which pins I am allowed to use simultaneously when using two or three modules at the same time.
Does it depend on the modules or are there some instructions?
NO
pin to pin 13 of the Arduino?