8 Relay Control With NodeMCU and IR Receiver Using WiFi and IR Remote and Android App

4,598

71

5

Published

Introduction: 8 Relay Control With NodeMCU and IR Receiver Using WiFi and IR Remote and Android App

Controlling 8 relay switches using nodemcu and ir receiver over wifi and ir remote and android app.

the ir remote works independent of wifi connection.

HERE IS A UPDATED VERSION CLICK HERE

Step 1: Grab the Parts

Things you required for this project

  1. NodeMCU
  2. 4 channel Relay Module x 2
  3. IC7805 x 2 (1 IC7805 doesnot provide enough current to power on 8 relays at same time)
  4. Breadboard
  5. IR Receiver (VS1838)
  6. LED Red x 1
  7. Resistance 1K x 1
  8. Push Button x 1
  9. Jumper Wires
  10. Power Supply

Step 2: The Code

THIS CODE IS FOR NODEMCU BOARD NOT ARDUINO

I have written the code in a way so that if WiFi gets disconnected or not available, the LED will glow, and the relay control from IR Remote will go on independent of WiFi.

When WiFi is available press the push button or press the dedicated button on IR Remote and wait for 5sec to connect to wifi. If the LED doesn't turns off then the wifi is not connected.

First download Arduino IDE from HERE.

Then go to File -> Preferences, then on additional board manager urls, add this

http://arduino.esp8266.com/stable/package_esp8266c...

Then go to Board manager and install esp8266 by ESP8266 Community.

go to library manager and install IRRemoteESP8266.

First connect the ir receiver to nodemcu board, 3.3v to 3.3v, gnd to gnd, output to gpio2(D4).

upload the sketch IRRemote Value given below, open serial monitor and press remote key to get the values of each key, write it down somewhere. Note at least 9 key values, (8 values for 8 relays and 1 for reconnect wifi).

Then make the circuit as the schematic given above and upload the code My_Room.

Don't forget to modify the ir codes in the my_room sketch with the ir code you got for each button on the remote and the wifi ssid and password.

NOTE: WHILE UPLOADING THE SKETCH MAKE SURE NOT TO CONNECT ANYTHING TO THE PIN D0, D8, TX, RX. OR SIMPLY PULL OFF THE JUMPER WIRES FROM THOSE PINS.

Step 3: Schematic

Follow the schematic and make the circuit.

IC7805 doesnot have enough power to run 8 relays at same time. So, we are using two 4ch Relay module and two IC7805.

Any IR Receiver will work.

Power Supply can be 24V max.

Step 4: Android App

I have made the Android App using MIT APP Inventor.
You can upload the aia file to App Inventor and edit it.

Step 5: You Did It

Go to your router admin panel and get the IP Address of the NodeMCU.

Also assign a particular IP to the Mac Address of nodemcu, so that it gets the same ip, every time and you dont have to check it every time.

YOU CAN USE IR REMOTE, ANDROID APP AND INTERNET BROWSER ON SAME NETWORK, OR YOU CAN USE PORT FORWARDING IN YOUR ROUTER TO ACCESS OVER INTERNET FROM ANYWHERE IN THE WORLD.


In case of problem, contact me on fb, www.fb.com\amit.s.samanta , i will help as far as i can.

Share

    Recommendations

    • Oil Contest

      Oil Contest
    • Make it Move Contest

      Make it Move Contest
    • Woodworking Contest

      Woodworking Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    5 Comments

    no doubt the idea is good, working fine withe IR remote , Wifi control and Web Browser control..

    only one issue arised that the node mcu restarts after some time with error

    ets Jan 8 2013,rst cause:2, boot mode:(3,6)

    load 0x4010f000, len 1384, room 16
    tail 8
    chksum 0x2d
    csum 0x2d
    v614f7c32
    ~ld

    can any one resolve the issue....

    want to make this project but the schematic not clear enough to view

    1 reply

    Thank you for sharing the project. Its interesting. and the entire ecosystem....write from arduino code to the android code...this is a complete project. Thank you.

    That looks good, thanks for sharing :)