user32164: The relay module consists of two sets of pins:
Set1: GND, VCC, Int1, Int2
Set2: JDVcc, VCC, GND
In set 2, VCC and JDVcc are jumpered together normally, which is removed to power the relay coil with external supply.
However, can I supply 5v directly from external source to the VCC pin of Set 1 and connect the GND pin to common ground, leaving the VCC and JDVcc pin jumpered together as they are? It's because I am running out of pins in my Uno.
Will that work?

user30002: 
can I supply 5v directly from external source to the VCC pin of Set 1
  and connect the GND pin to common ground, leaving the VCC and JDVcc
  pin jumpered together as they are?

Probably you're using this relay module, which is fairly common:

If that's the case, then the answer is YES as long as you keep all grounds tied together and the 5V external supply deliveries a voltage reasonably close to the Arduino 5V.
Why?

When IN is high and VCC is close to 5V, there isn't enough voltage difference for forward biasing the diodes. They won't conduct and no current will flow from or into your Arduino data pin.
When IN is low, the diodes are forward biased and current will sink into the Arduino data pin. As long as VCC is close to 5V, the current limiting resistor will keep current within specification of what the Arduino data pin can tolerate.


32164: <p>The relay module consists of two sets of pins:</p>

<p>Set1: GND, VCC, Int1, Int2
Set2: JDVcc, VCC, GND</p>

<p>In set 2, VCC and JDVcc are jumpered together normally, which is removed to power the relay coil with external supply.</p>

<p>However, can I supply 5v directly from external source to the VCC pin of Set 1 and connect the GND pin to common ground, leaving the VCC and JDVcc pin jumpered together as they are? It's because I am running out of pins in my Uno.</p>

<p>Will that work?</p>
 30002: <blockquote>
  <p>can I supply 5v directly from external source to the VCC pin of Set 1
  and connect the GND pin to common ground, leaving the VCC and JDVcc
  pin jumpered together as they are?</p>
</blockquote>

<p>Probably you're using this relay module, which is fairly common:</p>

<p><a href="https://i.stack.imgur.com/KVvaR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KVvaR.png" alt="Relay module schematic"></a></p>

<p>If that's the case, then the answer is <strong>YES as long as you keep all grounds tied together and the 5V external supply deliveries a voltage reasonably close to the Arduino 5V</strong>.</p>

<p>Why?</p>

<ol>
<li><p>When IN is high and VCC is close to 5V, there isn't enough voltage difference for forward biasing the diodes. They won't conduct and no current will flow from or into your Arduino data pin.</p></li>
<li><p>When IN is low, the diodes are forward biased and current will sink into the Arduino data pin. As long as VCC is close to 5V, the current limiting resistor will keep current within specification of what the Arduino data pin can tolerate.</p></li>
</ol>
