toothache

Small IoT system based on STM32F103C8T6+ESP8266

 
Overview

I. Overview

The three main modules used in this system are: STM32F103C8T6 main control chip, ESP8266Wifi module, and 0.96-inch OLED screen module; the auxiliary modules include serial port download module, temperature sensor, photosensitive sensor module, button module, and LED module.

2. Technical Analysis (Main Module)

(1)STM32F103C8T6

The STM32F103C8T6 chip has 48 pins and supports 3 serial ports, 3 16-bit timers, 2 SPIs, 2 IICs, USB, CAN bus, 1 PWM, and 2 ADCs.

The modules selected for this design are ESP8266WIFI module (serial port), OLED screen (SPI), DS18B20 temperature sensor (ADC), photosensitive sensor (ADC), etc., and if cost is considered, the STM32F103C8T6 chip can satisfy this design.

(2) ESP8266 WIFI (AT command set)

The ESP8266 module uses a serial port (LVTTL) to communicate with the microcontroller (or other serial device), and has a built-in TCP/IP protocol stack, which can realize conversion between the serial port and WIFI. Through the ESP8266 module, traditional serial device only requires simple serial port configuration, that is You can transmit your own data through the network (WIFI). The ESP8266 module supports LVTTL serial port. The module supports the modes of serial port to WIFI STA, serial port to AP and WIFI STA+WIFI AP. It builds a serial port-WIFI data transmission solution to facilitate the device to use the Internet to transmit data. .

The ESP8266 module supports three working modes: STA/AP/STA+AP.

 STA mode: To put it simply, when we usually use mobile phones to connect to hotspots or routers, we use STA client mode.

 AP mode: The ESP8266 module acts as a hotspot and acts as a router, so that the electronic devices we usually use, such as mobile phones and tablets, can connect to it.

 STA+AP mode: As the name suggests, it has the characteristics of the above two modes at the same time.

Four types of AT instruction sets
type Command format describe
test instructions AT+=? This command is used to query the parameters and value range of the setting command.
Query command AT+? This command is used to return the current value of the parameter
Setup instructions AT+=<…> This command is used to set user-defined parameter values
Execute instructions AT+ This command is used to execute functions with variable parameters and immutable functions controlled by the internal program of the module.

(3) 0.96-inch OLED (using SPI communication)

OLED stands for Organic Light Emitting Diode. OLED is self-luminous and has excellent characteristics such as no backlight, high contrast, thin thickness, wide viewing angle, fast response, can be used in flexible panels, wide operating temperature range, simple structure and process, etc. It is considered to be the next generation Emerging application technologies of flat panel displays[5]. In my graduation project, I chose a 0.96-inch OLED display from Zhongjingyuan Electronics. This screen has the following characteristics:

① 0.96-inch OLED is available in three colors: yellow, blue, white, and blue;

② The resolution is 128*64

③ Multiple interface methods; The total interfaces of OLED bare screen include: 6800 and 8080 two parallel interface methods, 3-wire or 4-wire serial SPI interface method, and IIC interface method.

④ OLED screen has developed Demo boards with two interfaces. The interfaces are seven-pin SPI/IIC compatible module and four-pin IIC module.

 Mode 1:

When the polarity CPOL is 0, the clock line is in a low level state before and after data transmission is completed, which means that the idle level is low level. When phase CPHA is 0, the read data is on the first clock edge (rising edge), and the output data is on the second clock edge (falling edge).

 Mode 2:

When the polarity CPOL is 1, the clock line is high before and after data transmission is completed, that is to say, the idle level is high. When phase CPHA is 1, the read data is on the second clock edge (rising edge), and the output data is on the first clock edge (falling edge).

 Mode 3:

When the polarity CPOL is 0, the clock line is in a low level state before and after data transmission is completed, which means that the idle level is low level. When phase CPHA is 1, the read data is on the second clock edge (falling edge), and the output data is on the first clock edge (rising edge).

 Mode 4:

When the polarity CPOL is 1, the clock line is high before and after data transmission is completed, that is to say, the idle level is high. When phase CPHA is 0, the read data is on the first clock edge (falling edge), and the output data is on the second clock edge (rising edge).


** Just select a mode according to the manual on the screen. **

3. Brief design ideas

Using STM32 as the main control, it mainly controls the hardware peripherals on the development board. In addition, the main control communicates with the wifi module. The esp8266 is set to transparent transmission mode and serves as the local client. Tencent Cloud and other servers are used as the server to build Simple tcp/ip communication, communicating in the form of strings. . . .

This article is relatively simple to write. If you are interested, you can chat privately, thank you!
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-11 11:53:56

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号