So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By aruneshdutta
#67453 Hello all

I wanted guidance on how to connect ESP8266 with relay module as shown in this http://robokits.co.in/bmz_cache/d/d09bcb9096289ca88ffed0e858ceabe8.image.1066x800.jpg and then conne[/url]ct the electrical equipment with it.Thanks for your guidance!!
User avatar
By btidey
#67458 The relay is a 5V unit so you will need a 5V supply as well as the 3.3V supply for the ESP8266. If you start with a 5V supply then you can derive the 3.3V for the esp8266 from it.

The second part is the control pin on the relay module itself. This varies quite a bit across different types of relay module. The description on the robokits site is not very clear other than stating it is 5V TTL. The picture would seem to indicate it is fairly simple and does not use an opto.

As the logic out from the GPIO pins on the esp8266 is 3.3V you have a number of choices.
a) Use a 3.3V to 5V level translator.
b) Insert a single transistor buffer between the GPIO output and the relay input to step up to +5V
c) Check out how the input circuit on the module is actually arranged. It may be that it could be driven OK via the GPIO of the ESP8266 directly. If, for example, it is just a resistor and pull down into the base of the relay driving transistor then that should work directly from the esp8266. One way of checking is to power the module from +5V and then use a meter to measure the volts on the data in pin. If it is near 0V then you should be OK. If it is near +5V then you need to use method a or b.

If you are going to use the relay contacts to switch high voltage 120V or 240V equipment then you need to very careful with that wiring as those voltages are very dangerous.

Note that is now possible to get similar relay modules that are directly compatible with 3.3V supplies which means you then don't need a separate +5V supply.
User avatar
By Fleming
#67464
aruneshdutta wrote:Hello all

I wanted guidance on how to connect ESP8266 with relay module as shown in this http://robokits.co.in/bmz_cache/d/d09bcb9096289ca88ffed0e858ceabe8.image.1066x800.jpg and then conne[/url]ct the electrical equipment with it.Thanks for your guidance!!


Hi,
The module shown in the picture already has a transistor to drive the coil of the relay... my first trial would be just to try directly attaching one of the digital outputs of the ESP to the input of the relay...
It should workwithout too much problem... otherwise or another transistor or a level converter...

Regards