Getting started with Tuya IoT platform | How to Deploy thing on Tuya IoT Platform with Arduino Uno

In IoT Development


Getting started with Tuya IoT platform | How to Deploy thing on Tuya IoT Platform with Arduino Uno - read the full article about IoT Development, IoT Development and Internet of Things technologies from Electronics Innovation on Qualified.One
alt
Electronics Innovation
Youtube Blogger
alt

Hello All, I am Veeru from electronics innovation.

In this video, we will look at the Tuya IoT platform.

by the end of the video, you are able deploy a tuya IoT platform-based IoT device that offers you to connect and control anything from anywhere in the world.

What is Tuya? Tuya Smart is a leading global IoT Cloud Platform that connects the intelligent needs of brands, OEMs, developers, and retail chains.

The platform provide developers a one-stop IoT PaaS-level solution that contains hardware development tools, global cloud services, and smart business platform development, tuya offering comprehensive ecosystem empowerment from technology to marketing channels to build the worlds leading IoT Cloud Platform.

I see tuya as the future of IoT and a universe of possibilities.

Now, Lets see how to create a Thing in tuya smart IoT platform that offers you to connect and control anything from anywhere in the world.

This process contains three main steps.

1.

Creating a thing on the Tuya IoT platform and Activating it on the tuya PMS platform.

2.

Burning authorizations of tuya into the ESP8266 module.

3.

Interfacing ESP8266 module with Arduino UNO and Programming the same device to connect with tuya smart IoT platform.

Lets dive deeper into each step.

Before going further, make sure you have the following components with you.

1.

Arduino UNO 2.

Arduino Uno Programming cable 3.

ESP8266 module.

(Here I have this NodeMCU development kit, which is based on ESP8266.

but if you have any other ESP8266 based module that would be fine) 4.

MicroUSB cable to program the ESP8266 module.

5.

breadboard 6.

Some connecting wires 1.

Creating a thing on the Tuya IoT platform and Activating it on the tuya PMS platform.

First of all, visit the Tuya IoT platform using the link provided in the description below.

Signup by providing the following info and then confirm your email.

If you register on Tuya Smart IoT platform using the link provided in the below description, you will get $7 coupon, you can use them to purcahase any tuya modules on the same platform.

Then login to the platform using the same credentials.

If you find the website in the Chinese language, you can change it to English from here.

Then click on the create a product, Then make sure you are in the standard category.

In this tutorial, I am going to discuss controlling a light source from the tuya IoT platform.

So, go to the Lighting category and light source.

select solution type, custom solution.

then click on the bulb icon.

Provide a name for your device, if you wish you can also provide a model for it.

then check protocol WiFi-Bluetooth and power type standard power consumption, after that click on create button.

Thats it a new product/ device has been created on the tuya IoT platform.

Now, copy the product id or say PID and mail it to [email protected] together with your Tuya IoT account name as the subject.

After some time, you will receive a token from the Tuya DevOps team.

Then, visit the tuya PMS platform using the link provided in the description.

signup by providing all required details, then log in using the same credentials.

If you find the website in the Chinese language, you can change it to English from here.

Click on Production management, work order management, then activation code verification.

Input Token ID that you just receive over mail and confirm.

Please note that the One Token ID can only be activated by one user.

You can find the activated code list in the following menu.

Thats it.

The token was activated successfully.

Thus the first step was completed.

2.

Burning authorizations of the tuya thing into the ESP8266 module.

We will use the TYDA software application to burn the authorization into the ESP8266 module.

Download the installation package from the link given in the description.

Install the Tuya_TYDA_Install_V2.4.0 and log in with your PMS account by clicking Online Login button.

You can choose Automatic Login and Remember The Password if you want to log in automatically, whenever you have opened the software.

After successful login, the following page should appear.

If you find the software in the Chinese language, you can change it to English from here.

Now, connect ESP8266 to your PC using any USB interface and install ESP8266 driver CP210x.

If you ever programmed an ESP8266 module with a computer you can skip this step.

after successful installation, go to device manager from the Windows start menu and click on the ports section.

you will find a silicon lab CP210x driver installed.

note down the comport no, generally it would be COM3.

Then, come back to the TYDA application and select the setup option from the file menu.

select burning baudrate 921600 and testing baudrate 9600 and leave the rest of the configurations as default.

then click on the ok button.

Click Enter Token to input the token which is activated on the tuya PMS platform and select workstation-Burning Authorization, also check the firmware download option.

then click on okay.

Now, select the previously noted com port and click on the run button.

a few seconds after the burning procedure will begin and continue until 100%, then you will see the following success page on the software.

If the burning fails, make sure you have installed the driver properly, or selected the right port, or put the ESP8266 module in the programming mode or not.

If the following success page appeared on the software, congratulations... you have successfully burned tuya authorizations into the ESP8266 module.

After burning authorizations, disconnect esp8266.

3.

Interfacing ESP8266 module with Arduino UNO and Programming the same device to connect with Tuya smart IoT platform.

Here is the circuit diagram to interface the ESP8266 module with Arduino, The Arduino UNO will communicate with ESP8266 over serial communication.

Here we are using the serial port of both Arduino and ESP8266 to make them communicate with each other.

After connections, the circuit should be something like this.

Now open ArduinoIDE.

We are going to use the Tuya library for this project.

Tuya has published its official library in the Arduino library manager, so we can install it directly from the library manager.

Click the Sketch menu and then Include Library > Manage Libraries.

Find Tuya_WiFi_MCU_SDK and install.

or you can download the same library from the tuyas GitHub page as shown here and add the package to the Arduino library folder after unzipping it.

then restart the ArduinoIDE, and verify that Tuya library appears in Contributed libraries section by going to following directory.

Now, go to the examples section from the file menu and search for Tuya_WiFi_MCU_SDK, and open the start example.

Now Connect Arduino Uno with PC Then check uploading configurations board Arduino Uno, and select the right port.

then compile the code and upload it to the Arduino UNO If you face any problems while uploading, just disconnect ESP8266 and try uploading again.

because The connection between these two boards might interfere with the uploading.

After successful uploading, take out your mobile and install the tuya smart app from the play store.

then create a new account and log in to it.

Now, connect the GPIO pin 7 of the Arduino to the ground for 3 to 4 seconds to put the device into pairing mode.

The onboard led will flicker if the module in pairing mode.

Now go to the tuya smart app and add the device as shown here.

We can also edit the name of the device here.

Upon successful pairing, you are able to control the onboard led of Arduino UNO as shown here.

This led internally connected to pin 13, We can simply interface the 230v bulb with the same pin using a relay and control the same bulb.

Thats it for the tutorial.

I hope you have enjoyed the video and learned something new from this episode.

see you soon on the next video.

bubye...together lets innovate the future with IoT.

Electronics Innovation: Getting started with Tuya IoT platform | How to Deploy thing on Tuya IoT Platform with Arduino Uno - IoT Development