super_star

[Training Camp] Intelligent Curtain Control System

 
Overview

 

Internet of Things Intelligent Curtain Control System

Without further ado, here are the renderings:

curtains closed curtains open

 

 

The demonstration video is at the end, and the text begins next!

 

=============================================Text dividing line== ============================================

 

1. Project introduction

After 6 pm on the 19th         , I was watching the official account push as usual, but I just happened to catch up with the training camp news released by Lichuang EDA ! It also happened to be my favorite Internet of Things topic, so I quickly clicked in to check the details and sign up (because I didn’t catch up with the summer training camp, I didn’t know where to sign up at the time, but now I caught up hahh ), and then went to learn about Tuya Platform, I found that I can bind Xiao Ai (because I am a rice fan and have been exposed to some IoT platforms before. It is not particularly convenient to connect to Xiao Ai classmates. The ones that can be connected ... just don't achieve the desired effect. There are still many platforms that are not open to individual developers, so ... ) I started exploring Tuya with excitement ... Then I started thinking about what to do. After 2 days of observation, I found that no matter where I am at station B , , tb, and p Xixi have no smart curtain modifications. The products are hundreds or even thousands (the cheapest p Xixi is more than 200 ). To reinstall the electric track is not only high cost but also troublesome. But for DIY electronics enthusiasts, if they can modify their own curtains, wouldn’t it be a joy?  So I will use this opportunity to implement a smart curtain design in the simplest and crudest way and at the lowest cost! Thanks again to Lichuang EDA and Tuya Smart for providing learning opportunities ~

 

2. Implementation principle

        The principle of this project is very simple. First, I tied the curtains with nylon ropes, and used the seats on the wall to fix the curtains to form a loop, so that the two ropes could move with each other to open and close the curtains. Here is a simple diagram I drew:

gAYU4yvfxnjIxj8FKfiE7yBxC0Bb3uzRFQQ2I8yt.png pr8C7P5oiwTBLxTVHvh3sloOzbbH5BytyJ0kpFxp.png
When the curtain is closed, pull the green rope inward and release the blue rope outward to open the curtain. When the curtain is open, push the green rope outward and pull the blue rope inward to close the curtain.

 

3. Schematic analysis

3.1 Power supply

        As for the power supply, because the motor I chose is 12v, the power supply also needs a 12v input, which is convenient for connecting an adapter or battery. For the pressure reduction part, I used the simplest and crudest method AMS1117 ! If I directly reduce it to 3.3, I am worried that the LDO will consume too much power and cause serious heat, so I used a 5V buffer. I also used a small LDO for the Tuya module. When drawing the pcb, I also drew the wb3s into a module. The pins come out for easy play later!

NBhyVj9u1tavogO6mH65lXaENdYJbf0F1sfEI7ku.png

 

3.2 Peripherals

        There is an LED left on the motherboard to facilitate debugging and indication. The two low-power Hall models are FDH002BH used to detect whether the curtain has reached the limit position. A program download and debugging interface is reserved. As for the wireless module, I chose a transparent transmission module LC12S , which is very convenient. It can be configured to one-to-many or many-to-many. As long as it is configured once, there is no need to move it. It also greatly reduces the amount of code and shortens the development cycle.

tbQJYuJlUGupL7eKO3a1XpwcD0jFyuXM80Tf5SR4.png

3.3 Motor drive

        For the motor driver chip, I chose RZ7889 . Its operating voltage range is: 3-18V. The maximum continuous operating current is 4.2A.

Advantages: It has built-in MSOFET and some protection circuits. It does not require external circuits. It is directly controlled when power is turned on. It has built-in protection circuits and can be used directly according to the truth table in the manual. It is very convenient.

Disadvantage: It should be that the speed cannot be adjusted. I heard that the frequency is 1k, but this project does not require speed adjustment, so this chip is the most suitable!

HWKwY7Xuzfm7DTArj89S8ZxpnlB0We47tYS7s4I6.png

 

3.4 MCU

        Here, the main control of the motherboard and remote control is STM32F070F6P6 . Because this project is very simple, and I also like to play with 32, I chose the lower-cost STM32F0 series microcontroller, so this project is cost-effective for me. and difficulty level are controlled.

1zJz0mmk7ruCEENlJfVCAoHzgg3xBjAcrCbWiMDf.png

 

3.5 Tuya Smart Module

        The Tuya module I chose is WB3S. For this part of the circuit, I just took out the pins of the Tuya module and added an ldo for future use. I would also like to complain here. The Tuya platform is indeed more convenient and easy to use. The delay when controlled by mobile phone is also very small. I have used some IoT platforms before. Relatively speaking, Tuya is quite good. But I think the only regret is that I can't connect with Xiaoai classmates (you can, but you need to activate value-added services)...

yoCQkwvs5fhO7x4xDSsoxSltz87IXd4qCWa7UHPI.png

 

3.6 Remote control buttons

        The remote control has a total of 8 buttons, all of which have hardware debounce, which can also save most of the programs and reduce the burden of the program.

PlEFqGl1ha8o1aDE5aWEqyUhmpf7t0RzdOvMN6bG.png

 

3.7 Remote control charging circuit

        The charging circuit is designed with reference to the typical structure of typical lithium battery charging and discharging:

U4Oi3mioIh8rGUYefKIXcWvq4pLVxV1lBNxZnsSK.png

        As for the charging protection chip, I chose the commonly used TC4056A . This one is relatively simple and has many functions. It has all kinds of protection and temperature monitoring, but I didn’t use it here. The charging indicator light and the full indicator These two lamps are more practical. Adjust the maximum charging current to 1A through R9 in the picture. As for the battery, I happened to have a few 800mAh lithium batteries here, so I just used them. Then I used a SC662K low voltage dropout LDO to power the remote control. As for the charging interface,  I personally like to use type-c , mobile computers and DIY. Everything is like unity.

hoikcT1oW5eNmpKSw0fS9zy4tmZucufRHGdl9RBP.png

 

 

Charging status indication
The red light is on indicating charging Green light on indicates charging is complete

 

 

4. PCB design

LjfDXr5mJsPvmJOmUcXGjxsMjU54gfz78HV8Ne5W.png RBetwNnskAeHQBkUVDBWHJRZe4nxMGCJASRvJZww.png 7w9UJ47DS4bMhLoazS0SwUSc51j6U0N4WbvXC7dp.png 4aBHgQJ5EbmLIkUiaTsFUwdKsVwclVLA9FTOu7s7.png
Smart curtain motherboard PCB top layer Intelligent curtain mainboard PCB bottom layer Smart Curtain Main Board 3D Front 3D reverse side of smart curtain motherboard
6vMZ6hvjylBySQp6VqjivFxkAYMvjuogTMfIXxSs.png tdJ7GMnKlRQjpfizs9PFOH390HXMDv1DTR2FbgUb.png psqlTwa6yM2EWAa7oGOXvrSycmqlug7hTK690b6O.png ixkjym677qKXGZr02FuQNAaPGPnLrK5U6VFm71Ef.png
Smart curtain remote control PCB top layer Intelligent curtain remote control PCB bottom layer Smart curtain remote control 3D front view Smart curtain remote control 3D reverse side

 

 5. Physical construction

        The components were already in place, and coincidentally, the board and module arrived together on Sunday, so we started the road of welding and debugging:

FPs5K02M37c2zLJxMy6L1zyUe9VIhUrDVhtZRScO.png

        Below is the welding and debugging: board diagram

Lh5kJ6rQdbS83PeVOyKeglX4h4kKya4E1TeqKamh.jpeg
A photo of the motherboard and remote control✌
Motherboard front Reverse side of motherboard
lCL8OpoO8NR9a6eCDND4qupu5eX4N8vQbxCkF35S.jpeg L6mAHM7NU6B71QxNYNK03B2NEPT2tXCQqOpkTEhN.jpeg
Front of remote control The reverse side of the remote control

 

       Below is a reduction motor and nylon rope bought at tb:

jHD79AboyKya0ikFWIw2Tq2m54dKt58IOGbTmP2C.png
JGY-370 reduction motor, voltage 12v, 66 rpm Nylon rope is very cheap and very strong. 1mm thick , 30 meters long

In order to make the production convenient and fast, I used the simplest idea: I only used one of the simplest functions of the Tuya smart module, which is the socket, which only opens and closes. Then I used STM32 to detect the output level and control it automatically in the app control interface. Define it, and the socket becomes a curtain. (Because it is not open to individual developers, I can only use it this time. I don’t want to study in depth and use it in the future. I am still studying, interning, and busy at work. In fact, it is most important for rice fans and electronics enthusiasts. The reason should be that it does not support Xiao Ai ... ).

 

 6. STM32 code part

        Although what I want to do now is a smart curtain, this is just the beginning for my hobbies. I will continue my smart home DIY road ( there are some ESP8266 videos on my B site before, if you are interested Students can go and take a look ). The offline remote control also has 8 buttons, and functions can be added using programs in the future (it’s a pity that I haven’t added a casing to the work now, because I can’t draw yet, hahaha, but there will be in the future). So I made a protocol that is simple and easy to add later:

5bkXwHxOJdcV49YM8wAejxDBlgxaSdK3eY4DBPjy.png

 

As for the program, since I am also a beginner, I only have curtains now, so I wrote it very simply. Just post some key codes:

The following is the sending part of the smart curtain remote control :

1GrEceFtpN5c2sPPhZpTJqF4D621F9l9gVMqkZim.png

The following is the receiving program part of the smart curtain mainboard :

deRtCzLZ8FlNGiJCDPw6ItP7f1gzIgfVAPxvkXLL.png

 

 7. Some problems encountered during the process and their solutions

Generally speaking, there are no big problems, they are all caused by small details and temporary negligence. The main points are as follows:

        1. The SET pin of the LC12S of the wireless module is drawn incorrectly ( the schematic pcb has been modified ). During normal operation, the SET pin should be pulled high or floating (due to negligence, I did not read the official manual carefully, and there is a typical circuit drawn on it. The SET pin is grounded, so I copied it without thinking... Solution: After the board arrives, configure the module and cut a wire ).

        2. The silk screen printing of the debugging interface of the remote control is reversed ( the schematic PCB has been modified )

        3. The signal in the Hall circuit is not pulled up, and sometimes it triggers itself, which is unstable. Solution: Internal program pull-up or hardware pull-up , I chose program pull-up.

 

8. Tuya APP panel display

Below is the panel I customized. Although the icons I found online are relatively simple, they are clear, intuitive, and practical even the elderly can understand!


This is the homepage -----you can see the smart devices under the current account

This is the control page----the icon shows that the current curtains are open

This is the control page ----the icon shows that the current curtains are closed

 

 

9. Demonstration video

++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++

+ Welcome to jump to watch the finished product demonstration video of this work~~ +

+ +

+ Video address: https://www.bilibili.com/video/BV1qK411V7PN                       +

+ +

+ Okay, the project is over here, goodbye everyone! + +++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++

 

---END---

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2024-11-22 19:03:25

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

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号