1 System Design
In order to make the system more streamlined, economical and practical, the 4-bit OKIMCU ML63189B is used. The SCP1000-D11 sensor is used as a slave to communicate with the MCU's I/O through the I2C interface. Clock timing, stopwatch, alarm and backlight display functions are added. Human-computer interaction is achieved through 5-key button operation and corresponding software.
2 System Hardware Design
The system includes MCU basic functions, key operation, backlight drive display, alarm and sound function, height, temperature and clock LCD display, SCP1000-D11 pressure sensor and MCU interface module. OKIML63189B has 4 bit, 32 kB Word ROM, 1.5 kB Word RAM/64×16 bit LCD ICONS. MCU high-speed clock selects external precision resistor 100 kΩ to ensure pressure data processing and communication needs. The key is externally connected to VDD, and the MCU interface is the external interrupt function pin PB. 3, PO port, with a pull-down resistor inside. When the key is pressed, it is triggered by the rising edge. The alarm driver is connected to the MCU 91PIN MD pin, and the buzzer chip is driven by a BC847BW NPN transistor. SCP1000-D11 has a total of 16 pins, 7 I/O pins and 9 power pins. Its wiring is shown in Figure 2. It is powered by a single power supply. TRIG is an external trigger for low power mode. In the design, this pin is connected to DVSS. DRDY is an output interrupt signal to remind the user that the temperature and pressure values have been measured and can be read. When the PD pin is high, SCP1000-D11 can maintain low power mode for a long time. DRDY-PIN and PD are connected to PB. 0 and P9.0 respectively. SCK, SDA, MISO and CSB pins form the data communication line. This MCU has no dedicated I2C interface I/O. Its PA. 0 and PA. 1 are used as SCL, SDA and pressure sensor communication lines. Because SDA is an OPEN-DRAIN output, its line is connected to a pull-up resistor of 10 kΩ. MISO-PIN is open circuit and CSB-PIN is connected to VDD.
[page]
Figure 3 shows the EL (backlight) driving circuit, which uses the SP4403MSOP-8 package. The inductance and capacitance in the circuit diagram can be adjusted according to the size of the EL (backlight) to achieve a balance between power consumption and brightness. The MCU I/O P9.0 controls a switch tube to turn on the positive power supply when needed, and generally keeps it on for about 3 seconds to save power.
3 System software design
The overall software design uses assembly and high-level C language. It includes software modules such as clock display, key function, temperature, altitude, backlight and reminder sound alarm. The initialization program includes MCU, I/O interface status setting, LCD driver, clock, pressure sensor initialization, etc. Normal display is in clock mode, Mode is the function selection key, Set is the key for each specific function setting, and the specific value can be quickly set through the Up and Down keys. El is the backlight button.
When the Mode key is pressed to enter the altitude mode, the default value is the ultra-low power mode. Since the data reading frequency of each mode is different, the high-resolution and high-speed measurement modes can be switched according to the actual situation. The measurement accuracy can be indirectly selected by switching the three data reading frequency modes of the pressure sensor. DRDY-PIN sends a data preparation request interrupt to MCU PB. 0. At this time, Bit5 of the Status register changes to 1, and the registers Datard8 and Datard16 are read to read a total of 19 bits of valid pressure data. The decimal raw data obtained needs to be converted to the pressure unit Pa data value
Pres[Pa]=0.25×Pres[dec] (1)
where Pres[dec] is the decimal raw data. The obtained pressure data is not corrected because the SCP1000-D11 pressure sensor contains temperature compensation. Therefore, the height under the current air pressure can be converted according to formula (2).
When the starting reference position is low, Pa=101.324 kPa is the atmospheric pressure at the standard sea level, and the corresponding pressure height Ha is 0; R is the air gas constant, R=287.052 78 m2/(K·s2); g=9.80 665 m/s2 is the gravity acceleration at the standard sea level; β=-0.006 5 K/m is the vertical temperature change rate Ta=273.16K is the temperature at the standard sea level. Pb is the air pressure at the location. If the true elevation of the reference point is known, Ha can be set directly to avoid the principle error caused by the large fluctuation of the air pressure and temperature at the local sea level at high altitude.
After actual mountaineering tests, the absolute height error can reach ±10 m, and the 240 mA/3 V button battery can be used for at least one year.
Previous article:MCU keyboard C program
Next article:Application of magnetoresistive sensors in robot toys
Recommended ReadingLatest update time:2024-11-16 15:49
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- EEWORLD University - Simplifying Digital Power Supply
- Excuse me, what is this component with silk screen 6023?
- Analysis of the working principles of seven types of three-pole emitter DC circuits (updated)
- Design and implementation of FIR filter in DSP
- Some Allegro practical skills that PCB Layout engineers regret not knowing earlier
- Buck-Boost and Step-Up Converters in Wireless Security Cameras and Video Doorbells
- EEWORLD University Hall----Operating System Zhejiang University (Li Shanping)
- TI CapTIvate technology adds capacitive touch capabilities to stoves
- PCB short circuit problem
- Fanuc PLC help newbie