newrudeman

[Analog circuit] Waveform generation and transformation design (555+ op amp)

 
Overview

1 Design requirements

        Design a circuit that generates a sine wave from the square wave with a frequency of 2KHz and a duty cycle of 50% through a filter.

2 Overall design plan

        According to the design requirements, a 2KHz square wave needs to be generated first. The square wave can be generated through a 555 time base circuit, or a combination of a gate circuit and an RC circuit, an operational amplifier and an RC circuit, or a microcontroller to generate a PWM waveform. This case uses a simple and stable 555 time base circuit for design. Sine waves can be generated by generating square waves through a second-order bandpass filter design. The circuit system block diagram is as follows:

        Before designing this project, you need to understand the circuit design process, which can be roughly divided into the following stages. This project can be simulated and verified first before designing the schematic diagram and PCB.

3 Principle analysis

3.1 Square wave generation circuit

        Use a 555 timer to generate a square wave circuit with adjustable frequency and duty cycle. The 555 timer is named the 555 chip because the internal voltage standard uses three 5KΩ resistors. Because of their low price and simple peripheral circuits, the 555 series of chips are often used in the design of timers, pulse generators and oscillator circuits. Based on these characteristics, the 555 timer is widely used and can be seen in many small designs.

        You can use the 555 timer to build a monostable circuit. If you need to work in an astable multivibrator and trigger continuously in each cycle, you need to connect pins 2 and 6. If you want to adjust both the duty cycle and frequency, you can use two variable resistors and two diodes to connect to the circuit, as shown in the figure below:

        When the power supply is powered on, C1 is charged through RP1 and D1. When the capacitor is charged to 2/3VCC, it starts to discharge. It goes to the discharge tube inside pin 7 through D2, RP2 and RP1. When it is discharged to 1/3VCC, it reciprocates charging and discharging. process.

        According to the formula, it can be seen that the frequency and duty cycle are determined by the values ​​​​of RP1 and RP2. When adjusting RP1 or RP2, the frequency and duty cycle will change. The debugging method is to first adjust RP2 to determine the frequency and then fine-tune RP1. It is necessary to repeatedly adjust RP1 and RP2. RP2, in order to achieve the required frequency and duty cycle at the same time.

3.2 Sine wave generation circuit

        Performing Fourier transform on the square wave shows that the square wave is composed of multiple sine waves with different amplitudes and frequencies. The function of the band-pass filter is to retain the required waveforms and filter out the waveforms with redundant frequencies. According to the design requirements, the parameters of the second-order bandpass filter can be known: the center frequency is 2KHz, the gain is 1, the set bandwidth is 200Hz, and the corresponding circuit can be designed. RP1 is the resistor that determines the center frequency. Due to calculation parameters and component errors, RP1 is replaced with a 100Ω adjustable resistor. Since it is powered by a single power supply, R3 and R4 are used to boost the voltage.

4 Simulation diagram design

4.1 Simulation diagram creation

        Switch the EasyEDA standard version mode to the simulation mode, create a new project and name it: Waveform Generation and Transformation Design, save the automatically generated drawings to the project folder, and name it: Waveform Generation and Transformation Design_Sim.

        When selecting simulation devices, please note that they can only be called in the simulation basic library and system library devices in the simulation extension library in simulation mode. User-contributed simulation libraries are not guaranteed to run normally. All simulated devices in this project can be called in the simulation base library. There are a few things to note when drawing simulation diagrams:

(1) After placing the 555 timer, you can click to select it and press the X key on the keyboard to flip it to get a style with 3 feet facing the right;

(2) Find the three-terminal operational amplifier in the basic library for the TL072 op amp. Place it in the drawing and double-click to modify the device name to TL072. You can also use the X key or Y key to flip it to facilitate wiring;

(3) The oscilloscope can be connected to the output interface in three ways: network label, network port or direct wiring;

(4) When performing simulation debugging, proceed step by step, first verify the 555 multivibrator and then design the sine wave conversion circuit;

(5) The waveform of the reference picture does not meet the requirements. You need to adjust the sliding rheostat parameters yourself to obtain the required results.

4.2 Simulation verification

        After clicking simulation, use the oscilloscope to view the instrument function to observe the waveform, move the T1 and T2 time axes, check the waveform period and frequency, and adjust the values ​​of RX1 and RX2 multiple times to obtain the desired results. After generating a stable 2KHz square wave, draw the sine wave conversion circuit and adjust RX3 to make the sine wave output stable. It should be noted that each time you adjust the parameters, you need to click again to run the simulation. The shortcut key for running the simulation is F8.

5 Schematic design

5.1 Add schematic diagram

        After passing the simulation verification, I believe everyone can't wait to start designing the schematic diagram. Don't worry, you need to save the simulation diagram first and then switch the simulation mode to the standard mode to design the schematic diagram and PCB diagram. Since the devices that ultimately participate in the PCB design in a project come from the schematic diagram, the devices in the simulation diagram should not be involved in the PCB. Before designing, you need to set the devices in the simulation diagram first, and set the devices in the simulation diagram to not Go to PCB and do not add BOM , this is very important! Then select the previously created project folder, right-click, create a new schematic, and name the created drawing: Waveform Generation and Transformation Design_SCH. In this way, there will be a simulation diagram file and a schematic diagram file under the project. Next Please start the schematic design.

5.2 Power input circuit

        The power input range of this case can be from DC 9V to 12V. The input method has three modes: DC socket input, terminal block input and pin header input, which can adapt to the power supply of different scenarios. The power supply method can also be modified according to the laboratory conditions. When using, just connect one channel as input. Do not input multiple power sources at the same time.

      The three input methods are connected to the electrical symbols of VCC_IN and GND respectively, and VCC is output through the D1 diode to power the system. The diode D1 plays a role in preventing reverse connection and preventing the upper chip from burning. Design a simple power indicator circuit using a current limiting resistor and LED light. When the circuit is powered, the LED lights up. These devices can be called in the basic library in standard mode. The VCC_IN electrical symbol can be obtained by placing a VCC symbol and modifying the name. The network label is consistent with the network port and plays the role of naming the wire. The circuit connection is shown in the figure below:

5.3 555 multivibrator circuit

        When placing the pulse width and frequency adjustable square wave circuit in the schematic diagram, except for the NE555, other components can be called in the basic library in standard mode. For beginners, you can select the model according to the following package for placement:

K6Qc4TnyViCAfwHbKcfmrr01LocxgCAsGQ6V2cbQ.png

       When placing the NE555 device, you can search and select it in the component library. Try to find a model with sufficient inventory and a suitable price. The direct plug package is preferred. The pin arrangement of the chip placed in the schematic diagram after selection may not be consistent with the reference diagram. This does not affect the circuit design. Just ensure that the wiring is accurate. Please view the video tutorial on how to custom modify symbol pins and save calls.

5.4 Second-order bandpass active filter circuit

       When placing the square wave to sine wave circuit, the core device is the TL072 chip. You can directly search for TL072IP in the component library (IP is the chip factory's label), and select the TL072IP.2 sub-library in the Lichuang Mall library to call it. As for why TL072IP.1 cannot be used, it is because the .1 library does not have a power pin. When two operational amplifiers are needed in the circuit, the .1 and .2 sub-libraries can be placed together in the schematic diagram.

       Vo1 and Vo2 are network ports. Resistor, capacitor and sliding rheostat selection can be called in the basic library. You can refer to the previous square wave generation circuit for selection. The resistance selection package is: R_AXIAL-0.4. Please view the video tutorial for specific component selection. 

5.5 Pin header interface

       In order to facilitate circuit testing, you need to add some pin headers to connect to the output of the circuit and the GND pin. Use an oscilloscope to hook the corresponding pin headers for testing. Since there are two outputs in this circuit, four 2-pin pin headers are used. The device is the first in the connector category in the basic library. Just select the package as HDR-M-2.54_1x2 and place it. Each pin header is connected to GND or network port and the corresponding circuit.

5.6 Component selection instructions

       There are many options for symbols for each component. In actual application, practicality and maintainability need to be considered when selecting. As an electronic engineer, we should make selections when designing the schematic diagram. The devices provided by different manufacturers are different, so the best idea for device selection is to search for the device we need in the component library, select the required package and manufacturer, and check the price, brand, inventory and other related information of the selected device. Here we take NE555 as an example. Search for NE555 in the component library of Easy EDA Standard Edition and select the appropriate model for use. The search results are shown below:

The project schematic design is organized as follows:

 

6 PCB design

      After completing the schematic design, first check whether the circuit is connected correctly and whether the network is missing or not connected. After everything is checked, click Design - Convert Schematic to PCB in the menu bar at the top of the schematic to start PCB design.

6.1 Appearance design

      After generating the PCB, you need to set a PCB shape. The size of the shape needs to be designed according to the number of components and the shell or personal wishes. Adhering to the principle of appropriate size and beauty, this project can set a rectangle with a length of 80mm and a width of 60mm. As the size of the PCB board. Note that when designing the PCB shape, try not to exceed 10cm*10cm, otherwise the price will be slightly higher.

6.2 Component layout

      After the components in the schematic diagram are transferred to the PCB, the component layout is relatively messy. In the second step of designing the PCB, the components need to be classified and laid out. The classification is based on placing the components of each circuit module together, which is provided by Easy EDA. The layout transfer function can quickly layout each circuit module. Note that the interface devices should be placed on the edge of the board to facilitate wiring and operation.

6.3 PCB routing

      At this step, look back and see that you have completed the simulation diagram, schematic diagram and PCB component layout of the waveform generation and transformation design circuit, but there is only one final step left: PCB routing.

      PCB traces are divided into top traces and bottom traces when designing a double-layer circuit board. The top traces are red lines by default and the bottom traces are blue lines. The traces are connected to the copper wires in the circuit board. Just select the layer in Layers and Elements, and then connect the two pads of the same net. It seems like a simple Lianliankan, but in fact it requires our patience to make adjustments. The placement and layout of components will also affect the difficulty of wiring. The following reference suggestions are provided in the wiring of this project:

(1) The power line is set to 30mil and the signal line is set to 20mil width.

(2) Use bottom-layer wiring to make it easier to make your own PCB in school

(3) No wiring is required for GND, just use the bottom layer of copper.

(4) During the wiring process, give priority to straight lines, and use obtuse angles or arc turns where corners are required.

(5) After completing the wiring, add appropriate silk screen marks to indicate the purpose and interface functions of the PCB board.

7 Debugging Precautions

      After the PCB design is completed, export the Gerber file to the factory for PCB proofing. After purchasing the relevant components, prepare for welding and debugging. There are the following points to note during the welding debugging process:

(1) Pay attention to electrical safety during welding, and do not touch the soldering iron tip with your hands to avoid burns.

(2) During the welding process, first weld the components from low to high.

(3) During the test process, first power on to check whether the voltage is normal, and then debug step by step. First adjust RP2 and RP1 to generate a stable square wave of 2KHz and 50% duty cycle. Use an oscilloscope to check whether the waveform output by J3 is normal. Then adjust RP3 to make the J5 pin header output a stable 2KHz sine wave.

      At this point, the waveform generation and transformation-design project process based on 555 and op amp is over. The waveform generation and transformation experiment is a very important content in the field of analog circuits. It is also used as an event in the comprehensive evaluation of the National College Student Electronic Design Competition. Interested students can expand other waveform generation and transformation methods on their own. Welcome to the Share your ideas on an open source platform.

8 project information

Click to view the project video: https://www.bilibili.com/video/BV1Qa411r7Gy

 

Special thanks to Hou Jiaqi from Weifang Environmental Engineering Vocational College for providing project verification support for this project~

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-08-06 10:04:02

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号