eBWw6mRfE

[Tuya Smart] Tuya Sandwich-LGT328P smart window opener

 
Overview

This article is allowed to be reprinted and used by Tuya Smart

 

This is a work designed to participate in the Tuya Smart Pet Feeder Practical Camp. For this event, Tuya provided a sandwich development board for rapid prototype development. After more than a month of testing and experimentation, the overall test of the mechanical transmission part passed, and the code has basically completed its functions. , so this project currently only has the code open source part and the mechanical design part, and the PCB picture is an acrylic engraving picture!

Later, the schematic and PCB drawing, board layout, testing, and code optimization will be completed. Continuously updating...

 

The project is currently running smoothly. There is still room for improvement in the mechanical and transmission parts. Continue testing.

 

First generation design demonstration address: https://www.bilibili.com/video/BV1SK4y127b4

The latest second generation demonstration: https://www.bilibili.com/video/BV1mK411w7ey/

 

Project origin

The opening and closing of the windows at home is indeed a pain point. You must open the windows for ventilation before going out in the morning. If it rains during work, you will really feel uneasy until you get off work. I also noticed that smart horizontal window openers have appeared on the Internet, but 1.5 meters basically costs more than 300 yuan, and they all use direct plug-in power supplies. There is no such window power supply reserved at home, so it is extremely inconvenient to modify! I had the idea of ​​DIYing a smart window opener early on. Tuya’s pet feeder event happened to use a motor driver board, so I gave it a try!

overall structure

1) The customized acrylic base plate is fixedly connected to the window frame with screws. Later, we will consider using a customized aluminum alloy frame to make it lighter and stronger.

2) The JGY370 reduction motor + bracket is fixed on the acrylic base plate.

3) Tuya sandwich motherboard and motor board are fixed on the acrylic base plate.

4) Temporarily use the mobile power supply as a power source to power the motherboard and motor.

5) The JGY370 reduction motor is connected to the rails with a steel wire rope, which is low cost and the steel wire rope is relatively tight.

6) The slider is softly connected with the window to be opened and closed using a screw, so that after the window is closed, it can be manually moved in a short distance to realize the detection of manual window opening!

7) After the subsequent prototype is successful, consider using EDA to draw the circuit board to realize power supply from two 18650 or 26650 batteries and add a charging circuit!

feature design

1) Mobile phone and voice control to open and close windows to achieve window opening percentage control. This is accomplished by Tuya Wifi module and Tuya APP. It has been implemented in the MCU code!

2) Implement the logic of manual window opening: a small magnet is fixed on the window, and the MCU connects two reed switches to detect the operating position of the window. Once the state of the reed switch changes in the open or closed state, it is considered that there is a manual opening or closing of the window. Action, the motor starts to open/close the window.

3) Turn on the Tuya weather information synchronization service to realize opening and closing windows according to the weather forecast. If it rains, the windows will not be opened. When the air quality is forecast to be good, the windows will be opened automatically for ventilation;

4) Connect to the 433 wireless receiver to realize the window opening and closing function of the ordinary 433 remote control;

5) To be continued: After the main function is realized, because the MCU has many ports, the spare ports are used to connect to the other two windows and curtains. Maximize the functions of the MCU+Tuya module and control three window motors and one curtain motor at the same time!

6) I just mentioned the automatic closing of windows when it rains, and I saw that the project of DIY a raindrop detection sensor is on the agenda;

development materials

Tuya Sandwich Development Board: Voice Communication Module Board + Power Board + H-Bridge Motor Driver Board

LGT328P Nano development board (a domestic MCU development board that is compatible with the ATmega328P Arduino Nano development board. The price is only about 5 yuan. It is a proud domestic product! Development with Arduino IDE goes smoothly and there are basically no pitfalls!)

JGY370 reduction motor (I bought a 12V 10-turn one, but it seems too slow at the moment. I will purchase a 40-turn one for debugging in the future!)

The curtain track costs about 10 yuan per meter from a certain store, and all the accessories are included. My window only used 0.75 meters! You can ask the store to cut off the shipment!

Pulleys, screws, some acrylic accessories!

 

The following are pictures of the development process:

1. Paper mold making and track production (the track cost is about 15 yuan per meter, I only used 75CM)

2. Make holes for the track and install the pulleys (I am a bit ugly because I am handicapped!!) The cost of the pulleys is about 1 yuan plus postage.


 

The cost of the motor is about 25 yuan. The 370 motor is too slow at 10 rpm. After the mechanical test is normal, it will be replaced with a 90 rpm motor!

 

3. According to the PCB diagram, laser-engraved acrylic (the round one requires three pieces to assemble, and the long strip connection for the bottom track requires two pieces, and it is engraved again later!!)

4.Track installation

 

5. Track and window connection

6. My hot-bent acrylic frame is really unbearable and one side is broken. Let’s make do with it. I still need to find a solution for the latter part.

 

7. The protagonist enters: Tuya Sandwich development board family portrait, left: DC power board, middle: H-bridge motor board, right: voice communication board

Connect the motor to the H-bridge motor board

8. The second protagonist, LGT328P development board, compatible with Arduino, costs about 5 yuan

MCU and sensor family portrait, left: light sensor, right: 433 receiving module

 

Connection, the 433 module uses the D2 pin of the development board, and the light sensor uses I2C, A4, and A5 pins

9. Development configuration using Arduino IDE

10. Use Tuya debugging assistant to test the SDK transplantation and OK!

11.MCU and voice communication board online test OK

12. Go to the window, install and debug

 

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-07-17 12:31:55

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号