王达业

DIY_[Training Camp] Lichuang EDA Graffiti Smart Transformation Bedside Night Lamp-531281A

 
Overview

Power supply section

  1. The interface uses typye-c, a 500mA self-restoring fuse, 50mA when the light is off, and the total power consumption is more than 400mA when the light is on.
  2. Because the peak power consumption of wb3s is 100mA, use DC-DC, 5V-3.3V as the power supply.
  3.  The MCU and temperature and humidity sensors use another set of LDOs as power supplies.

power.pngWeChat screenshot_20201206161535.pngWeChat screenshot_20201206161523.png

MCU part

An STM32F103 microcontroller is used, with debugging LEDs and debugging serial ports reserved.

mcu.png

WIFI module

  1. Tuya's WB3S, MCU general firmware, note: the PCB is hollowed out at the antenna.
  2. J3 frame skipping can be disconnected. When using Tuya's serial port debugging assistant, you can simulate the module to debug the MCU, and you can also simulate the MCU to debug the module. Tuya's debugging assistant is really convenient to use.
  3. Tuya MCU SDK development process. https://www.tuya.com/cn/product/iot/MCU-Low-code-Development

QQ screenshot 20201206155104.pngWeChat screenshot_20201206155805.png


Light source circuit

  1. Using WS2812 as a light source, colored light display can be achieved.
  2. The 74ahct AND gate of U7 is used for logic level conversion from 3.3V to 5V. The Vhin of WS2812 is 0.7Vcc=3.5V.
  3. I originally wanted to use a triode to implement it, but after some simulation, the speed was not enough to reach the 100ns speed of ws2812, so I simply used a 74hct series circuit.

QQ screenshot 20201206155211.pngWeChat screenshot_20201206155347.png3.3v-5v.jpg


Temperature and humidity sensor

  1. I2C protocol, pay attention to the pull-up resistor.
  2. Grooves are made when drawing the board to reduce temperature transfer to other devices.

WeChat screenshot_20201206155635.png


Software debugging

  1. The framework uses st's mxcbue and free-rtos.
  2. Tuya's MCU_SDK porting is really convenient. I just watched the video and finished it in one, two, three, four, five, more than half an hour.
  3. [Link to Tuya IoT development platform] https://auth.tuya.com/?from=https://www.tuya.com/cn/&_source=cbc30f99f7a6c4aebca6755c2fab437f (contains detailed development documents)
  4. The ws2812 driver uses spi+dma mode.
  5. The code is hosted on github and will continue to be debugged at https://github.com/potatozerogo/lcedty_night_lamp.git

Design needs improvement

  1. Since the original night light lampshade is yellow and the color effect is not good, only white light is used.
  2. When the APP uses palette dimming, the MCU will get stuck. It should be a UART communication problem. I don't know whether it is Tuya's SDK or the hal library. I haven't located the problem yet.
  3. The hardware also reserves an acceleration sensor to identify different slap light effects. The function has not yet been implemented, and debugging will continue later.

WeChat picture_20201206165628.jpg

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-23 20:28:51

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号