Low-frequency and ultra-low-frequency signals are widely used in medicine, electrochemical research and experimental teaching. Especially in the field of electrochemistry, ultra-low-frequency signal generators have become an indispensable part of electrochemical instruments. Electrochemical instruments equipped with square wave, triangle wave and sine wave generators can study various transient behaviors of electrochemical systems; equipped with slow linear scanning signals or step wave signals, steady-state (or near-steady-state) polarization curve measurements can be automatically performed. However, there are few signal generators suitable for the field of electrochemistry on the market. Traditional signal generators cannot meet professional needs and the purchase cost is too high. This paper introduces a signal generator controlled by a single-chip microcomputer, which can output square waves, triangle waves and sine waves. The frequency range of the generated waveform signal is 0.125 mHz (millihertz) to 80 Hz, the output analog signal voltage range is -10 to +10 V, and the amplitude and frequency of the output signal have a certain adjustment range. Compared with the traditional signal generator, this signal generator has the following characteristics: this signal generator can meet the requirements of the electrochemical field for signal generators, the lowest frequency can reach 0.125 mHz, reaching the advanced level in China, and the signal generator has high precision, low distortion, stable performance, simple circuit structure and small size at ultra-low frequency.
1 Working principle
The input parameters of the ultra-low frequency signal generator include scanning mode, upper and lower limit levels, and waveform frequency. Among them, the scanning mode has three options: single, round trip, and continuous; the upper and lower limit levels are between -10 and +10 V, and the upper limit level is greater than the lower limit level; the waveform frequency range is 0.125 mHz to 80 Hz. There are three output waveforms: square wave, triangle wave, and sine wave. When the signal generator is powered on, it is reset and cleared first, and then the system is initialized. The user inputs parameters such as scanning frequency, upper and lower limit levels, and scanning mode into the microcontroller through the keyboard, and displays them on the LCD. According to a certain algorithm, each functional module is accurately adjusted, and the analog switch that controls the instrument in the integration circuit module is disconnected to start the signal generator to output the required signal waveform.
2 Waveform generation principle
The signal generator can generate continuous square waves, triangle waves and sine waves with adjustable frequency and peak and valley values. The following is a detailed introduction to the generation principles of the three waveforms.
2.1 Sine wave generation principle
Since the lowest frequency of the signal generator can reach 0.125 mHz, the traditional sine wave generation circuit can no longer meet the requirements. The instrument uses a 16-bit digital/analog converter DAC8532 to generate sine waves. Compared with the RC bridge sine wave oscillation circuit and the LC sine wave oscillation circuit, this method is simple, reliable and has high stability.
2.2 Square wave generation principle
The traditional square wave generation circuit consists of a hysteresis comparator with an inverting input and an RC circuit. The RC loop serves as both a delay link and a feedback network, and the output state is automatically converted through RC charging and discharging. However, the generated square wave cannot meet the requirements of ultra-low frequency, and the amplitude and frequency of the waveform are difficult to adjust. The square wave generating circuit of this system is generated by the continuous conversion of CMOS analog switch. This circuit uses ADG201A as the analog switch. When the switch is open, the circuit outputs a high level; when the switch is closed, the circuit outputs a low level. The amplitude of the square wave is determined by the input voltage
, and the period is determined by the frequency of the analog switch conversion. The circuit is simple and can meet the requirements of ultra-low frequency. Moreover, the square wave generated by this circuit is a continuous analog waveform, and the amplitude and frequency are easy to adjust.
2.3 Principle of triangular wave generation
The triangular wave of this signal generator is generated by an integration circuit. Unlike the traditional triangular wave generating circuit, the generation process of this triangular wave is a closed-loop control system, as shown in Figure 1. The square wave generating circuit controls the integration direction of the integration circuit. The output of the integration circuit is compared with the upper and lower limit levels input by the user into the comparator, and the comparison result is sent to the RS trigger. When the output of the integration circuit is higher than the upper limit level (or lower than the lower limit level) input by the user, the RS trigger controls the square wave generating circuit to reverse its output voltage, and continues to send the output of the integration circuit and the upper and lower limit levels input by the user to the comparator for comparison, repeating the cycle, thereby outputting the waveform of the required signal.
3 Hardware circuit design
3.1 Hardware circuit design based on AT89C52
The circuit block diagram is shown in Figure 2.
3.2 LCD display circuit
The LEDs that were previously commonly used in display terminals have been gradually eliminated because they cannot conveniently display Chinese characters and graphics. This signal generator uses the OCM4X8C LCD display module for display. OCM-4X8C is a graphic dot matrix LCD display module with a serial/parallel interface and a Chinese character library inside. The control driver of this module uses the ST7920 of Taiwan Silicon Creation Electronics Company, so it has a strong control and display function.
The LCD screen of OCM4X8C is 128×64 dot matrix, which can display 4 lines, 8 Chinese characters per line. In order to facilitate the simple and convenient display of Chinese characters, the module has a 2 Mb Chinese font CGROM, which contains 8 192 16×16 dot matrix Chinese font libraries; at the same time, in order to facilitate the display of English and other commonly used characters, it has a 16 Kb 16×8 dot matrix ASCII character library. The LCD display circuit is shown in Figure 3. LEDA is the positive electrode of the backlight source of the liquid crystal display module, connected to the +5 V power supply; LEDK is the negative electrode of the backlight source, connected to the ground; PSB controls the serial/parallel connection mode. When the PSB pin of the module is connected to a low level, the module enters the serial interface mode. The serial mode uses the serial data line R/W, the serial clock line E and the chip select terminal RS to transmit data, which constitutes a 3-wire serial mode. According to the serial operation timing programming, the display can be performed.
3.3 E2PROM circuit
Serial E2PROM is an online electrically erasable and writable memory. It has the characteristics of small size, simple interface, reliable data storage, online rewrite, low power consumption, and low voltage writing. It is widely used in single-chip microcomputer systems. E2PROM can be used to store the initialization state table of the signal generator. After the single-chip microcomputer is reset and cleared, the table is directly called to initialize the system. The connection circuit between AT24C64 and single-chip microcomputer is shown in Figure 4.
4 System software design
The software program is the core of the ultra-low frequency signal generator. According to the keyboard input parameters, the digital potentiometer that controls the upper and lower limits of the level and the DAC8532 that controls the input voltage are accurately adjusted to enable the signal generator to work normally. The software flow is shown in Figure 5.
5 Implementation of ultra-low frequency signal
The output frequency of the square wave and triangle wave is divided into 4 output levels. In order to make the frequency distribution of the 4 levels uniform, the selection of resistors is also critical. Through calculation, 2 MΩ, 75 kΩ, 4 kΩ, and 310Ω are selected. From the formula:
the frequency range that the 4 levels meet can be calculated: capacitor C = 10μF. In this design, the maximum value of Uo is 10 V, and the maximum value of Ui is 10 V, so that the minimum value of Ui for the circuit to work is 0.1 V. According to the formula:
the frequency range is 0.125 mHz~80 Hz.
In order to ensure the stability of the ultra-low frequency signal waveform and good repeatability, the following points should be paid attention to during the waveform implementation process:
(1) The use of analog switches. The system initially used analog switches to control the four frequency ranges. However, due to the on-resistance and off-resistance of the analog switches, the analog switches were not completely closed or opened, and the off-resistance of the analog switches was not large enough. Therefore, the off-resistance of the four analog switches in parallel would be even smaller. When connected in parallel with the integral resistor, the integral period would be seriously affected, thus affecting the output of the ultra-low frequency signal. Finally, relays were used to control the lowest frequency range, and analog switches were used to control the remaining three frequency ranges, so that the low-frequency signal output was stable.
(2) The input signal cannot be too small. If the input signal is too small, the signal will be equivalent to the offset current and offset voltage of the op amp, and the error of the output signal will be large.
(3) Selection of integral capacitor. Ultra-low frequency also has specific requirements for capacitors. In order to stabilize the signal, the capacitor of the ultra-low frequency signal generator is a polytetrafluoroethylene capacitor with a capacitance of 10μF. Since the insulation resistance on the circuit board is not large enough, the integral capacitor cannot be directly soldered to the circuit board, but is connected to the op amp through two wires.
(4) Selection of integral resistor. If the resistance value is too large, the requirements for the operational amplifier are too high. If the resistance value is too small, the ultra-low frequency waveform cannot be generated. Therefore, a metal resistor with a maximum integral resistance of 2 MΩ is selected.
(5) Op amp selection. The ultra-low frequency signal has high requirements for the operational amplifier. The system selects the OP37 low offset current and low offset voltage operational amplifier.
6 Conclusion
Compared with the existing signal generators composed of counters, read-only memories, D/A converters and filters, the ultra-low frequency signal generator controlled by the single-chip microcomputer has higher frequency accuracy and stability. The three waveforms generated by the signal generator are commonly used in electrochemical experiments, and the lowest frequency can reach 0.125 mHz, which is the requirement of electrochemical experiments for low frequency. It has broad application prospects in medicine and electrochemical research.
Previous article:Design of portable mine gas detection system
Next article:Design of intelligent water controller based on contactless IC card
- Popular Resources
- Popular amplifiers
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
- [TI Live] The latest innovative DLP automotive application solutions, dynamic ground lights, augmented reality head-up display "pat" you
- Winding inductance of electrolytic capacitor
- A beginner's tutorial on TCP server development in Linux using C language
- iQOO 200W and 120W GaN ultra-fast flash charging
- Hardware Design of STM32 USB Interface
- [GigaDevice GD32F310 Review] +RTC Usage
- [TI recommended course] #Live replay: TI's new generation C2000 microcontroller#
- DAC8532 DAC8552 16bitDAC chip STM32 analog SPI driver
- Meixin Award Live Broadcast: Supporting Integrated Digital IO Technology for Industrial Systems Registration Open
- MSP430F249 external interrupt P1.3 port