Automated irrigation with 12DC solenoid valve

Hello guys,
I am new to the community and new to the world of Arduino, I would like some guidance about a project that I'm working. I have no idea about wiring at all.
I want to make an automated irrigation system with a solenoid valve, I have successfuly connected the humidity sensor and the numbers are correct.
But now I wanted to connect the solenoid and it seems I'm doing something wrong with the wires.
I have a simply silicone copper wire, I have connected the - of the 12v power supply into 1 pin of the solenoid valve and the + into the 2 relay module , then i have connected the other pin of the solenoid valve into the relay module , I have also connected the GND , VCC, 5V of relay module into the Arduino ATMEGA GND, VCC, 5V
I used this code to run it.
Thank you all in advance and sorry for my bad English.

#define RELAY1 7  // Relay IN1 to pin 7

void setup() {
  pinMode(RELAY1, OUTPUT);
}

void loop() {
  digitalWrite(RELAY1, HIGH); // Turn solenoid ON
  delay(10000);                // 10 seconds
  digitalWrite(RELAY1, LOW);  // Turn solenoid OFF
  delay(10000);                // 10 seconds



Please show a picture or a link to a website of this relay module.

You must have a reason for saying that. You know what that reason is, but we don't.

You may well be right, but it’s a good time to learn about annotated schematics* that include all power and signal connections.

they’ll never go out of style, and will always be useful when diagnosing, repairing and upgrading you projects.

  • pen & paper + photo, or CAD is fine.

Hello!
I have attached pictures of the project.
I got the relay from Temu the link is not avaible anymore.

You have the solenoid wires connected to the wrong relay. Move then to the other relay

It's my first time wiring anything to be honest!
I thought that I might have picked the wrong wire but everywhere I looked they said this is the one you need, silicone copper wire.

Are you sure the white wire is connected to the 5V pin on the Mega?
Does the LED on the relay board light up?

Let me spell it out for you. I'm asking you to tell us why you say there is something wrong. We believe you that there is something wrong, but we don't know what that is because you have not told us. You only told us there is something wrong. Try to remember that we are not there in the room with you.

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