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.
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.
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.
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. |
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. **
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. . . .
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet