Thanks:
1. The entire training camp lasted about 2 months. I was a novice when I entered the camp. I didn’t understand anything about C language or how to use KEIL. During this period, I received a lot of guidance from Gong Wu and Gong Tang of Jiali Chuang, especially Gong Tang, who often gave guiding and directional suggestions on key points. I would like to express my sincere gratitude!
2. Secondly, I would like to thank my classmate "the bad classmate who leads the class", who often helps me discuss processes and control methods. Cousin, I couldn't complete my homework without you!
3. Because this is a work by a novice, seniors and experts will show mercy, thank you very much! ! !
Update:
1. Bug: SCL and SDA of OLED are reversed, if necessary, jumpers are required. Two resistor positions are reserved during the design, which can be soldered as shown below. If there is time later, it will be changed!

Functional indicators and parameters:
1. Using 3D-MEMS sensor technology, it is converted into angle values through calculation and pushed to OLED, with threshold alarm display function. Analog and digital output functions will be added later.
2. Using high-precision MEAS acceleration template, it has high reliability, strong stability, low power consumption, simulation angle error of 0.02°, and simulation resolution can reach 0.0025°. (Explain here, the reason why the OLED display minimum value is not so low is because of chaos. The jump will affect the reading, so the minimum value of the angle is limited to 1 degree. The figure below shows the value of serial communication).

3. Module appreciation.



4. Functional block diagram
1. Introduction to the functions of each module
1.
In order to improve the battery life without connecting to the power supply, the main control uses a Langsan development board with a main frequency of 200MHZ and rich interfaces.


2.3D-MEMS acceleration sensor
SCA100T-D02 has weak temperature dependence, high resolution, low noise and sound sensor original design. This chip is not sensitive to high vibration (above 50HZ), measurement range: ±90°, analog resolution: 0.0025°, and can withstand 20000G high impact.
3. The power deception module
uses the FS312 fast charging protocol intelligent trigger chip, which is compatible with the TYPE-C3.0 (including PPS) protocol and the USB TYPEA port fast charging protocol. Can deceive 5V, 9V, 12V, 15V, 20V, can automatically identify, automatically shake hands to complete the voltage application

4.0.96-inch OLED screen

5. Speaker
drive mode: active (includes drive circuit) Structure type: electromagnetic rated voltage : 3V Working voltage: 1.5V~4V Frequency: 2300Hz Sound pressure (SPL): 85dB@3V, 10cm Diameter (φD): 12mm Height: 9.8mm Diameter φ12*9.5mm 3V 3.3V electromagnetic active integrated buzzer electromagnetic Buzzer active buzzer diameter φ12*9.5mm
6. The other
4 buttons, 2 LDOs, a PMOS to prevent reverse connection, and a PNP transistor to drive the speaker.
2. Hardware part
1. The power supply
channel 1 uses TYPE-C to trick 9V

and the other channel is powered through the terminal block. Because it is a terminal, the anti-reverse connection function is added. At the same time, the power indicator light is also in this circuit.

The third channel is powered through the development board pin header.
Warning: Only one of the three channels can be selected for power supply. It is not recommended to use multiple channels at the same time.
2. The SCA100T-D100 circuit
uses SPI for data transmission. The AD output port is reserved here to facilitate later upgrade testing.

The 3.0.96-inch OLED circuit
screen uses I2C power supply.

4. Alarm circuit

5.5V 3.3V generating circuit
uses LDO for voltage stabilization and filtering, with a ripple suppression ratio of 60DB

. 6. Button circuit
The buttons mainly perform operations such as addition and subtraction on the setting interface .
3. Software part
Simple software flow chart:

because of the SPI and I2C parts The function is extremely long, and readers’ eyes will probably be tired, so I won’t show it here. I will upload it after annotating it later.
The main function functions are introduced below, specifically as follows:
Determine whether to measure or set the function.

The alarm function part

obtains the sensor output digital value and the processing function

setting interface function.

The measurement interface function

key scan function (for alarm).

The alarm setting part increases and decreases the alarm value function. :

4. Functional video