Skip to content

tuya IoT interface WP1354

Marco Sillano edited this page Nov 20, 2024 · 12 revisions

tuya IoT interface module

From the manufacturing company (Whadda) documentation:

Control your Arduino projects from anywhere in the world with a free app thanks to the Tuya IoT interface!

Plug the Tuya IoT interface module into your Arduino by using the included 4 male wires. Then connect your Arduino with the IoT Tuya cloud by simply installing the Tuyav library, which is compatible with ATmega chipsets (or AVR platforming). This will enable you to connect with the Tuya app over WiFi and lets you control up to 5 outputs.

  • dimensions (W x H x D): 31.5 x 42.8 x 9.6 mm
  • power: 5 VDC
  • connectioncs: VCC, GND, TX, RX
  • available IO connections:
    • 9 x AV (arbitrary value): string, max 255 chars
    • 3 x DI (digital input): boolean, 1 or 0 (on or off)
    • 3 x AI (analog input): integer, 0-4095 (suitable for 10-bit or 12-bit resolution dev boards)
    • 5 x DO (digital out): boolean, 1 or 0 (on or off)
    • 3 x AO (analog out): integer, 0-255
  • wireless frequency: 2.4 GHz (not compatible with 5 GHz frequency)
  • working temperature: 0-55 °C
  • typical operating power consumption: 60 mA
  • max. power consumption: 450 mA

The description is correct but limited: Arduino is only an option. As in Tuya documentation, a Tuya device is the union of two modules:

The MCU can be anything that can talk via serial protocol to the WiFi module. The 'tuya IoT interface' contains all unique ids and encryption keys required by the Tuya system, only is required an adequate MCU. This way it is possible to build a 'real custom Tuya device'!

Now some bad news:

  • The demo example is too big to fit in Arduino Uno, requires Arduino Mega.
  • The protocol is the standard Tuya protocol, not so simple (see also here).
  • Of course, the manufacturing companies that produce tuya-enabled devices have a simplified plug-and-play development environment, not available for a DIY user, making a custom MCU from scratch.

So when to use this module? I think in medium projects, requiring remote control and limited integration (automation) with other tuya devices, e.g. greenhouses control: the logic that is not possible to implement using 'automation' is implemented in an ad hoc controller with 'Tuya IoT interface': it can get the user parameters and sensor data, and execute the required policy. It can control as many actuators as required via 'automation'. The result is an integrated and homogeneous custom Tuya system, but still with the limits of that ecosystem.

Using tuyaDAEMON a designer is freer: whit the 'IoT interface module' connect directly to tuyaDAEMON, it is possible to utilize 4 string DPs to send any 'standard command' and one DP to get events: so the full tuyaDAEMON event processor will become a real 'tuya device', with remote control not limited only to TRIGGERs. In this case, the protocol is implemented in js, because now node-red is the MCU.

[ADDENDUM] 11-2024
Here is a new adapter DIY (arduino) Tuya: see https://www.kincony.com/esp32-tuya-iot-adapter-v2.html

Clone this wiki locally