I experience some troubles with an arduino UNO and a low activated relay.
Let me explain : I want to use the relay (Normaly Open) to generate a pulse (500 ms). It's working well but I generate an unwanted pulse on reset/power-on.
It's blocking for me because I want to use the arduino to open a garage door and I may not take the risk to open the door each time I face an electrical problem.
Thanks,
Jeremy
Here is my code (I've tried to add many delay to exclude concurent access)
void setup()
{
// start the Ethernet connection
Ethernet.begin(mac, ip);
// start the server
server.begin();
// init pin mode
pinMode(BOTTOM_SENSOR, INPUT_PULLUP);
pinMode(TOP_SENSOR, INPUT_PULLUP);
delay(1000);
// init out pin value
switchCurrentValue = HIGH;
digitalWrite(DOOR_SWITCH, switchCurrentValue);
delay(1000);
pinMode(DOOR_SWITCH, OUTPUT);
// init and force ip update
updateIpTime = millis();
UpdateIpAddress(true);
//Check that all relays are inactive at Reset
delay(4000);
}
If I pin IN1 to pin4 I see the relay activated for 1 second,
If I pin IN1 in another pin (default input), i don't have the problem
I don't know what to think about this
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 4;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
digitalWrite(led, HIGH);
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
}
If the relay is activated with a HIGH then you don't want a pull-up and in fact you want to make that pinMode an OUTPUT and LOW as soon as possible (first thing).
I cannot tell from the ebay listing whether it has a pull-down resistor, to eliminate any "floating" condition - that would help.