How to interact two devices with Node mcu

If a specific value is found in the fine dust meter using my Arduino Naro, it sends some text to the node mcu of the air cleaner. Is it possible to turn it on when the air cleaner receives A and turn off when B is received?

My devices.

Device A is dust sensor using arduino nano.

Device B is air cleaner with power switch.

My plan

  1. Device A detects specific dust value.

  2. Send message Device A to Device B

  3. Turn on the air cleaner or turn off.

Thank you.

It may be possible. :roll_eyes:

ilobrain:
If a specific value is found in the fine dust meter using my Arduino Naro, it sends some text to the node mcu of the air cleaner. Is it possible to turn it on when the air cleaner receives A and turn off when B is received?

What dust sensor?
What air cleaner (how is it powered)?
How far apart is sensor and cleaner?

To RIva

What dust sensor?
-PM2008M

What air cleaner(how is it powered)?
-It has 220v duct fan. If I just connect code in 220v, It works. It doesn't have power switch.

How far apart is sensor and cleaner?

  • Mabye Maximum 5M. I will use it in home.

Thank you read me!

Ah!

Finally!

A little bit of information. :grinning:

The PM2008M datasheet (here) says the device is best suited to 3.3V and can communicate over UART or I2C (What does your PM2008M use?) and if I understand you correctly the air cleaner has no power switch and is just turned on/off at the mains wall switch.
How many amps does the air cleaner draw? Depending on how many amps it draws you can maybe connect it to the mains through one of these or these that has been flashed with Tasmota or your own custom code.
The dust sensor could be connected to an ESP8266 device like the Wemos D1 Mini and it could talk to the switch over your wifi.

What does your PM2008M use?

  • Is it mean my display? If yes, I use 128X64 OLED and it's i2c.

if I understand you correctly the air cleaner has no power switch and is just turned on/off at the mains wall switch.

  • Yes. You are right. It turns on when i put code to 220v without switch.

How many amps does the air cleaner draw?

Sir, thank you and i ordered 'sonoff' and 'Esp8266'.
I have a question.
In my idea, If I will get 'sonoff' or 'Esp8266', I need coding in Arduino IDE for Ex).
Sorry. I should never write it again.

Ex) If Micro dust sensor detects bad level, turn on the air cleaner.
What i should learn for operating this at coding?
It's very hard thing for me.
Because In my searching, I can't find similar project that i refer to.

It's my coding about micro dust sensor. ( http://colorscripter.com/s/9wE8JPR )
I hope you have nice day.

ilobrain:
What does your PM2008M use?

  • Is it mean my display? If yes, I use 128X64 OLED and it's i2c.

I gather from your reply you also wish to use an 128x64 OLED display in the project but I was asking will you using UART or I2C to talk to the PM2008M.

Looks like someone has written a library for the PM2008M.

You may need some extra things to be able to flash the Tasmota firmware onto the Sonoff as shown here.
Are you comfortable soldering a header to the Sonoff, flashing new firmware and wiring it up without killing yourself with mains electricity?

The air cleaner (fan) looks to be 0.12A as you mentioned so the Sonoff will have no problems switching that.

Riva:
I gather from your reply you also wish to use an 128x64 OLED display in the project but I was asking will you using UART or I2C to talk to the PM2008M.
-I will be used UART or I2C. But now I can't decide either A or B. I should learn serial communication for using them.

Sir. Tasmota firmware is so amazing. I really appreciate your advice.