Editor Version ×
recommended

Pro Edition

free

Brand new interactions and interfaces

Smooth support for design sizes of over 3W

devices or 10W pads

More rigorous design constraints, more

standardized processes

For enterprises, more professional users

Std Edition

Easy to use and quick to get started

The process supports design scales of 300

devices or 1000 pads

Supports simple circuit simulation

For students, teachers, creators

Completed

PRO MakerLab [LC* Liangshan Pi ] Portable multi-function oscilloscope/instrument

[LC* Liangshan Pi ] Portable multi-function oscilloscope/instrument

Project tags

License

GPL 3.0

License: GPL 3.0

Mode:

Mode

Editors' pick

Editors' pick

  • 50
  • 0
  • 0
Update time: 2024-12-18 10:06:41
Creation time: 2024-12-17 06:15:30
Description

Description

Project Introduction

This project is a portable multi-functional instrument designed based on the development of Lc Liangshan Pi and the supporting 98 yuan 4.3-inch RGB touch screen, with dual-channel oscilloscope, signal generator, serial port data viewer and other functions. The follow-up program of 148 yuan was also open source after adaptation.

The specific use video has been posted on Bilibili, welcome to watch: [Click me to jump to the physical demonstration video of Bilibili!]

1. The overall block diagram of the system is as follows:

Some of the contents of this project refer to the official case of Liangshan Pi oscilloscope [oscilloscope expansion board], and supplement and improve many aspects of it, to achieve rechargeable portability, dual-channel signal acquisition, 4.3-inch large screen, full touch human-computer interaction, serial port signal viewing (support Chinese characters) and other functions.

2. The performance parameters are as follows:

(1) Oscilloscope

① Support dual-channel maximum ±10V peak-to-peak signal input, sampling rate of 2MSPS, measurement waveform can be displayed stably.

② Support one-key Auto function, automatically adjust the waveform to display under suitable conditions.

③ It has a trigger function, which can realize the adjustment of the vertical offset of the waveform, the horizontal offset, the trigger threshold, etc.

(2) Signal generator

① Support the output of five waveforms: sine wave, square wave, triangle wave, sawtooth wave and anti-sawtooth wave.

② The output frequency supports 1KHz-50khz continuous adjustment every 1KHZ.

③ The output peak-to-peak value supports 0.5V-2.5V continuous adjustment every 0.1V.

(3) Serial port data viewer

①Support a variety of baud rate adjustment.

②Support text display, HEX data display, waveform analysis display function.

③Support receiving any Chinese character display.

 

Hardware circuit design

1. Signal coupling circuit

The microcontroller controls the corresponding high and low levels of the GPIO, and then controls the solid-state relay to realize the AC/DC coupling of the input signal.

2. Analog front-end circuit

The analog front-end circuit draws on the official case of Liangshan Pi oscilloscope expansion board, for details, please refer to: [Oscilloscope expansion board].

Signal Attenuation Circuit:

Signal Gain Processing and Vertical Translation Circuits:

Signal Generator Circuit:

3. Power supply circuit

A SGM3204 charge pump is used to generate a -5V voltage that is supplied to the op amp for dual power supply.

The CJ431 is used to generate a voltage of 2.5V as a reference voltage for the microcontroller ADC. At this time, it should be noted that the ADC reference voltage of the Liangshan Pi is 3.3V by default, so it is important to remove the 0 ohm jumper resistor of the corresponding A3.3V AGND on the Liangshan Pi, otherwise the final measured data will be wrong or even burn out the circuit.

Use ME2159AM6G to boost the voltage of the lithium battery to 5V.

The charging management of lithium batteries uses LP4056HSPF, and when charging, the LED will light up to indicate that the user is charging, charging is complete, and the LED is off.

Lithium battery selection

Due to space limitations, this project uses a 3mm thick, 50mm*60mm 1200mah lithium battery to power the whole system, and uses hot melt adhesive to install it between the PCB and the RGB screen.

Refer to the Taobao shopping cart link:

77₤WEYTWPyGCsC₤ https://m.tb.cn/h.5uFXj1X  CZ3460 I shared an awesome content with you, come and check it out.

4. RGB screen

This project uses a 4.3-inch RGB screen supporting the Lc development board, 800*480 screen pixels, and the display content is delicate.

purchase link:https://item.szlcsc.com/8351841.html?t=1708862395529&s=1708862395529

5. PCB drawing instructions

Because the width of the 4.3-inch RGB screen is more than 10cm, the width is shortened to less than 10cm when the artboard frame is made, and it is guaranteed to be able to proofing for free.

The PCB of this project adopts double-layer PCB layout, using two formations of AGND and GND, which are connected by 0 ohm resistors.

The PCB of this project adopts double-layer PCB layout, using two formations of AGND and GND, which are connected by 0 ohm resistors.

The physical diagram of the PCB and the functions of each interface are described as follows:

In another PCB file, a dimension drawing of the base plate is provided, and the acrylic base plate can be customized, and then fixed on the back with copper pillars for some protection.

 

Instructions for using the feature

1. Description of the function of the oscilloscope.

The overall UI interface is shown in the figure, and all human-computer interactions are touched screens, which makes the operation more convenient. Note that the noise level of the sine wave shown in this figure is still quite large, this is because the power supply of the whole system at that time is computer USB, it may be that the ripple of the USB power supply is large, resulting in some jitter in the data converted by the ADC, but when it is replaced by lithium battery power supply, this phenomenon is much better!

Observe the UI interface, the upper left corner is the battery level display; The second is the AUTO button, when the waveform display density is too dense or too sparse, you can press the AUTO button, which can automatically adjust the ADC sampling rate and vertical voltage gain, and adjust the waveform to the appropriate state display; The MEASURE button can display the signal acquisition of two channels in a small window; The RUN button can start or pause sampling; The FFT button displays the spectrogram (amplitude spectrum) of the fast Fourier transform under the current channel; The UART button can switch the serial data viewer interface; Pressing the OUT button will display the window of the signal generator, which can adjust the output signal type, frequency, and peak-to-peak; The right part of the screen is the adjustment button for the oscilloscope signal acquisition parameters; The left and right sliders can adjust the vertical offset and trigger threshold of the waveform respectively; Finally, there is the rotate button in the bottom left corner, which you can press to rotate the screen.

2. Description of the function of the serial port data viewer

I integrated the functions of the serial port assistant on my computer into this instrument, which can adjust the baud rate and different data analysis display modes, so that the serial port assistant can be portable. In character mode, on the basis of receiving ASCII characters, the reception and display of arbitrary Chinese characters are also realized; HEX mode displays the received data in hexadecimal format; In waveform mode, the sender sends the frame format of "x,x,x,x\r\n", which can be parsed into a waveform display, and can support up to six floating-point waveform analysis (theoretically, ten channels are also possible, but the final effect may be buggy, because if there are ten channels of data, a serial port data is quite long).

In the attachment, there is a python program that generates a string of six sine waves and sends it to the serial port, which you can use as a test for the waveform mode of the serial port data viewer.

 

Software code description

1. Engineering structure

The App folder stores the oscilloscope function code file, the serial data viewer function code file and the signal generator function code file respectively. The Hardware folder stores various driver files.

2. Parameters

The relevant structs are defined under the OSC.h and Wave_out.h files, including almost all modifiable parameters of the oscilloscope.

It is very convenient to use Init_Oscilloscope functions to initialize and configure parameters such as sampling channel waveform color, initial sampling rate, initial signal gain, AC_DC, etc.

3. Screen touch

The 4.3-inch screen used in this project can support up to 5 simultaneous touches, but for easy control, this project is only adapted to single touch. As shown in the program in the figure below, touch_judge this variable is equal to 1, it means that the screen has been pressed, and then the touch_x and touch_y are judged in the area, and finally determine which position is pressed, and then run the corresponding function function. According to the different touch priorities of each button, the judgment of the touch position is placed in the timer interrupt service function and the corresponding function function respectively. Due to the lack of skill, I feel that this way is still a bit dull (or have to be LVGL?), welcome the big guys to give advice, share and share a more concise and convenient way of writing.

4. The serial port data viewer realizes the method of receiving Chinese data display

Because it is more in line with language habits, we sometimes use Chinese to debug serial port data, so this project saves the font information to the SPI_Flash on the board of Liangshan Pi, and adds the function of receiving and displaying Chinese serial port data, which has the functions of baud rate adjustment, data parsing mode adjustment, start/stop monitoring data, and emptying the window. The Chinese display is shown in the figure below.

The steps to flash the font into the SPI_Flash are very simple, just prepare a 16G or 32G TF card (I haven't tried other capacities, I don't know if it works), insert the card reader and connect it to the computer, create a folder called FONT in the root directory of the TF card, and unzip the font file (provided in the attachment). Store it inside, then insert the TF card into the TF card slot of Liangshan Pi, flash the Chinese font library flashing program in the attachment, and reset it. Then use the serial port assistant on the computer to monitor the real-time status of the font flashing, the whole process takes about a minute or two, when the FLASH font_init success! is finally received, the font is completed, so that the serial port data viewer can receive and display the Chinese data!

5. Screen refresh

This project uses EXMC to refresh the screen data,After initializing the parameters of the screen display,As long as the screen cache data stored in the external SDRAM is modified,The screen data will be automatically refreshed,The user does not need to refresh manually,It is very convenient,And the frame rate of the display is also very high,Liangshan Pi comes with RGB fpc interface,You can use the cable to connect it to the RGB interface of the screen,It is also very convenient.

Since the waveform and some components are superimposed in the grid, if you call the screen display function every time you change the content of the screen, the waveform will flash and flash. Why is that? If you first refresh the waveform grid (grid) to the screen, and then refresh the waveform to the screen, then in the process of grid refresh, the original displayed waveform will be overwritten, resulting in a moment when there is no waveform on the screen, at this time, the waveform is refreshed to the screen by you, and the waveform appears on the screen again, so the waveform disappears for a period of time, and is displayed for a period of time, resulting in the phenomenon of flashing and flashing. In order to deal with this phenomenon, a double cache method is used here, cache 1 is used for the refresh display of the screen, cache 2 is used for the temporary pixel data modification of the screen, when the display needs to be updated, the cache 2 is transported to the cache 1, but here is more rough, directly with the way of copying, such shortcomings are also obvious, it will block the operation of the CPU (800 * 480 screen pixels), reduce efficiency, so, welcome to give advice, Share a more efficient display (such as two caches take turns to switch to the screen display, I tried, but it didn't work, crying dizzy~||.) ~)

 

End

Here, I am very grateful to JLC for providing us with such a good platform, which has greatly lowered the threshold of Volkswagen electronic design, so that more people's wonderful ideas can be turned into a physical object in front of us. Not to make money by selling boards, but to train Chinese engineers as its own responsibility, is the slogan of the development board of Lc, LC is talking, and has been practicing! At the same time, I am also very grateful to Mo Gong, Wu Gong, Chen Gong, Sister Tangerine and Xiao Xu, who have patiently answered many questions for me.

Design Drawing

Design Drawing

schematic diagram
1 /
PCB
1 /
The preview image was not generated, please save it again in the editor.
Empty
Project Attachments

Project Attachments

Project Members

Project Members

Target complaint
Related Projects
Change a batch
Loading...

Comment

Add to album ×

Loading...

reminder ×

Do you need to add this project to the album?

服务时间

周一至周五 9:00~18:00
  • 0755 - 2382 4495
  • 153 6159 2675

服务时间

周一至周五 9:00~18:00
  • 立创EDA微信号

    easyeda

  • QQ交流群

    664186054

  • 立创EDA公众号

    lceda-cn