A place users can post their projects. If you have a small project and would like your own dedicated place to post and have others chat about it then this is your spot.

User avatar
By timofteandrei
#38695 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!
User avatar
By lethe
#39276 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).