他们逼我做卧底

【Training Camp】IoT Light Strip-398883A

 
Overview

RGB lights based on Tuya intelligent control (WB3S module)

This project is a simple IoT development board. The development board is equipped with a dual module of WB3S WiFi and Bluetooth. Using a mobile phone to connect to Tuya Smart’s IoT life platform, the color of the RGB light can be remotely controlled. There are also functions such as timer switches. You can also use the buttons to adjust the parameters of the light, such as: brightness, color, etc.

1. Basic functions

1. Realize the brightness control of the lamp

2. Realize color control of lights

3. The mobile phone can realize timing function

4. The buttons can be successfully controlled

2. Device selection

WB3S WiFi Bluetooth dual module

Directly use the official module of Tuya Smart as the main control, without adding an additional main control such as stc or stm, saving costs. The most important thing is that wb3s is officially provided by Tuya. It can realize the function with zero code. You only need to build and process the circuit diagram to use it. It is convenient, fast and low-cost. It is only 15 yuan. Free shipping with SF Express.

AMS1117-3.3

Use 1117 to convert the USB input 5V voltage to 3.3V. The output 3.3V is very stable with very small deviation, so I chose this voltage regulator chip.

button

When I set the function, I chose a button because this module can control the brightness and heating and cooling of the lamp, so I thought it might be more convenient to use the button on a desk lamp, so I added a button to verify the feasibility of the solution.

CH340C

Choosing this serial port chip is completely redundant. Originally, I thought of using a serial port to realize communication between the module and the computer, because Tuya provides a host computer that can simulate MCU or WiFi module. Later, after the board was soldered, I found that the SDK in the module implemented with zero code cannot realize serial communication, so this is useless.

3. Design ideas

1. Use the wb3s module to directly connect to the cloud without the need for other masters. All operations are written in the SDK automatically generated by Tuya Smart. You can use it right away.

2. In the design and development stage, it is still necessary to add a CH340 for serial communication debugging and familiarize yourself with the protocol content (later it is found that communication cannot be established)

3. I chose a button. Since the module can control the brightness and heating and cooling of the lamp, I thought it might be more convenient to use the button on a desk lamp, so I added a button to verify the feasibility of the solution. If it is feasible, I can do it myself later. Play with a small desk lamp

4. Welding


During the soldering process, I replaced the RGB pull-down resistor with a 1x4 resistor. I had never soldered this resistor before, so when I got it, I found that it was not something I could solder now, and there were not many tools. , so it is not welded. But fortunately, this didn't have much impact. I barely soldered a necessary resistor, but I didn't solder it if it was necessary. There were no other major problems, and it was successful in the end, as shown in the picture above:

image.png        image.png

5. Debugging process


After the board arrives, the soldering is completed. When I turned on the power, I found that there was still something wrong. I was a little stupid at first, thinking that it would work just by plugging it in, and that I could directly connect it to my mobile phone. The result is as you can imagine. Later, when I went to Tuya’s official website, I realized that I had a silly question. I didn’t even need a network, so how could I connect to it? How could I call it a WiFi module if it wasn’t connected to the Internet? But I don’t know how to connect to the Internet, and there is no display on the phone. Finally, I read a lot of Tuya documents and some Tuya network configuration videos. When I finally wanted to configure the network, I found that the module was suddenly detected on the phone. In fact, I later realized that there is Bluetooth and the phone can detect it. It arrived, but the question is why it didn’t exist in the beginning. I saw this sentence in a Tuya manual that said that the SDK cannot be changed after powering on for fifteen minutes. I don’t know if this means that the module needs to be powered on for fifteen minutes. It takes effect after several minutes (I don't know). After I found that the phone found the module, I started trying to configure the network. However, several times the phone and the module failed to match. I took a closer look. I found that I need 2.4G network. I didn’t have a router when I was studying, so I asked my classmates to turn on the WiFi. Finally, I asked him to change the WiFi frequency to 2.4G before I was able to connect successfully. The device was connected several times. Anyway, the final success rate can be controlled by buttons and mobile phones. Finally, I tested the timing function of the mobile phone and it works. Later, I started tinkering with the serial port again, but in the end I found it was in vain, communication could not be established, I don't know why. The excuse I gave myself was that the development-free SDK mode seemed to be unable to communicate through the serial port. Anyway, that’s it. Attached is a simple test video. ~~~~

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-24 07:34:20

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号