-->
Page 1 of 2

Sinking current with ESP8266 to control relay board

PostPosted: Wed Jan 13, 2016 11:39 am
by timofteandrei
Hey, guys! I don't know it you ever had this problem, but I want to control an 8 relays board (5V relays) using a NodeMCU v0.9 . The problem is that if you want to control each relay from the board, you have to put the corresponding pin to GND. I've measured the current and it's almost 30mA and the voltage is 5V as expected. I've used an Arduino Mega and an Arduino UNO in between of the NodeMCU and relay board as a logic level converter, but I want to make this system lightweight (it's controlling an RF remote for wireless sockets). I'm thinking about using a voltage divider with a 3v zener diode. Another possibility is by using an optocoupler, but i don't have enough optocouplers around, not even LDRs to try to make some homemade optocouplers. What do you sugest? Thanks!

Re: Sinking current with ESP8266 to control relay board

PostPosted: Wed Jan 13, 2016 11:45 am
by martinayotte
Simply use 8 individual MOSFETs or use a Darlington array such ULN2803.

Re: Sinking current with ESP8266 to control relay board

PostPosted: Tue Jan 19, 2016 12:44 pm
by Jokkepappa
FQP30N60L will work a charm for you .
http://cdn.sparkfun.com/datasheets/Comp ... 30N06L.pdf

Re: Sinking current with ESP8266 to control relay board

PostPosted: Wed Jan 20, 2016 12:21 am
by lethe
I just had a look at the project link and the first post: using relays to drive a couple of buttons on a remote is really overkill!
Use transistors to pull the pins of the remote to ground, any small signal NPN transistor or logic level n-FET should do. 20-50 BC547 for example will cost about a dollar including shipping, so if you don't have any, you should really consider ordering some.

If you really want to make your system "lightweight", you may also consider to get rid of the remote control all together. You can get 433MHz sender/receiver modules for cheap from ebay or aliexpress. With those you can send the remote control codes directly from the ESP (and control a lot more than 4 outlets at a time). There are plenty of tutorials on how to do that with an arduino or raspberry pi on the web and if I recall correctly even a few threads on this forum (searching for "433MHz" should give some results).