Update: The crystal oscillator needs to be soldered, 8M active
Author's blog homepage: https://blog.csdn.net/weixin_44578655
This document and related materials are the work of the blogger participating in the 2020 TI Cup College Student Electronic Design Competition. Related blog: https://blog.csdn.net/weixin_44578655/article/details/109020022
Data link (Baidu Netdisk): Link: https://pan.baidu.com/s/1WnXZ1bDB-cs1LRwfiP6rYg
Extraction code: iqek Physical picture:
Contents of open source data compression package:
The PCB was drawn using EasyEDA. The AD files in the folder were exported from EasyEDA. There may be some problems with the borders and characters after exporting.
It is recommended to use Lichuang EDA! Because when editing the document, the Lichuang EDA project has not yet been released: You can check my LCEDA open source homepage later: https://oshwhub.com/doee
The three parts of the board are connected through jumper caps and used as one, or they can be separated and used separately.
The crystal oscillator of the microcontroller uses an 8M active crystal oscillator.
I enlarged the soldering pad of LMT70 to make it easier to solder, but I don’t know if it will be affected if the temperature measuring hand touches the soldering pad.
In order to make the component layout more compact, no component character labels are left.
The server-side compilation environment is VS2019, and the language is C#. If this is your first contact with PC writing, I would like to recommend a basic introductory PC design tutorial: https://www.cnblogs.com/liaocheng/p/9144317.html
The compressed package of the server-side project contains multiple projects:
The final version used is the version pointed by the arrow in the picture above.
In the directory in the picture above, there is an exe file generated by the project, which can be run directly.
Due to time constraints, this version is not perfect. When switching between wifi and Bluetooth modes, you need to turn it off and on again.
The default baud rate of the serial port mapped by Bluetooth is 115200. How to change the parameters of the Bluetooth virtual serial port under Windows. For details, see:
https://blog.csdn.net/px_528/article/details/70782059 The IP address in TCP mode needs to be changed in the source code, so if you do not plan to refer to the source code, this server-side software cannot be used directly (game time Nervous, many details cannot be perfected)
I try my best to annotate the source code on the device side and make the code structure as clear as possible, so that I can feel free to sort it out after the competition.
Device-side source code document structure
This is written in the report. To be a bit more sophisticated, it is called "task". Don't be misled, it is not multi-tasking!
All modules of the system run in the large loop of the main function, and the timing loop operation of each module is realized through software timing. Software timing method, taking key scanning as an example:
if(sys_tick - key_tick >= 10) { key_tick = sys_tick; //Key scanning, processing, etc. }
Among them, sys_tick is a global variable that will increase by 1 every 1ms (accurately counted through the 1ms timer interrupt), which is used for system operation timing (generally called the system time base). It can facilitate software timing. The effect achieved by the above code is that the if judgment is established once every 10ms. If placed in a large loop, the 10ms timing can be achieved. Scanning every 10ms can eliminate the need for button debounce and reduce system operating overhead. The work of each module basically adopts this method to implement software timing execution, which is convenient for setting the timing period.
Connection line sequence VIN---3.3V~5V 3V3---3.3V GND---GND DRDY---PA8 CS---PB12 CLK---PB13 DOUT---PB14 SDIN---PB15
The "3V3" pin specifically supplies power to the digital part of the ADS1292 module to reduce interference to the analog part. Two options are available:
The position of the ECG electrode patch. If you purchase a lead wire like the one shown below:
According to the color, connect as shown below, and the measured ECG waveform will be correct.
For the gyroscope module, I use a less popular module. This application only uses the pitch axis, so an ordinary MPU6050 can be used.
The gyroscope module is strapped to the leg to measure steps. Please refer to the design report for details.
Bluetooth module uses HC05
Since the system initially used a Bluetooth host computer, the Bluetooth data sending part was retained in the project.
The supporting Bluetooth debugging host computer is:
It is a very easy-to-use PC. You can search it in the application market. The interface controls can be developed twice. In this competition, many groups doing question A directly used this PC. It can be said that the author of this APP Saved a large number of people participating in e-sports.
LMT70 can be powered through the IO port, which is recommended by the manual. Using the 12-bit ADC that comes with stm32, the data is quite stable after adding mean filtering.
The specific model of the module is esp8266-01s. The initialization part mainly uses AT commands to configure wifi and servers.
The esp8266 was modified later. Since there was no interface left on the board, the Bluetooth interface could only be used. The power supply voltages of the two modules are not the same (Bluetooth: 3.6-6, esp8266: 3.3V), so a hole was added. Hole adapter board, there is a voltage stabilizing module on the board (AMS1117 cannot be used, because the system power supply is lithium battery 3.7-4.2V, and 1117 requires a relatively large voltage difference, so a low voltage difference LDO must be used to output 3.3V normally, which is used here is TPS73233DBVR)
Link:
https://item.taobao.com/item.htm?spm=a1z10.5-cs.w4002-22419023648.11.103e497cFxRZgy&id=526022333035
Select "old model without chip select CS"
This SPI-driven LCD refresh speed is okay, at least the real-time display of ECG waveforms is satisfactory.
The store provides the source code of the stm32 part. When designing the PCB, it is also based on the pin definitions in the screen routine (using hardware SPI).
The shell is drawn using solidworks, material: acrylic, copper pillar, equipment: engraving machine, hand. I was pressed for time on the last day, so I drew the wrong mounting holes for the screen, but I still managed to install it.
We took a whole day to write the design report, which truly reflected the content of the work. The relevant plans in the report were also the actual ones adopted.
The word version of the design report includes the theoretical calculation part of the Fir filter (the PDF version is the final submitted version without this part). My teammates wrote the theoretical analysis very seriously, but because it ended up exceeding the number of pages, I cut it before submission.
ADS1292R: about 30rmb per piece stm32f103c8t6: 10rmb
LMT70: 10 (not easy to weld)(Don’t use this thing if you make it yourself, you can replace it with NTC) Other components <30rmb Screen: plus postage 46 Lithium battery + charging module, etc.: < 15rmb (3.7V small battery will do) Bluetooth/WIFI module: <15rmb Gyro Instrument module: If you use MPU6050, you can buy it for 5 RMB. Lead wire: 30 RMB plus postage. ECG electrodes: 20. The total cost is about 200 RMB. Compared with the independent ECG module of Aubao that often costs 300+ during the electric competition, it is really wise.
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