What is happening to my relay

I am using a relay in my school project (therefore, i need urgent help)
here i am connecting relay to arduino along with soil moisture and dht11 sensor.
It is a 5v relay that i am powering with external power supply rated 5v 1.55A output and is acting as a switch for a 5v dc pump
else dht and soil sensor are connected to arduino. Here is my my connection json file

connect.json (958 Bytes)

and here is my wokwi link(new)
just suppose that the relay is connected to another power supply in above links and files.

My relay is not taking input from arduino whenever i tell arduino to give input, it gives as i can see a small variation on green light but my pump is not turning on.

@xfpd @arduinojanuary

You have your dht22 wired to A0 but you are reading A1.
You have VCC on the relay wired to VCC on the display but not connected to any source.
You have your dht22 VCC wired to pin13?

Your simulation needs to be cleaned up

Asking for help then being argumentative and obtuse will get you nowhere.

im sorry for that....pls help

I am sorry for being too furious as i am in a hurry. i have to submit this project tommorow in a science exhibition.....plss help

And what is the name of the pin? dht1:SDA?
Is there a clue there?

no its just a name of dht22 pin on wokwi, nothing strange and it is a analog output pin

The wokwi shows you're using 5V from the "Nano" - VUSB presumably. (Not sure how that works with the "Nano" fakes and their CH340.)

@wittrup @xfpd @blh64 the main issue here is that the relay is not taking input even if soil moist is high

or rather can it be due to low power supply of arduino

beacuse i saw a very tiny variation in input light

Maybe you should try a little relay_on/relay_off exercise - no DHT junk, just relay clicking.

1 Like

Try this first:

#define relay 7

void setup() {
  Serial.begin(9600);
  while ((!Serial) && (millis() < 3000));  // Wait for Serial

  pinMode(relay, OUTPUT);
  Serial.println("Welcome to Relay Tester");
  delay(1000);
}

void loop() {
  digitalWrite(relay, HIGH);  // turn the PUMP on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(relay, LOW);   // turn the PUMP off by making the voltage LOW
  delay(1000);                      // wait for a second
}

Serial.println() the value moist.

Try replacing the moisture sensor with a potentiometer to verify voltage changes actuate the realy.

guys i just did relay on off exercise and heres the result, the green light(input light is not working well) barely can see any light there can still confirm tho that green light is on as it is fluctuating.

in the main code, see that moist is being printed

also cannot hear relay clicking

guys also this is my humble request to you pls make this popular, try tagging your friends so that more people can figure out together that ho to do this cuz i need to submit it tommorow

Can u post some good pics of your setup and wiring? I suspect something isn't wired correctly.

I'm out.