This project implements a hardware device that can monitor computer status in real time. It has a 4.3-inch LCD color display that can monitor the real-time status of the CPU, memory, hard disk, and graphics card in real time, making it easy to grasp the load of the computer's main hardware. It is not only suitable for gamers to understand the bottlenecks of the system, but also suitable for observing whether there are illegal background programs that occupy computer resources for a long time (such as mining Trojan programs).
At the same time, this project is also suitable for use as a secondary screen for chassis beautification. This project uses a solution in which the host computer cooperates with serial port communication. It only needs one TYPE-C connection cable to work. Compared with the existing solutions on the market such as small display screens with HDMI interface + system monitoring software such as AID64 , this project has the advantages of low cost, small system resource usage, convenience and flexibility. Although the HDMI solutions on the market are highly versatile, when used as a secondary screen, on the one hand, it will waste an HDMI interface and a USB interface for power supply. On the other hand, it will increase the pressure on the graphics card and waste system performance.
Finally, because the performance redundancy of the entire system is relatively sufficient, in the hands of developers, this project can also be used as an open source embedded GUI development platform.
The hardware part of this project is 100% designed using Lichuang EDA.
Because the software and hardware of this project are completely open source, you can freely browse and download the resources of this project, or conduct secondary development on this basis. But commercial use is prohibited
This project is made public for the first time and is my original project. The project has not won any awards in other competitions.
This project is completely open source, including PC-side host computer code and MCU-side code. Distributed using GPL3.0 license. Commercial use prohibited.
The first is the issue of face. For practicality, we need to try to display as much content as possible on one screen, so we cannot use a screen that is too small. However, it is not good to have a screen that is too large. On the one hand, a too large screen will increase the difficulty of DIY and increase the production cost of the entire system (the cost of the screen, the cost of PCB proofing, the cost of the control system, etc.). On the other hand, it will also This results in a waste of desktop space and reduces compatibility with the chassis when used as a secondary screen. After comprehensive consideration, I chose a universal 4.3-inch LCD display with a resolution of 480x272, the panel material is TN, and the hardware interface is RGB:
Such displays are the de facto standard for commercial displays and are readily available on the market at very low prices. It can even be disassembled from various scrapped devices (such as various media player devices).
Although the resolution of 480x272 is not high, it is sufficient in this system. The size of 4.3 inches makes the cost of driver board prototyping very cheap, and at the same time, it ensures that sufficient content is displayed without appearing too big or too small.
Since this type of display uses a constant current backlight system, we need a constant current backlight drive circuit. Here, I chose the PT4103 LED constant current driver IC. PT4103 is a boost-type LED constant current driver IC, which has the function of open circuit protection and supports PWM dimming. It can work normally in a 3.3V system and can fully meet the needs of this project.
Regarding the selection of the driving current, I did not follow the setting on the screen data sheet to make it work at 20mA, but set it to 10mA, which can protect the backlight and reduce the power consumption of the entire system. After testing, there is not much difference between the backlight brightness of 10mA and 20mA. But if you use an IPS screen when making your own, you should use the standard 20mA drive current.
Since the screen uses an RGB interface, and for embedded systems, the resolution of this screen is already quite high. Therefore, in order to drive this screen while ensuring the smoothness of the entire UI system, we need an MCU with higher performance. Because when this project was established, the world was in a state of "core shortage", and various types of MCUs were either out of stock or prices soared. After comprehensive weighing, the STM32F746ZG MCU was chosen as the core of the entire control system. This MCU has an LTDC controller, which can easily drive a display with an RGB interface. At the same time, the MCU also comes with a DMA2D accelerator, which can accelerate the drawing of the UI system and ensure the smoothness of the interface. In addition, since this MCU is relatively unpopular, the price is still acceptable.
Since F746ZG is positioned as an economical MCU, the internal SRAM cannot meet the video memory requirements of the screen, so an SDRAM model number W9825G6KH is also added here as system video memory. In actual production, any SDRAM with a capacity of 8M or more and a speed of 108MHz or more can meet the needs.
This project uses the MCU's built-in Flash to store all code + resource files, but for later function expansion, an additional NOR Flash expansion circuit is reserved. If you do not need to develop advanced functions, this section can be omitted:
In order to communicate with the host computer, we need a USB<->UART bridge chip. Here, we can use the classic CH340E interface chip, which is cheap, stable and performs well. An additional RGB light is designed in the circuit, which can be used to indicate the communication status.
Related circuits (in order to prevent accidental short circuit or overload, a self-restoring fuse is also designed)
The power consumption of the entire system is not large, so using the classic LDO: AMS1117 can meet the needs:
This system is designed with 4 touch buttons to provide control of the entire system. All four buttons are universal, and their functions are determined by the UI interface where they are located:
The design of RTC crystal oscillator and backup battery ensures that this device can also be used as a desktop clock when the computer is shut down:
In the early ideas, the buzzer alarm function under high temperature and high system occupancy was considered. In actual use, it was found that this function was too useless (and annoying), so this function was removed from the final code. However, considering possible future functional development, the relevant circuits are still retained in the hardware design:
In order to save costs, this project is a double-layer PCB design. If you have more budget during actual production, it is recommended to use a 4-layer board and make the SDRAM traces equal lengths.
Top layer (back)
Ground floor (front)
3D simulation diagram
Description of each part
This project is developed using the free IDE officially launched by ST: STM32CubeIDE and the STM32 HAL library. The development language is C language. The compiler is the GCC compiler that comes with the IDE.
Compared with Keil, CubeIDE's code editor is more friendly and cooperates more smoothly with STM32.
Because this project involves communication with the host computer, the open source FreeRTOS system framework is used to facilitate development. The system is designed with a total of four threads: UI main thread, communication thread, key scanning thread and buzzer control thread (obsolete and reserved only for compatibility) to complete the function together. The specific information of the threads is as follows
The UI system, as the end point of host computer development, uses the open source LVGL library to implement:
LVGL is a powerful embedded UI framework that can provide a UI display experience comparable to high-performance mobile devices such as mobile phones in embedded systems with memory no more than 1M.
In this project, the structure of the UI system is as follows:
The standby interface is the interface displayed when the system is powered on but not connected to the PC host computer. At this time, the displayed content is the clock. Because most PC motherboards can be designed to continue to provide power to the USB when shut down, this feature allows the device to still be used as a clock after shutting down. After powering on for the first time and establishing communication, it will automatically jump from the standby interface to the overview interface. However, after disconnecting from any other interface and entering the standby interface, when the connection is restored again, it will automatically return to the interface displayed before disconnection.
The wallpaper of this interface can be replaced in code.
After successfully establishing communication with the host computer, the system will automatically jump to the overview interface. In this interface, you can use icons to view the main status of the CPU, memory, hard disk and GPU at the same time, such as CPU/memory usage, hard disk Activity time ratio, etc. There is a status bar at the top of all interfaces except the standby interface. In addition to displaying the functions of the corresponding four buttons in the current interface, the status bar also provides a system time display function (this is very useful when running full-screen programs such as games).
In this interface, you can select the corresponding chart to enter the detailed viewing interface to display more and more detailed data about this hardware. Shown here is the name of the CPU, usage, speed and temperature over 300 seconds:
In the overview interface, you can also enter the settings interface to set the screen brightness:
The PC-side host computer part is the biggest difficulty in the development of the entire system, because it needs to obtain the status of the hardware and transmit it to the device side, and reading the hardware information is already a relatively low-level part and is not explicitly provided in the operating system library. API for various operations. I didn't have similar development experience, so I was at a loss when I first started. After trying the driver method and WMI query method, I accidentally discovered the open source OpenHardwareMonitor project. This project provides a convenient API framework that can access underlying hardware driver information, and provides a sample WinForm program, which makes the development The difficulty is greatly reduced.
Finally, the host computer part of this project was developed using C#, and the OpenHardwareMonitor project was used as the underlying driver framework. Because the host computer does not need too many functions, we gave up WPF in the choice of UI framework and used the classic WinForm framework to minimize system consumption, speed up startup, and prevent the monitoring software from occupying too much of the system. resource situation.
The development environment uses the classic Visual Studio 2019 Community Edition. There is nothing more suitable for developing programs on Win.
The interface of the host computer is very simple. Just select the serial port where the device is located and click Start Service/Stop Service. This interface can be completely hidden in the system background and only displayed in the system bar.
As you can see from the task manager, the final software running consumption is very small:
It should be noted that because access to the underlying driver is required, administrator rights are required to run the PC-side service.
FreeRTOS - Market leading RTOS (Real Time Operating System) for embedded systems with Internet of Things extensions
LVGL - Light and Versatile Embedded Graphics Library
Open Hardware Monitor (github.com)
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet