Skip to content

tuya IoT interface WP1354

Marco Sillano edited this page May 26, 2021 · 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

This description is correct but limited. 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 WiFi module. This way it is possible to build 'real' custom Tuya devices! And using it we can access the more hidden Tuya features.

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 DIY users.

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 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'.

Using tuyaDAEMON it must be possible to utilize 4 string DPs to send any 'standard command' and one DP to get events: so the full tuyaDAEMON will be a real 'tuya device', with remote control not limited to TRIGGERs. In this case, the protocol must be implemented in js, because now node-red becomes the MCU. And this can be a good gym to enter in Tuya protocol.

Clone this wiki locally