NodeMCU LUA V3 + 8 channel relay + KY-022 IR remote

I need to make a 8 channel 220v power strip. do these components matche together?
NodeMCU LUA V3

8 channel relay

KY-022 IR remote

the reason I chose NodeMCU LUA V3 is that it’s the cheapest mcu I found that doesn’t need soldering

I have something like this in my mind

Yes, but you need to be careful with wiring.
This will save you some time:

1 Like

what do you mean? because of ac electric shock?

I couldn’t find the module you suggested. the relay I posted earlier is available
since there are 13 pins in total which pins on nodemcu I should use?
IR remote and relay’s gnd and vin share pins or connect them separately?

Actually, Esp8266 has 9 (somehow) usable gpio pins plus TX/RX.
You need them all. And some pins will trigger relays on boot. I strongly suggest to go with Esp32 board. Cost is maybe $1 more…

https://aliexpress.com/item/1005002231689053.html

1 Like

if you remember I mentioned I live in Iran and I can’t buy from international websites.
my options are very limited
NodeMCU LUA V3 is 3$ and the cheapest nodemcu esp32 is 10$
with that in mind it would be best if somehow I can use NodeMCU LUA V., if it’s even possible
I know it’s not ideal but it’ll do the job?!

Yes.
Use the same pin configuration from the link above for ESP-12F_Relay_X8

With some of the pins that have states that effect boot or change state at boot, you may be better off using 2 8266’s and only use pins that are stable at boot.
Only difference is there will be 2 devices each controlling half.

I’m literally in war zone, Tehran, and they are shuting off the Internet so I need to do configurations ASAP to be able to control the relay offline
for now I got an 4output relay
please tell me which pins are safest for relays 4 pins an which pins I should use to connect KY-022 IR remote
also please give me a esphome yaml code to control the relay with KY-022 IR remote

I know it’s a lot to ask but it’s emergency

Gpios 4,5,12,13,14

That’s not something I can do. You need to receive and record the codes successfully from you remote control first.

1 Like

these are the code I get

key #1
[15:42:12][I][remote.pronto:231]: Received Pronto: data=
[15:42:12][I][remote.pronto:233]: 0000 006D 0023 0000 003E 001D 0053 00AE 0015 0041 0015 0041 0015 0041 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 0015 0041 0015 0041 0015 0016 0016 0015 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 
[15:42:12][I][remote.pronto:233]: 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 0015 0041 0015 0016 0015 0041 0015 0041 0015 0041 0015 0041 0015 0041 0015 0181 
[15:42:12][D][remote.beo4:086]: Beo4: n_sym=68
[15:42:12][I][remote.pronto:231]: Received Pronto: data=
[15:42:12][I][remote.pronto:233]: 0000 006D 0022 0000 00AE 00AE 0015 0041 0015 0041 0015 0041 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 0015 0041 0015 0041 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 0015 0016 
[15:42:12][I][remote.pronto:233]: 0015 0016 0016 0016 0014 0016 0015 0016 0015 0041 0015 0041 0015 0016 0015 0041 0015 0041 0015 0041 0015 0041 0015 0041 0015 0181 
[15:42:12][I][remote.samsung:061]: Received Samsung: data=0xE0E020DF, nbits=32

key #2
[15:43:52][D][remote.beo4:086]: Beo4: n_sym=70
[15:43:52][I][remote.pronto:231]: Received Pronto: data=
[15:43:52][I][remote.pronto:233]: 0000 006D 0023 0000 0023 0028 0064 00AE 0015 0041 0015 0041 0015 0041 0015 0016 0015 0016 0015 0017 0014 0016 0015 0016 0015 0041 0015 0041 0016 0040 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 0015 0016 0015 0041 
[15:43:52][I][remote.pronto:233]: 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 0015 0016 0015 0041 0015 0041 0015 0041 0015 0041 0015 0041 0015 0181 
[15:43:52][D][remote.beo4:086]: Beo4: n_sym=68
[15:43:52][I][remote.pronto:231]: Received Pronto: data=
[15:43:52][I][remote.pronto:233]: 0000 006D 0022 0000 00AE 00AE 0015 0041 0015 0041 0015 0041 0015 0016 0015 0016 0016 0015 0015 0016 0015 0016 0015 0041 0015 0041 0015 0041 0015 0016 0015 0016 0016 0015 0015 0016 0015 0016 0015 0041 0015 0016 0015 0041 0015 0016 
[15:43:52][I][remote.pronto:233]: 0015 0016 0015 0016 0016 0015 0015 0016 0015 0016 0015 0041 0015 0016 0015 0041 0015 0041 0015 0041 0015 0041 0015 0041 0015 0181 
[15:43:52][I][remote.samsung:061]: Received Samsung: data=0xE0E0A05F, nbits=32

key #3
[15:44:28][D][remote.beo4:086]: Beo4: n_sym=70
[15:44:29][I][remote.pronto:231]: Received Pronto: data=
[15:44:29][I][remote.pronto:233]: 0000 006D 0023 0000 0035 0027 0052 00AE 0015 0041 0015 0041 0015 0041 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 0015 0041 0015 0041 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 0015 0041 
[15:44:29][I][remote.pronto:233]: 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 0015 0016 0015 0016 0015 0041 0015 0041 0015 0041 0015 0041 0015 0041 0015 0181 
[15:44:29][D][remote.beo4:086]: Beo4: n_sym=68
[15:44:29][I][remote.pronto:231]: Received Pronto: data=
[15:44:29][I][remote.pronto:233]: 0000 006D 0022 0000 00AE 00AE 0015 0041 0015 0041 0015 0041 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 0015 0041 0015 0041 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 0015 0041 0015 0016 
[15:44:29][I][remote.pronto:233]: 0015 0016 0016 0015 0015 0016 0015 0016 0015 0041 0015 0016 0015 0016 0015 0041 0016 0040 0015 0041 0015 0041 0015 0041 0015 0181 
[15:44:29][I][remote.samsung:061]: Received Samsung: data=0xE0E0609F, nbits=32

key #4
[15:44:56][D][remote.beo4:086]: Beo4: n_sym=68
[15:44:56][I][remote.pronto:231]: Received Pronto: data=
[15:44:56][I][remote.pronto:233]: 0000 006D 0022 0000 00AE 00AE 0015 0041 0015 0041 0015 0041 0015 0016 0015 0016 0016 0015 0015 0016 0015 0016 0015 0041 0015 0041 0015 0041 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 
[15:44:56][I][remote.pronto:233]: 0015 0016 0015 0016 0016 0015 0015 0016 0015 0041 0015 0041 0015 0041 0016 0015 0015 0041 0015 0041 0015 0041 0015 0041 0015 0181 
[15:44:56][I][remote.samsung:061]: Received Samsung: data=0xE0E010EF, nbits=32
[15:44:56][D][remote.beo4:086]: Beo4: n_sym=68
[15:44:56][I][remote.pronto:231]: Received Pronto: data=
[15:44:56][I][remote.pronto:233]: 0000 006D 0022 0000 00AE 00AE 0015 0041 0015 0041 0015 0040 0016 0016 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 0015 0041 0015 0041 0015 0016 0015 0016 0015 0016 0015 0016 0016 0015 0015 0016 0015 0016 0015 0016 0015 0041 
[15:44:56][I][remote.pronto:233]: 0015 0016 0015 0016 0015 0016 0015 0016 0015 0041 0015 0041 0015 0041 0015 0016 0015 0040 0016 0041 0015 0041 0015 0040 0016 0181 
[15:44:56][I][remote.samsung:061]: Received Samsung: data=0xE0E010EF, nbits=32

If you use:
dump: samsung
instead of “all”, do you catch all button presses?

[16:29:36][I][remote.samsung:061]: Received Samsung: data=0xE0E020DF, nbits=32
[16:29:43][I][remote.samsung:061]: Received Samsung: data=0xE0E0A05F, nbits=32
[16:29:47][I][remote.samsung:061]: Received Samsung: data=0xE0E0609F, nbits=32
[16:29:56][I][remote.samsung:061]: Received Samsung: data=0xE0E010EF, nbits=32

code:

esphome:
  name: esphome-web-85b6cd
  friendly_name: Desk Fan
  min_version: 2025.5.0
  name_add_mac_suffix: false

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:

# Allow Over-The-Air updates
ota:
- platform: esphome
  password: "sha935"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

captive_portal:

web_server:

remote_receiver:
  pin:
    number: GPIO14
    inverted: true
  dump: samsung

Try with these:

binary_sensor:
  - platform: remote_receiver
    name: "Remote Input1"
    samsung:
      data: 0xE0E020DF
      nbits: 32
    on_press:
      then:
        - switch.turn_on: relay_1

switch:
  - platform: gpio
    id: relay_1
    name: "Relay 1"
    pin: GPIO4