Problem with realy in Arduino Nano

Hi.

I am having trouble trying to get a simple 5V relay to work on an Arduino Nano.

My set up is simple: I connected the pins in the relay as follows: IN to DigitalPin8, GND to Ground and VCC to 5V. The

Nothing fancy, I have not even connected anything to the other end of the realy...... I just expect the relay to click once every second according to the code below, but it is not doing what I expect

These are symptoms that may give extra info:
. The red led on the relay block turns on an off every second although it is not very bright
. If instad of connecting the IN pin to pin8 I connect it directly to 5V, the relay is indeed actuated and teh red LED lightts up at full power

I suspect I may be stumbling upon voltage issues on Pin8. any comments?

I have tried 3 different relays with the same results.

Any hints really appreciated

int relayPinOut = 8;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
digitalWrite(relayPinOut, LOW);
Serial.println(" OFF");
delay(1000);

digitalWrite(relayPinOut, HIGH);
Serial.println(" ON");
delay(1000);

}

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

In your setup you need to add.

pinMode(relayPinOut,OUTPUT);

This will set your output pin as an output.

Tom... :slight_smile:

Tom. Thanks a lot for your reply! Cheers! :slight_smile: