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
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.
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?
#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
}
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.
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