张小哥

Intelligent control socket

 
Overview

1. Main component selection

  1. This design uses the current mainstream MCU STM32 as the main control chip;
  2. The WIFI module uses the Qingke EM3080 module. The reason for choosing it is: it is simple to use and has a short development cycle. It can be connected to the cloud with a few AT commands and directly connected to Alibaba Cloud;
  3. This design can control two relays at the same time. The relay specification is 5V, which can control the maximum 220V 10A on and off. The maximum power is less than 2200W, which can meet the needs of general household appliances;
  4. The temperature sensor uses the mainstream DS18B20 as the ambient temperature detection. You can check the average temperature and the highest and lowest temperature throughout the day through the APP.
  5. The OLED is driven by SSD1306, a 0.96' 7-pin OLED module. It is mainly used to display the networking status and relay switch status. Functions will be added later (time display, multi-level menu, setting relay timing switch, setting upper and lower temperature limit alarms to trigger the relay at the same time) work) under development. . .

2. PCB design

  1. Schematic part

image.png2.PCB partimage.pngimage.png

  • 3. Physical pictures

image.pngimage.pngimage.pngimage.png

  • 3. Program transplantation
  • Mainly modified in several places:
  • 1. The serial port uses USRAT1 and USRAT3, of which USRAT1 is used as the log printing interface, and USRAT3 interacts with the WIFI module for data;
  • 2. The timer uses TIME3, which is interrupted once every 1ms, as the time base for function loop work.
  • 3. OLED adopts hardware SPI driver mode, which detects the status of GPIO and can update the display in real time;
  • 4. Users can use three buttons, of which key1 can be long pressed to enter the network distribution mode, short press can turn on/off relay 1, key2 long press can restore the module to factory settings, short press can turn on/off relay 2, and key3 can be turned on at the same time. /Close both relays;
  • 5. The temperature is uploaded and the relay status is reported every 2 seconds.

image.png

  • APP interface design

image.pngimage.png

 





参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-20 00:37:03

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号