Code Monkey home page Code Monkey logo

Comments (11)

mB-PiBox avatar mB-PiBox commented on April 17, 2024

Probably not supplying the correct pinout. Also you would need to define "RELAY1" to the pin you're using.

Google how to use relay with Arduino, and you will get your basic setup. Also there are several videos of the NodeMCU used with relays.

No need to post under issues, as you're inability to use a simple relay is not an issue with NodeMCU

from nodemcu-devkit-v1.0.

alexartd avatar alexartd commented on April 17, 2024

If I connect led anode (+) to the same GPIO and led catode (-) to GND it works so GPIO is controlled correctly, but if the same GPIO is connected to IN pin of relay, it doesn't work.

from nodemcu-devkit-v1.0.

mB-PiBox avatar mB-PiBox commented on April 17, 2024

http://bfy.tw/F33K

from nodemcu-devkit-v1.0.

alexartd avatar alexartd commented on April 17, 2024

Many thanks but it is what I've done and I'm sure that relay is connected well, as explained on internet. You haven't understand my question. I think that the problem is that this relay board work with low signal, GND to be clear. But a GPIO is not able to send a GND signal bit a positive signal from 0 to 3.3V. I think that with a transistor I can resolve but I'm searching other solutions.

from nodemcu-devkit-v1.0.

mB-PiBox avatar mB-PiBox commented on April 17, 2024

No, relays work the same. You have POWER or NO POWER to the input/trigger. Which Opens or Closes the gate/circuit depending on the NC/NO state of the relay. By connecting to GND you are basically providing NO POWER to the input/trigger.

You are almost 100% referencing the wrong GPIO in your code, or have not correctly defined your pin

from nodemcu-devkit-v1.0.

alexartd avatar alexartd commented on April 17, 2024

Ok but I've wrote that if I connect a led in the place of relay, it work so GPIO work.

from nodemcu-devkit-v1.0.

alexartd avatar alexartd commented on April 17, 2024

I think this is the solution:
https://iot-playground.com/images/articles/053/ESP8266_4_relay_switch.png

from nodemcu-devkit-v1.0.

mB-PiBox avatar mB-PiBox commented on April 17, 2024

Again, relay works the same. I have a 8 RELAY system that controls the lights in my work shop off a NodeMCU, and each relay input/trigger is connected to a GPIO. No need for any resistors (or in the case of the link you provided NO transistor) to make the relay work.

I even have a 2 channel relay sitting right here, that I just tested on a spare NodeMCU, and again no resistor or transistor needed.

from nodemcu-devkit-v1.0.

alexartd avatar alexartd commented on April 17, 2024

Probably my relay is different from your. I don't know.

from nodemcu-devkit-v1.0.

mB-PiBox avatar mB-PiBox commented on April 17, 2024

THEY ALL WORK THE SAME! FFS

from nodemcu-devkit-v1.0.

alexartd avatar alexartd commented on April 17, 2024

My relay turn on with pin IN connected to GND or also to 3.3V. GPIO pin from MCU turn from 0V to 3.3V but I don't understand why it cannot turn on relay. I've solved with circuit with transistor.
Bye

from nodemcu-devkit-v1.0.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.