2021-09-09 13:13:37 索炜达电子 919
项目编号:E933
文件大小:508K
源码说明:带中文注释
开发环境:C编译器
简要概述:
通过WiFi远程控制插座的开与关,可远程操控插座的开启与关闭。
a.采用0.96英寸OLED显示屏显示插座状态信息与WiFi信息。
b.通讯模块采用ESP8266WiFi模块。
c.主控模块采用STM32F103C8T6核心板。
d.执行模块采用单路光耦继电器。
核心板使用串口与ESP8266进行通信,接收WiFi模块回传的指令,从而控制继电器的开与关。ESP8266使用AT固件,在初始化时配置成AP兼Station模式,使用TCP协议模拟成TCP服务端。PC端盖通过链接WiFi模块生成的热点,使用网络调试助手即可与WiFi模块通信。STM32核心板通过串口与WiFi模块通信,并通过串口初始化WiFi模块与接收指令。再对串口接收到的数据进行判断,控制IO口的电平从而起到对继电器的控制。
程序流程图
制作出来的实物图如下:
目录│文件列表:
└ WiFi智能插座
├ Libraries
│ ├ CMSIS
│ │ │ core_cm3.c
│ │ │ core_cm3.h
│ │ │ stm32f10x.h
│ │ │ system_stm32f10x.c
│ │ │ system_stm32f10x.h
│ │ └ startup
│ │ │ startup_stm32f10x_cl.s
│ │ │ startup_stm32f10x_hd.s
│ │ │ startup_stm32f10x_hd_vl.s
│ │ │ startup_stm32f10x_ld.s
│ │ │ startup_stm32f10x_ld_vl.s
│ │ │ startup_stm32f10x_md.s
│ │ │ startup_stm32f10x_md_vl.s
│ │ └ startup_stm32f10x_xl.s
│ └ FWlib
│ ├ inc
│ │ │ misc.h
│ │ │ stm32f10x_adc.h
│ │ │ stm32f10x_bkp.h
│ │ │ stm32f10x_can.h
│ │ │ stm32f10x_cec.h
│ │ │ stm32f10x_crc.h
│ │ │ stm32f10x_dac.h
│ │ │ stm32f10x_dbgmcu.h
│ │ │ stm32f10x_dma.h
│ │ │ stm32f10x_exti.h
│ │ │ stm32f10x_flash.h
│ │ │ stm32f10x_fsmc.h
│ │ │ stm32f10x_gpio.h
│ │ │ stm32f10x_i2c.h
│ │ │ stm32f10x_iwdg.h
│ │ │ stm32f10x_pwr.h
│ │ │ stm32f10x_rcc.h
│ │ │ stm32f10x_rtc.h
│ │ │ stm32f10x_sdio.h
│ │ │ stm32f10x_spi.h
│ │ │ stm32f10x_tim.h
│ │ │ stm32f10x_usart.h
│ │ └ stm32f10x_wwdg.h
│ └ src
│ │ misc.c
│ │ stm32f10x_adc.c
│ │ stm32f10x_bkp.c
│ │ stm32f10x_can.c
│ │ stm32f10x_cec.c
│ │ stm32f10x_crc.c
│ │ stm32f10x_dac.c
│ │ stm32f10x_dbgmcu.c
│ │ stm32f10x_dma.c
│ │ stm32f10x_exti.c
│ │ stm32f10x_flash.c
│ │ stm32f10x_fsmc.c
│ │ stm32f10x_gpio.c
│ │ stm32f10x_i2c.c
│ │ stm32f10x_iwdg.c
│ │ stm32f10x_pwr.c
│ │ stm32f10x_rcc.c
│ │ stm32f10x_rtc.c
│ │ stm32f10x_sdio.c
│ │ stm32f10x_spi.c
│ │ stm32f10x_tim.c
│ │ stm32f10x_usart.c
│ └ stm32f10x_wwdg.c
├ Output
│ │ bsp_led._2i
│ │ bsp_usart._2i
│ │ core_cm3._2i
│ │ misc._2i
│ │ oled._2i
│ │ stm32f10x_adc._2i
│ │ stm32f10x_bkp._2i
│ │ stm32f10x_can._2i
│ │ stm32f10x_cec._2i
│ │ stm32f10x_crc._2i
│ │ stm32f10x_dac._2i
│ │ stm32f10x_dbgmcu._2i
│ │ stm32f10x_dma._2i
│ │ stm32f10x_exti._2i
│ │ stm32f10x_flash._2i
│ │ stm32f10x_fsmc._2i
│ │ stm32f10x_gpio._2i
│ │ stm32f10x_i2c._2i
│ │ stm32f10x_iwdg._2i
│ │ stm32f10x_pwr._2i
│ │ stm32f10x_rcc._2i
│ │ stm32f10x_rtc._2i
│ │ stm32f10x_sdio._2i
│ │ stm32f10x_spi._2i
│ │ stm32f10x_tim._2i
│ │ stm32f10x_usart._2i
│ │ stm32f10x_wwdg._2i
│ │ system_stm32f10x._2i
│ │ USART.fed
│ │ USART.hex
│ │ USART.l2p
│ └ WiFi_KEY.hex
├ Project
│ └ RVMDK(uv5)
│ │ BH-F103.uvguix.86158
│ │ BH-F103.uvguix.XieSenshi
│ │ BH-F103.uvoptx
│ │ BH-F103.uvprojx
│ │ EventRecorderStub.scvd
│ ├ .vscode
│ │ │ c_cpp_properties.json
│ │ │ keil-assistant.log
│ │ └ uv4.log.lock
│ └ DebugConfig
│ │ USART_STM32F103C8_1.0.0.dbgconf
│ │ USART_STM32F103VE_1.0.0.dbgconf
│ │ WiFi_KEY_STM32F103C8_1.0.0.dbgconf
│ └ WiFi_KEY_STM32F103ZE_1.0.0.dbgconf
├ SYSTEM
│ ├ delay
│ │ │ delay.c
│ │ └ delay.h
│ ├ sys
│ │ │ sys.c
│ │ └ sys.h
│ └ usart
│ │ usart.c
│ └ usart.h
└ User
│ main.c
│ stm32f10x_conf.h
│ stm32f10x_it.c
│ stm32f10x_it.h
├ ESP8266
│ │ ESP8266.c
│ └ ESP8266.h
├ led
│ │ bsp_led.c
│ └ bsp_led.h
├ OLED
│ │ bmp.h
│ │ codetab.h
│ │ oled.c
│ └ oled.h
└ usart
│ bsp_usart.c
└ bsp_usart.h