I have a 5 V relay module connected to WeMos D1 board. The load is a small electric cooker.
The code turns on and off the relay every 5s for testing purposes.
digitalWrite(pin,HIGH); delay(5000);
digitalWrite(pin,LOW); delay(5000);
However, the green light and red light are always on. there is no switching happening. An onboard led on the WeMos D1 board is blinking every 5s.
int pin = 14;
void setup()
{
pinMode(pin, OUTPUT);
}
void loop()
{
digitalWrite(pin,HIGH);
delay(5000);
digitalWrite(pin,LOW);
delay(5000);
}
Thank you!
relay module
... refer to the datasheet about the correct way to control it ... you probably do not need the 10 k resistor \$\endgroup\$