0

Update: I realized my relay module was 12V and the current leaving the digitalpin from my Wemos D1R1 is only 3.3V. I bought a 5V relay module that I read in some articles that it could work, but it didn't.

My new question is: is there an easy and simple way to amplify the voltage leaving the D5 pin so it could control the 12V or the 5V relay module? I tried using and logic level converter from 3.3V to 5V but had no success. Ideas?


I am having issues with a simple project using Wemos D1 and a relay board. I followed a tutorial that was supposed to work out fine (https://www.instructables.com/id/Control-a-Lamp-With-ESP8266-and-a-Relay/), but for some reason I still don't know it is not working.

I read that it could be that the D5 pin has not enough energy to trigger the relay and change its state. So I tried using a logic level converter and still it didn't work.

I am attaching the image of my board/connections and also the logic level converter (https://br.banggood.com/3_3V-5V-TTL-Bi-directional-Logic-Level-Converter-For-Arduino-p-949438.html), plus my code below.

void setup() {
  // put your setup code here, to run once:
    Serial.begin(115200);

}

void loop() {
  digitalWrite(5, HIGH);
  Serial.println("HIGH");
  delay(3000);
  digitalWrite(5, LOW);
  Serial.println("LOW");
  delay(3000);
}

my circuit

Does anyone have any idea of what could be happening? And how to make it work?

  • 1
    I can't quite see the text under the red wire connected to the Wemos D1. Does it say 5V? I'm asking because the relay requires 12VDC to operate. – VE7JRO Jun 2 at 19:25
  • yep. its 5V. I think I'll try with 12V and get back here if it still doesnt work – diegodacal Jun 2 at 19:55
  • D5 is not io 5. use D5 in code – Juraj Jun 3 at 13:45
  • Still no success. Just got a 12V 2A powersource and still it doesnt trigger the delay. Also changed 5 to D5 in the code, and nothing happened. – diegodacal Jun 3 at 19:24
  • try connecting the signal pin of the relay right to ground and vcc; do either of them actuate? – dandavis Jun 3 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.