I'm trying to connect an ESP8266 gpio to one of the relay modules (please check the image).
As I understand with a very basic background, ESP should be able to trigger this relay modules since all the electronics are embedded in them (they are not just single relay components). I have powered both ESP and relay module with different power sources, with the proper VCC for each (3v3 and 5v, sharing GND). But setting HIGH and LOW outputs from ESP have an erratic behavior (some times the relay module triggers, sometimes it just stays in the same state no matter the gpio output delivered).
Now, digging not just this community but some other sources in the web, I know there should same transistor to help driving a higher voltage to the relay input(s) than the one provided but the ESP gpios.
Its important to point out that:
- both relay modules work just fine when they are connected to an Arduino Nano, which of course has a HIGH of 5v, and that seems to confirm the issue with the ESP gpio
- 2-relay module works "better" than 1-relay module:
in terms of accuracyLOW gpio -> relay on; HIGH gpio -> relay off. 1-relay module seems to trigger only once, and then keeps the relay on no matter the gpio value (just like if relay IN is always shorted to ground). - I measured ~2.72v in both IN pins of the 2-relay module, and ~4.33v from the 1-relay module. So that makes me think ESP can't turn off the relay in the later because it will never reach the normal pin voltage value, and almost everything lower will be acknowledge as
GNDLOW (thus, relay on).
My question is: how can I properly drive LOW and HIGH values from ESP gpio to this relay modules?