Summary of "Internship Notes" smart Plaza Fitness Equipment

Source: Internet
Author: User

The experience of the internship phase is the most beautiful experience of the university stage.

Device content: The design of a walking machine will be the user's motion steps and the number of heartbeats collected, so that after sending to the host, the host will upload data to the server side, the server will send user data to the user's mobile phone app

Users can and will share data and friends and can later and the supermarket to establish cooperation, when the number of steps to reach a specified time, for example, such as laundry detergent products.

The internship is mainly responsible for the movement of steps and heartbeat collection, and data upload, including from the computer display interface design.

Main control chip: Stm32f103vet6

Acquisition of the number of moving steps:

The motion step sensor uses Hall sensor, installs a magnet on the rocker arm of the walking machine, then installs two hall sensors before and after the fixed rod of the walk machine, counting method is the user movement is counted as one step back and forth.

Design of Hall Sensor module:

Hall Sensor selection: SS495A1

The SS495A1 is a high precision linear output hall element. The characteristics of the component is: the internal temperature compensation circuit and by the laser resistance correction, so that the 0-point drift to ±0. 04%/℃, the sensitivity drift is +0. 02.

The output of the SS495A1 is directly connected to the 74HC14 Schmitt trigger, and the output becomes two value, so the data is easy to detect.

The program uses external interrupt for data capture, Hall sensor output line pull, output line trigger interrupt mode selection falling edge trigger, total divided into two sensors, so each sensor corresponds to an interrupt,

The incoming interrupt will capture the success flag position 1, the current after the two interrupt flag bit is 1 o'clock, will count the variable plus 1, with this reciprocating technology, variable type 32-bit shaping data, sufficient.

Heartbeat collection:

Because of the heartbeat collection method is not very familiar with the Heartbeat collection module bought off-the-shelf module, the general principle is this, through the metal electrode on the handle to obtain the heart of the human palm ECG signal, and then after the amplification filter and other signals conditioning, extract R wave and shaping output, Finally, the heart rate signal is converted into a square wave signal that can be measured directly by the microcontroller.

One of the main problems of heartbeat acquisition is how to filter out the interference signal through the software, finally through the exchange with the module buyers learned that the interference is mainly a spike signal, in order to better filter out interference, the time interval between two crest signals is less than 250ms can be judged as interference signal, filter can be. Then multiply the correct acquisition signal by the countdown by 60 is the resulting heart rate data.

The above is the work of the core of the two work, the implementation of the two functions of the basic function is completed, the streamlining process is to solve how to communicate with the host problem.

Communication with the host, in order to ensure that the correct communication protocol is necessary, this is the first time I have a formal agreement with other people to share a set of agreements, before the agreement is their own definition, anyway, I can understand it. This is a very formal protocol that contains the necessary two-byte frame header, heartbeat packet, function code, data bits plus data code, CRC checksum.

First is the first power on, answer the host's mass call signal, confirm the online, and the unique identification code of its own device sent to the host, convenient host notes equipment, where the unique identification code of its own device is the STM32 Factory identification code 12 bytes, the identification code read out, it can be used as the device's unique identification code, No need to code yourself.

Then the host issued a two-dimensional code, and network time, from the machine is responsible for the two-dimensional code display, the network time and its own time to compare, everything to network time, reset the next DS1302 clock chip. Received from the answering host after receiving data from the machine.

After the user scanned the QR code, the main opportunity issued to start work instructions, from the machine to work instructions, the interface switch to the Count display interface, at the same time to start the step count and heartbeat statistics, while the user's two data is no longer updated, in the 30S outside, think the user offline, while closing statistics, Upload data to the host, the interface switch to the final count results interface, the host receives data, issued a response instruction, and with a new QR code, received the host's answer command, the parameters clear 0 and the new QR code display, to complete the work flow, after the repeated repetition of the above functions.

Heartbeat mechanism:

The heartbeat mechanism, the heartbeat mechanism, is the only way for both sides to confirm each other online during the period of communication.

Re-answer mechanism:

For example: the host issued a work order, from the machine did not respond in a timely manner, the main opportunity to repeatedly send several times, if not received the answer, but the heartbeat exists, the default system fails.

Summary of "Internship Notes" smart Plaza Fitness Equipment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.