Do-it-yourself oscilloscope on a peak controller. Dual-channel USB HID oscilloscope based on ATtiny45 microcontroller. A complete set of classic peripherals

Measuring technology

Pocket oscilloscope up to 1 MHz

By replacing the PIC16F873A microcontroller with a PIC18F4550 in the pocket oscilloscope described in , and the K140UD608 operational amplifier with a TDA8708A analog video interface chip, it was possible to reduce the sweep duration by 150 times, to 21 μs across the entire screen width, and increase the maximum input signal frequency to 1 MHz. This significantly expanded the capabilities of the oscilloscope.

Basic specifications

Beam deflection voltage across the entire height of the screen, V................0.2; 1; 3; 10; thirty; 100

Maximum frequency of the signal under study, MHz........1

Horizontal scan duration, μs.......21, 170, 1000, 10-103, 30-103, 100-103, 300-103, 106

Screen resolution, px......128x64

Supply voltage, V............5

Current consumption, mA...........115

Dimensions, mm......80x62x30

Weight, g........................110

The oscilloscope circuit is shown in Fig. 1. The input signal is supplied to pin 20 (ADCIN - ADC input) of the DA1 chip (TDA8708A). To launch its ADC, microcontroller DD1 generates clock pulses at pin 17. The binary codes of the signal samples are sent to port B of the DD1 microcontroller, which, according to the program, writes them into RAM and then displays them on the HG1 graphic LCD in the form of an oscillogram. general description LCD MT-12864J-2FLA can be found in, and read about its use in.

Rice. 1. Oscilloscope circuit

In Fig. Figure 2 shows an oscillogram of a signal with a frequency of 100 kHz. The variable resistor R6 shifts the scan line vertically, setting it to the most convenient position for observing the oscillogram. By selecting resistor R12, the best image contrast on the LCD screen is achieved.

Rice. 2. Oscillogram of a signal with a frequency of 100 kHz

The oscilloscope sweep operates in a single trigger mode by pressing the SB1 button. By pressing the SB2 button, the sweep duration is changed. After each press of this button, the value of the new sweep duration is displayed on the screen for some time (Fig. 3).

Rice. 3. The value of the new sweep duration

The microcontroller program can be downloaded.

Literature

1. Pichugov A. Pocket oscilloscope. - Radio, 2013, No. 10, p. 20, 21.

2.PIC18F2455/2550/4455/4550 Data Sheet. - URL: http://ww1.microchip.com/downloads/en/DeviceDoc/39632e.pdf (04/22/15).

3. Yatsenkov V. S. Microchip microcontrollers with hardware support for USB. - M.: Radio and communication, 2008.

4. TDA8708A. Video analog input interface. - URL: http://doc.chipfind.ru/pdf/philips/tda 8708a.pdf (05/21/15).

5. Liquid crystal module MT-12864J. - URL: http://www.melt.com.ru/files/file2150172.5.pdf (04/22/15).

6. Milevsky A. Using a graphical LCD MT-12864A with a microcontroller from Microchip. - Radio, 2009, No. 6, p. 28-31.


Publication date: 06.11.2015

Readers' opinions
  • admin / 04/18/2017 - 14:35
    The problem is on the FTP server, where the distribution is coming from. I think this is a temporary phenomenon, try downloading it a little later.

The proposed device belongs, rather, to the category of oscillographic probes. Its capabilities allow one to evaluate the shape and parameters of low-frequency signals only “by eye.” Nevertheless, due to its small size and cost-effectiveness, such an oscilloscope can find application in amateur radio practice, especially when diagnosing and repairing equipment in the field.

This development is based on a small-sized two-beam oscilloscope-multimeter described in. There is only one “ray” left in it. The maximum sensitivity of the vertical deflection channel has been increased from 640 to 100 mV (full screen). The minimum sweep duration has been reduced from 5 to 3 ms, and when observing logical signals - to 300 μs. The dimensions of the device, its weight and current consumption have been significantly reduced.

Main technical characteristics

The oscilloscope circuit is shown in Fig. 1. The signal under study of an arbitrary shape, depending on its amplitude, is supplied to “Input 1” - one of the sockets 1-5, 7, 8 of connector X1, and the common wire of the source of the signal under study is connected to its socket 6. Resistors R1-R6, which set the sensitivity of the vertical deflection channel of the oscilloscope, are mounted directly on the terminals of the connector sockets. Through the amplifier on the K140UD608 op amp (DA1), the signal is supplied to pin 2 (RA0) of the microcontroller (DD1), which serves as the input of the ADC built into it. Digital samples of instantaneous signal values ​​for the time corresponding to the selected sweep duration are stored in random access memory microcontroller and are displayed on the graphical LCD HG1 in the form of an oscillogram. An LCD is used, which is controlled via port lines RB0-RB4 and RC0-RC7 of the microcontroller. During development software The recommendations from the article turned out to be very useful.

Variable resistor R10 is designed to shift the oscillogram vertically. Resistor R17 is selected to achieve the best image contrast on the indicator screen.

The oscilloscope sweep is a one-time sweep, triggered each time you press the SB2 button. The sweep duration is changed by pressing the SB1 button. After each press, a number is displayed on the indicator screen - the value of the selected duration.

If the sweep duration is set to 300 μs (for the entire screen), the microcontroller’s ADC no longer has time to digitize samples of the signal under study. At this speed, the indicator can only observe the nature of the change over time in the logical levels of the pulses supplied to socket 9 of connector X1 (“Input 2” of the oscilloscope). Through the isolation capacitor C1, these pulses are sent directly to the discrete input RA1 (pin 3) of the microcontroller.

The oscilloscope is mounted on a circuit board (Fig. 2) placed in a housing made from a fishing tackle box. The HG1 indicator is located on the housing cover. Appearance the operating device is shown in Fig. 3. The third button visible in the photographs is left unconnected. It is not used when working with the device.

The source code of the program in assembler and firmware for the PIC16F873A microcontroller are available at.

Literature:

1. Kichigin A. Small-sized two-beam oscilloscope-multimeter. - Radio, 2004, No. 6, p. 24-26.
2. Liquid crystal module MT-12864J. - .
3. Milevsky A. Using a graphic LCD MT-12864A with a microcontroller from Microchip. - Radio, 2009, No. 6, p. 28-31.

An oscilloscope is a device that helps you see the dynamics of oscillations. With its help, you can diagnose various breakdowns and obtain the necessary data in radio electronics. Previously, oscilloscopes based on transistor tubes were used. These were very bulky devices that were connected exclusively to a built-in or specially designed screen.

Today, instruments for measuring basic frequency, amplitude characteristics and signal shapes are convenient, portable and more compact device. They are often performed as a separate console connected to a computer. This maneuver allows you to remove the monitor from the package, significantly reducing the cost of the equipment.

You can see what a classic device looks like by looking at a photo of an oscilloscope in any search engine. You can also mount this device at home using inexpensive radio components and housings from other equipment for a more presentable appearance.

How can I get an oscilloscope?

Equipment can be obtained in several ways and it all depends solely on the size Money, which can be spent on purchasing equipment or parts.


  • Buy a ready-made device in a specialized store or order it online;
  • Buy a construction set, for example, sets of radio components and housings, which are sold on Chinese websites, are now widely popular;
  • Independently assemble a full-fledged portable device;
  • Mount only the attachment and probe, and organize the connection to a personal computer.

These options are listed in order of lower hardware costs. Buying a ready-made oscilloscope will cost the most, since it is an already delivered and working unit with all the necessary functions and settings, and in case of incorrect operation, you can contact the sales center.

The designer includes a circuit for a simple do-it-yourself oscilloscope, and the price is reduced by paying only the cost of radio components. In this category, it is also necessary to distinguish between models that are more expensive and simpler in terms of configuration and functionality.

Assembling the device yourself according to existing diagrams and radio components purchased at different points may not always turn out to be cheaper than purchasing a designer kit, so it is necessary to first evaluate the cost of the undertaking and its justification.

The cheapest way to get an oscilloscope is to solder only the attachment to it. Use a computer monitor for the screen, and programs for capturing and transforming the received signals can be downloaded from various sources.


Oscilloscope Designer: Model DSO138

Chinese manufacturers have always been famous for their ability to create electronics for professional needs with very limited functionality and for fairly little money.

On the one hand, such devices are not able to fully satisfy a number of needs of a person involved in radio electronics on a professional basis, but for beginners and lovers of such “toys” there will be more than enough.

One of popular models Chinese made type oscilloscope designer is considered DSO138. First of all, this device has a low cost, and it comes with all the necessary parts and instructions, so there should be no questions about how to properly make an oscilloscope with your own hands, using the documentation included in the kit.

Before installation, you need to familiarize yourself with the contents of the package: board, screen, probe, all necessary radio components, assembly instructions and circuit diagram.

The work is made easier by the presence of corresponding markings on almost all the parts and the board itself, which really turns the process into assembling a children's construction set for an adult. The diagrams and instructions clearly show all the necessary data and you can figure it out even without knowing a foreign language.


The output should be a device with the following characteristics:

  • Input voltage: DC 9V;
  • Maximum input voltage: 50 Vpp (1:1 probe)
  • Current consumption 120 mA;
  • Signal bandwidth: 0-200KHz;
  • Sensitivity: electronic bias with vertical adjustment option 10mV/div - 5V/Div (1 - 2 - 5);
  • Discrete frequency: 1 Msps;
  • Input resistance: 1 MOhm;
  • Time interval: 10 µs / Div - 50s / Div (1 - 2 - 5);
  • Measurement accuracy: 12 bits.

Step-by-step instructions for assembling the DSO138 construction set

Should be considered in more detail detailed instructions for the manufacture of an oscilloscope of this brand, because other models are assembled in a similar way.

It is worth noting that in this model the board comes immediately with a soldered 32-bit Cortex™ microcontroller on the M3 core. It operates two 12-bit inputs with a characteristic of 1 μs and operates in a maximum frequency range of up to 72 MHz. Having this device already installed makes the task somewhat easier.

Step 1. It is most convenient to start installation with SMD components. It is necessary to take into account the rules when working with a soldering iron and a board: do not overheat, hold for no longer than 2 s, do not connect different parts and tracks together, use solder paste and solder.

Step 2. Solder the capacitors, inductors and resistances: you need to insert the specified part into the space provided for it on the board, cut off the excess length of the leg and solder it on the board. The main thing is not to confuse the polarity of the capacitors and not to close adjacent tracks with a soldering iron or solder.


Step 3. We mount the remaining parts: switches and connectors, buttons, LED, quartz. Particular attention should be paid to the diode and transistor side. Quartz has metal in its structure, so you need to ensure that there is no direct contact of its surface with the board tracks or take care of the dielectric lining.

Step 4. 3 connectors are soldered to the display board. After completing manipulations with the soldering iron, you need to rinse the board with alcohol without aids– no cotton wool, discs or napkins.

Step 5. Dry the board and check how well the soldering was done. Before connecting the screen, you need to solder two jumpers to the board. The existing bitten-off pins of the parts will be useful for this.

Step 6. To check operation, you need to connect the device to a network with a current of 200 mA and a voltage of 9 V.

The check consists of taking indicators from:

  • 9 V connector;
  • Test point 3.3 V.

If all parameters match the required values, you need to disconnect the device from the power supply and install the JP4 jumper.

Step 7. You need to insert a display into the 3 available connectors. You need to connect an oscilloscope probe to the input and turn on the power yourself.

The result of correct installation and assembly will be the appearance on the display of its number, firmware type, version and developer’s website. After a few seconds, you will be able to see sine waves and a scale when the probe is turned off.

Computer console

When assembling this simple device, you will need a minimum number of parts, knowledge and skills. Schematic diagram very simple, except that you will need to make the board yourself to assemble the device.

The size of the attachment for a do-it-yourself oscilloscope will be approximately the size of a matchbox or a little larger, so it is best to use this size plastic container or battery box.

Having placed the assembled device with ready-made outputs into it, you can begin organizing work with a computer monitor. To do this, download the Oscilloscope and Soundcard Oscilloscope programs. You can test their work and choose the one you like best.

The connected microphone will also be able to relay to the connected oscillator sound waves, the program will reflect the changes. This set-top box is connected to a microphone or line input and does not require any additional drivers.

DIY oscilloscope photos


This simple and cheap USB oscilloscope was invented and made just for fun. A long time ago I had the opportunity to repair some murky video processor in which the input was burned down to the ADC. ADCs turned out to be available and inexpensive, I bought a couple just in case, one was used as a replacement, and the other remained. Recently it caught my eye and after reading the documentation for it, I decided to use it for something useful on the farm. In the end, we got this little device. It cost me a penny (well, about 1000 rubles), and a couple of days off. When creating, I tried to reduce the number of parts to a minimum, while maintaining the minimum functionality required for an oscilloscope. At first I decided that the result was some kind of painfully frivolous device, however, now I use it constantly, because it turned out to be very convenient - it does not take up space on the table, easily fits in a pocket (it is the size of a pack of cigarettes) and has quite decent characteristics:

Maximum sampling frequency - 6 MHz;
- Bandwidth input amplifier- 0-16 MHz;
- Input divider - from 0.01 V/div to 10 V/div;
- Input resistance - 1 MOhm;
- Resolution - 8 bits.

The schematic diagram of the oscilloscope is shown in Figure 1.

Fig.1 Schematic diagram of an oscilloscope


For various settings and troubleshooting in all kinds of power converters and control circuits household appliances, for studying all kinds of devices, etc., where precise measurements and high frequencies are not required, but you just need to look at the shape of a signal with a frequency of, say, up to a couple of megahertz - more than enough.

The S2 button is part of the hardware needed for the bootloader. If you keep it pressed when connecting the oscilloscope to USB, the PIC will work in bootloader mode and you can update the oscilloscope firmware using the appropriate utility. A “television” chip - TDA8708A - was used as an ADC (IC3). It is quite available in all sorts of "Chip and Dip" ahs and other places where parts are obtained. In fact, this is not only an ADC for a video signal, but also an input switch, an equalizer and a white-black level limiter, etc. But all these delights are not used in this design. The ADC is very fast - the sampling frequency is 30 MHz. In the circuit, it operates at a clock frequency of 12 MHz - there is no need to go faster, because the PIC18F2550 simply will not be able to read data faster. And the higher the frequency, the greater the consumption of the ADC. Instead of the TDA8708A, you can use any other high-speed ADC with parallel data output, for example the TDA8703 or something from Analog Devices.

The clock frequency for the ADC was cunningly extracted from the PIC - a PWM is running there with a frequency of 12 MHz and a duty cycle of 0.25. The clock pulse of positive polarity passes in the Q1 cycle of the PIC, so that with any access to port B, which occurs in the Q2 cycle, the data The ADCs will be ready. The PIC core operates at a frequency of 48 MHz, obtained through the PLL from a 4 MHz crystal. A copy command from register to register is executed in 2 clock cycles or 8 cycles. Thus, ADC data can be stored in memory at a maximum frequency of 6 MHz using a continuous sequence MOVFF PORTB, POSTINC0 commands. One PIC18F2550 RAM bank of 256 bytes is used for the data buffer.

Lower sample rates are achieved by adding a delay between MOVFF commands. The firmware implements the simplest synchronization based on the negative or positive edge of the input signal. The data collection cycle into the buffer is started by a command from the PC via USB, after which this data can be read via USB. As a result, the PC receives 256 8-bit samples, which it can, for example, display as an image. The input circuit is incredibly simple. The input voltage divider is made without any frills on a rotary switch. Unfortunately, it was not possible to figure out how to transfer the switch position to the PIC, so the graphical face of the oscilloscope contains only voltage values ​​in relative units - scale divisions. The input signal amplifier (IC2B) operates with a gain of 10 times, the zero offset required for the ADC (it accepts a signal in the range from Vcc - 2.41V to Vcc - 1.41V) is provided by the voltage from the programmable reference voltage generator PIC (CVREF IC1, R7, R9) and a divider from the negative supply voltage (R6, R10, R8). Because There was an “extra” amplifier (IC2A) in the op-amp housing; I used it as a bias voltage follower.

Don’t forget about capacitive circuits for frequency compensation of the input capacitance of your op-amp and limiting diodes, which are missing in the diagram - you need to select capacitances parallel to the divider resistors and resistor R1, otherwise the frequency characteristics of the input circuit will ruin the entire passband. With direct current, everything is simple - the input resistance of the op-amp and closed diodes is orders of magnitude higher than the resistance of the divider, so the divider can simply be calculated without taking into account the input resistance of the op-amp. For alternating current it is different - the input capacitance of the op-amp and diodes is a significant amount compared to the capacitance of the divider. From the resistance of the divider and the input capacitance of the op-amp and diodes, a passive low-pass filter is obtained, which distorts the input signal.

To neutralize this effect, you need to make sure that the input capacitance of the op-amp and diodes becomes significantly less than the divider capacitance. This can be done by constructing a capacitive divider parallel to the resistive one. It is difficult to calculate such a divisor, because Both the input capacitance of the circuit and the mounting capacitance are unknown. It's easier to pick it up.

The selection method is as follows:
1. Place a capacitor with a capacity of approximately 1000 pF in parallel with R18.
2. Select the most sensitive limit, apply rectangular pulses with a frequency of 1 kHz and a swing of several scale divisions to the input, and select a capacitor parallel to R1 so that the rectangles on the screen look like rectangles, without peaks or valleys at the fronts.
3. Repeat the operation for each subsequent limit, selecting capacitors in parallel with each divider resistor according to the limit.
4. Repeat the process from the beginning, and make sure that everything is in order at all limits (the capacitance of the capacitor installation may appear), and, if something is wrong, slightly adjust the capacitances.

The op amp itself is an Analog Devices AD823. The most expensive part of the oscilloscope. :) But the band is 16 MHz - which is not bad. And besides, this is the first of the fast ones that came across in retail sale for reasonable money.

Of course, this dual op-amp can be replaced without any modifications with something like LM2904, but then you will have to limit yourself to audio signals. It will not handle more than 20-30 kHz.

Well, the shape of rectangular signals, for example, will be slightly distorted. But if you manage to find something like OPA2350 (38 MHz), then it will be, on the contrary, wonderful.

The negative supply voltage source for the op-amp is made using the well-known charge-pump ICL7660. Minimum wiring and no inductances.
Of course, its output current is -5 V, which is small, but we don’t need much. The power circuits of the analog part are isolated from digital noise by inductances and capacitances (L2, L3, C5, C6). The inductors came with a nominal value of 180 uH, so I installed them. No power interference even at the most sensitive limit. The PIC firmware is uploaded via USB using a bootloader that sits at address 0 in the program memory and starts if you hold down the S2 button when turning it on. So before flashing the PIC, upload the bootloader there first - it will be easier to change the firmware.
The sources of the oscilloscope driver for kernels 2.6.X are in the archive with the firmware. There is also a console utility for checking the functionality of the oscilloscope. Its source code is worth looking at to figure out how to communicate with the oscilloscope if you want to write your own software for it.

The program for the computer is simple and ascetic, its appearance is shown in Figures 2 and 3. Connect the oscilloscope to USB and launch qoscilloscope. Requires QT4. detailed study. The time scale for display can be easily changed using the changeTimeDivision function. The oscilloscope measures voltage in the range of 0-5V, 0-2.5V and 0-1.25. The main disadvantage of this oscilloscope is low frequency sampling rate (~60 kHz), and the fact that the inputs are limited by the microcontroller's ADC limitations. However, it is a very nice device and I recommend watching the video to see it in action.

Scheme

Sources and firmware for the oscilloscope can be found at the bottom of the page. Each block of the circuit is labeled and will be described in detail below.

Nutrition

Voltage is supplied from the 9V battery to the TC1262-5.0V integrated voltage regulator to provide a stable 5V to power the microcontroller and display. There is a 1uF capacitor at the output.

Display AGM1264F

Graphic LCD display AGM1264F with a resolution of 128 x 64 pixels with a built-in KS0108 controller, which allows you to easily control it using a microcontroller. He has LED backlight and a negative voltage generator to drive the display.

Pin A0 is configured as an analog input. Note that the source resistance affects the analog input offset voltage. The maximum recommended resistance is 2.5 kOhm.

The PIC18F2550 microcontroller operates at a frequency of 48 MHz from an internal oscillator. R1 is a load resistor required for operation. C1 is a stabilizing capacitor. The component marked "RES" is a 20MHz resonator.

RS232 converter

The USART pins must be connected to the RS-232 converter to connect to a PC for firmware upgrade. After this it can be disabled.

Sources and firmware

The microcontroller must be flashed with the file "SAC_tinybld18F2550usb _20MHz_115200_48MHz".

List of radioelements

Designation Type Denomination Quantity NoteShopMy notepad
IC1 MK PIC 8-bit

PIC18F2550

1 To notepad
IC2 Linear regulator

TC1264

1 5 Volt To notepad
C1 Capacitor0.22 µF1 To notepad
C2 Electrolytic capacitor1 µF1 To notepad
R1 Resistor

3.3 kOhm

1 To notepad
R2 Trimmer resistor10 kOhm1 To notepad
R3 Resistor

5 ohm

1 To notepad
RES Quartz resonator20 MHz1 To notepad
LCD displayAGM1264F1 To notepad
G1 Battery9 V1 To notepad
JP1 Display connector 1 To notepad
JP2 Connector for firmware updateRS-2321


What else to read