Relay normally open not working

I'm having trouble with a project and I'm new to arduino, so please explain in less advanced terms

I'm having trouble with a relay in my project, and even though I have everything set up for NO mode, it does not trigger NO mode. It is always stuck on NC because when I put the jumper to NC, it outputs voltage. Please help me, thanks.

This is where a schematic or even a good simple drawing of your circuit would go a long way in helping you. I can't see your circuit and have no idea what is wired and how? Relay or relay module for starters?

Make a drawing or schematic and it also helps if you, in detail explain exactly what your project is and your code. Please post any code using code tags. A schematic and code will help others help you.

Ron

Please post a link to the product page for the relay module, and a photo of a hand drawn wiring diagram, with pins, parts and connections clearly labeled.

here is the link to the relay I use: https://www.amazon.com/ARCELI-KY-019-Channel-Module-arduino/dp/B07BVXT1ZK

here is the code I used in case its useful (uses safestring)

#include <millisDelay.h>
#define POWER_PIN_SENSOR 7
#define POWER_PIN_RELAY_HU 2
#define POWER_PIN_RELAY_PU 4
#define POWER_PIN_RELAY_AR 8
#define SIGNAL_PIN_SENSOR A5
int waterLevel = 0;
unsigned long puDelayTime = 50000;
unsigned long puDelayStart;
bool puDelayRunning = false;
bool puOn = false;
millisDelay(puDelay);

void setup() {
 Serial.begin(9600);
 pinMode(POWER_PIN_SENSOR, OUTPUT);
 pinMode(POWER_PIN_RELAY_HU, OUTPUT);
 pinMode(POWER_PIN_RELAY_PU, OUTPUT);
 pinMode(POWER_PIN_RELAY_AR, OUTPUT);
 digitalWrite(POWER_PIN_SENSOR, LOW);
 digitalWrite(POWER_PIN_RELAY_HU, LOW);
 digitalWrite(POWER_PIN_RELAY_PU, LOW);
 digitalWrite(POWER_PIN_RELAY_AR, LOW);

 puDelayStart = millis();
 puDelayRunning = true;
}

void pumpStatement() {
  if (puDelayRunning && ((millis() - puDelayStart) >= puDelayTime)) {
    puDelayStart += puDelayTime;
    puOn = !puOn;
    if (puOn) {
      digitalWrite(POWER_PIN_RELAY_PU, HIGH);
    } else {
      digitalWrite(POWER_PIN_RELAY_PU, LOW);
    }
  }
}
void dehumidifierStatement
void loop() {

  digitalWrite(POWER_PIN_SENSOR, HIGH);
  delay(10);
  waterLevel = analogRead(SIGNAL_PIN_SENSOR);
  digitalWrite(POWER_PIN_SENSOR, LOW);
  Serial.print(waterLevel);
delay(1000);

if(waterLevel < 200) {
  digitalWrite(POWER_PIN_RELAY_HU, HIGH);
  if(waterLevel > 900) {
    digitalWrite(POWER_PIN_RELAY_HU, LOW);
}
}
pumpStatement();
}

here is a diagram of the wiring for the relay:

i use arduino uno rev. 3

There are no instructions and no wiring diagram for the relay module on the product page, so I don't know what "the jumper" does. The product photos don't show one. Did you post the wrong link?

The "NO" contacts are normally open, and the "NC" contacts are normally closed, until the Arduino sends a digital signal to the relay module. The signal reverses that situation.

Just wire the relay output as required for your project.

The code you posted probably does not compile without errors. What is this line supposed to do?

void dehumidifierStatement

its just for future use i must have forgot to put it in //, and im quite sure I didnt post the wrong link although thank you for the help

What jumper are you talking about? Post a photo of your setup.

I just figured it out myself, i had a mess of wires and I happened to wire one incorrectly. Sorry for wasting your time, and thanks for helping me

A post was split to a new topic: Relay works powering LED, but not with pump

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.