rKWfNznPA0

Multifunctional test pen

 
Overview
This design utilizes the CW32F030 portable multi-functional test pen.
The test pen operates by simply tapping and holding a node on the circuit board to perform a test. (Note: "晶" refers to a transistor, a general term for all electronic circuits
.) The initial idea:
In daily hardware debugging, the most frequently used instrument is probably the multimeter. Although multimeters are called "all-purpose," most of the time, we only need to use them for voltage and continuity measurements.
As a powerful tool for debugging, multimeters sometimes have some drawbacks and limitations, such as: large size making them inconvenient to carry; inability to directly reflect logic levels requiring manual judgment; and different models of multimeters having different threshold resistances for continuity settings. The most troublesome issue is that the COM probe of a multimeter usually needs to be grounded, but the PCB may not have a direct-plug hole for easily fixing the probe tip, thus requiring manual assistance with the "black probe," affecting operational flexibility.
Therefore, in 2022 I designed a "logic level test pen" to quickly measure the commonly used 3.3V and 5V TTL levels. At that time, I decided to make an "upgraded version". Time flies and it is now 2023. My idea for this test pen has gradually improved in my mind. With the support of the "CW32 Ecosystem Community", I decided to turn this design into a physical product.
II. Initial Conception
My expectations for this test pen are as follows:
1. Voltage measurement + threshold judgment: The threshold level can be set to meet different logic level scenarios, while retaining the useful traffic light indicator function of the "simple logic level test pen";
2. Continuity measurement: The threshold resistance can be adjusted as needed (this is a feature only found in multimeters costing thousands of yuan, and I want to add it to my test pen);
3. Diode measurement: Measure the conduction voltage and light up a diode (Note! Not a transistor!!!);
4. PWM output: Convenient for providing a known quantity to test the system in some scenarios, and can also be used to test passive buzzers, etc.;
5. PWM input: Can measure frequency (and even perform simple decoding and display of serial port data, although this is not yet implemented due to current technical limitations);
6. DC output: Simulate a required DC level for testing (Thanks to Professor Li for proposing this requirement; I have found it very useful in use).
7. It can be connected to an expansion board for measurement (ideas for expansion modules are also welcome).
I also plan to open-source this project so more people can use it or modify and redesign it according to their needs. Therefore, I have paid extra attention to the following points:
1. Limiting the PCB length to within 10cm, so that everyone can "get" the PCB from JLCPCB for free.
2. All resistors and capacitors use 0603 packages, and LEDs use 0805 packages, making it easier to solder during your own construction (on the one hand, many people find 0402 components difficult to solder, and on the other hand, 0402 components generally do not have silkscreen markings, making it difficult to check if you solder incorrectly).
3. The project will strive to control costs (often, when making things for oneself, one might increase costs for precision or appearance; to facilitate replication of this project, a balance between functionality and cost will be sought).
III. Circuit Module Design:
When designing the test pen, I divided the overall design into five parts:
analog front-end
power supply and battery management
, microcontroller and peripheral
display screen , and
human-computer interaction (excluding other interactions on the display screen).
Based on a modular design approach, we can be more organized when drawing circuit diagrams and can roughly distinguish the layout according to modules during PCB layout, facilitating routing and other operations.
The circuit module design in this project is a common mixed-signal circuit design, applicable to many similar projects.
In the battery management, power supply, and microcontroller circuit modules, this project will strive to adopt standardized designs to improve the readability and replicability of the project's circuit diagrams.
IV. Circuit Design:
We will refine the design of each part according to the requirements to achieve the established goals.
Below, I will explain my design and design ideas in detail with the circuit diagram and PCB layout.
1. Power and Battery Management
1.1 Charge and Discharge Management
In the charging IC section, I chose the commonly used TP4057 as the main controller. The power input uses the most common Type-C interface. Although a 6-pin interface would be sufficient for this project, a 16-pin interface was chosen for scalability. The SBU1 and SBU2 pins of the Type-C interface were used for expansion board connections. D+ and D- were not used as expansion lines because the output signal of the device might cause the charger to misinterpret the signal, resulting in an incorrect voltage and potential danger. This needs to be considered in the design.
2. Microcontroller and Peripherals
2.1 The CW32 microcontroller core system
is a standard microcontroller core system configuration. Since this project does not require a high-precision clock and low-speed crystal oscillator for long-term timing, this part of the circuitry is omitted (it is drawn here, but set not to be transferred to the PCB or imported into the BOM, mainly so that it can be directly copied and used in other projects, primarily for CV engineers).
This project does not use a bootloader for programming, so the BOOT pin is directly pulled low (the standard drawing method can be found in the commented-out section; due to limited PCB space in this project, it is directly grounded). The SWD interface is PA13 and PA14, which are brought out using 1.0mm pitch headers in this project; however, in actual... No soldering of header pins is required during use; simply use a probe (an adapter board for probes is included in the project) to press against the interface to perform downloading. The header pinouts include SWD, RST, and MCUVCC, facilitating debugging. (The reset button on the PCB cannot be SMT soldered because the surface mount pads and header pin through-hole pads are reused, and reflow soldering will cause solder leakage, resulting in cold solder joints or even short circuits! The reset button is designed to be soldered after programming is complete, ensuring no further programming is needed. It can both block the header pin holes (yes, I have OCD) and function as a reset button (seems obvious). Even without soldering, a reset operation can be performed by shorting the RST and GND holes using tweezers or other metal objects.)
2.2 User Operation Input
The user operation section of this project uses a five-way joystick switch, which can be understood as equivalent to five ordinary button switches. Programming it is also done as ordinary buttons.
The functions corresponding to the joystick switch in different directions will be explained in the program section and will not be repeated here.
2.3 Display Screen
This project uses a 0.96-inch TFT display screen with a resolution of 80*160. It uses an ST7735 display driver chip and is connected to the PCB via FPC soldering, communicating through an SPI interface.
2.4 Other Human-Machine Interactions
As shown in the figure above, the multi-functional test pen has two LEDs, one red and one green, for level indication. Green indicates a low level, and red indicates a high level (pay attention to the LED color during soldering). Both LEDs are connected to the MCU in current-sinking mode (Note: the LEDs and the display screen work simultaneously; the LEDs act as quick indicator lights, allowing users to easily determine the current status using peripheral vision).
A passive buzzer is used for additional indication (such as continuity testing) to enhance user experience. It's important to note that a passive buzzer is used here; an active buzzer cannot be used (given its small size, conventional active buzzers are not available).
Also note that a 200Ω resistor is connected in series in the buzzer's power supply to limit the current. If you find the buzzer's tone too soft or too loud in actual use, you can replace this resistor, but the resistance value should not be too small, otherwise excessive current will pull down the system voltage, causing malfunctions!
There is also a side-mounted LED as a pen tip light, convenient for testing in relatively dim environments such as inside the casing. The current-limiting resistor can be replaced to adjust the brightness to your needs.
2.5 Bluetooth BLE
To facilitate connection between the pen and a computer or mobile phone, I chose to use Bluetooth BLE technology for wireless data transmission.
The main reasons for not using the more common CH340 serial-to-USB direct connection are as follows:
① The data cable has a certain weight and rigidity, and dragging the data cable during operation is less flexible than wireless operation;
② It is not recommended to use the device while the data cable is plugged in, as this will cause the floating ground of the test probe to become grounded, which may cause a short circuit during testing (the specific reasons will be analyzed in the analog circuit section);
③ The most important point: safety! If a high voltage is input to the test probe due to operational error, and the microcontroller burns out due to the failure of the protection circuit, this high voltage is very likely to be directly input to the mobile phone or computer along the data cable, causing serious damage!
3.1 Basic Design of Analog Front-End
Although this project is not to build a 10G oscilloscope (and I cannot build one at present), the design concept of analog front-end is similar, namely: what kind of signal will I collect, and what kind of signal will my device collect? If this is difficult to understand, let me give an analogy: I can hear English, but I only understand Chinese, so: I need a translator, and this translator is the "analog front-end" we need.
Let's return to the test pen project. My design goal for the system is as follows: it should be able to acquire signals from 0 to +15V and output signals from 0 to +5V. Okay, that's the most basic goal I need to achieve, isn't it simple?
However, this project has a special case: I want to complete all input and output functions on a single probe (I'm clearly a demanding client), which requires switching between input, output, and other states. At this point, some clever colleagues will immediately think of relays. Yes, relays are indeed very useful in this scenario, but they bring another problem: size. As this project is a portable test pen, I naturally don't want to make the device too big (it's inconvenient to use if it's too big). Relays are not suitable in this situation, so we need to introduce another switch, which is an analog switch.
3.2 Analog Circuit Power Supply
Based on the HT4053A we selected, its maximum operating voltage is 18V. To allow for some margin, I designed the system voltage at 17.5V. Since the front-end voltage is directly powered by the battery, with a voltage of approximately 4.2V~3.5V, we need a boost circuit to power the analog front-end.
For chip selection, I chose the commonly used MT3608 chip. Its 2A output current is sufficient, and its relatively high switching frequency of 1.2MHz also helps with subsequent filtering. The boost inductor is a 4.7μH inductor in a mini SMD252010P package (2.5*2.0*1.0mm), which helps save PCB area (and is also more aesthetically pleasing). Although small in size, it has a rated current of 1.6A and a saturation current of 2A, which is sufficient for the system. Regarding the configuration of voltage divider resistors, although it may seem arbitrary, there are certain considerations. An inappropriate configuration will affect the power supply's output voltage ripple and load regulation performance. However, due to space limitations, this will not be elaborated upon here; interested students can consult relevant materials for further study.
It is important to note that this project does not use dual power supplies; that is, there is only a positive power supply and no negative power supply. Therefore, the test probe can only input/output positive voltage signals. If a negative signal needs to be input, the subsequent circuitry will also require some modifications. For size considerations, this project ultimately decided to use a single power supply solution.
3.3 Signal Input
/Output Circuit V. Hardware Soldering and Assembly
Hardware assembly involves many sequences. Mastering good soldering and debugging habits will help you save time and quickly locate problems. It also facilitates recording complete and detailed test reports, making it easier for software engineers to conduct independent testing and later hardware/software integration work (and also preventing software engineers from blaming hardware problems).
5.1 PCB Soldering
There is a specific order to PCB soldering. It's not that you can just solder everything at once. If you solder everything at once, it will be more difficult to pinpoint the problem if something goes wrong. Also, if the problem is with the power supply, it could damage a large part of the circuit. Below, I will introduce the recommended soldering and testing sequence for this project:
① Solder the Type-C interface and charge/discharge management circuit. Solder the battery to test the charge/discharge management circuit, and remove the battery after completion.
② Solder the power-on/off circuit and the five-way switch. Press the long button to test if the power supply outputs normally.
③ Solder the analog power supply and test if it is normal. If possible, test the output ripple.
(★Remember to solder the power supply first and complete the test before soldering the subsequent circuits to prevent power supply problems from affecting the entire circuit.)
④ Solder the analog switch and the analog switch control signal level conversion circuit. Manually apply a signal to test the level conversion.
⑤ Solder all analog front-end circuits and apply an analog signal to test the AIN test point voltage
. ⑥ Solder the microcontroller and red/green indicator lights. Then, you can burn the program and observe if the power-on is normal.
⑦ Solder other peripherals, pen tip, and tail plug (the soldering method can be found in the "Hardware Assembly Instructions" section).
⑧ Solder the display screen.
It is recommended to follow the above order for step-by-step soldering and testing. Even if you encounter component failures or other problems, you can quickly locate the problem.
Of course, if you don't want it to be that complicated, here's a summary of the soldering order: power supply (AVC test points), analog front-end (AIN test points), microcontroller and peripherals, and if you're used to using a hot air gun like me, you should use a soldering iron last to solder components that are easily damaged by the hot air gun: buzzers, displays, etc.
test_pen-master.zip
PDF_Multifunctional Test Pen.zip
Altium Multi-functional Test Pen.zip
PADS_Multifunctional Test Pen.zip
BOM_Multifunctional Testing Pen.xlsx
97101
RZ7889
A dual H-bridge DC motor drive designed using the RZ7889. Verified.
Working Principle: The RZ7889 is a single H-bridge DC motor driver. This project uses two of these chips to implement a dual-channel motor drive.
       Function: This module receives pulse signals from the I/O pins and controls the motor's direction and speed based on these signals.
                  The module's size and pin definitions are completely identical to the A4950 module, making it a direct replacement, and the chip is cheaper.
Operating Conditions: (See attached datasheet for details) Voltage 3-15V, Current 3-5A;
 
Physical Image:
 
RZ7889.pdf
PDF_RZ7889.zip
Altium_RZ7889.zip
PADS_RZ7889.zip
BOM_RZ7889 (A4950 Alternative).xlsx
97102
LCSC - Oscilloscope (To be completed)
Note that the specific information in the BOM (Bill of Materials) should be referred to the annotations in the schematic diagram!
The hardware schematic diagram shows the annotated circuit details, and
the software is developed using the standard library.
This project is a dual-channel oscilloscope based on the STM32F103C8T6. Due to the author's limited capabilities and unwillingness to directly use readily available "ready-to-use" code, the project completion period may be long, but the author will do their best.
The STM32F103C8T6 has a maximum clock speed of 72MHz and includes: 64K*8bit Flash, 20K*8bit SRAM, two 12-bit ADCs (12 channels total), one advanced timer TIM1, and three general-purpose timers TIM2, 3, and 4, etc.
An additional purchased module is a 1.8-inch 128*180 TFT screen.
The hardware project files contain the self-made board and examples provided by Hardwood Classroom. Hardware modifications include replacing all operational amplifiers with LMV321-TR (note the difference from "LMV321"; their power supply voltage ranges are different, and only the LMV321-TR is suitable for the ±12V power supply application in this project).
The software is developed using the standard library.
 
Currently implemented functions
: 1. Display the frequency of the measured signal;
2. Display a fixed background on the screen (hardware SPI1, to be ported or board pins modified);
3. Button control relay to select the magnification and display the corresponding magnification on the screen, initially defaulting to X10 magnification;
 
Short-term plans:
1. Port the screen from SPI1 to SPI2;
2. Implement DMA transfer to refresh a specified screen area;
3. Implement peak-to-peak and average value measurement;
4. Draw waveforms (data stored in an array and then displayed as dots?);
5. Modify the unit length of the encoder's horizontal and vertical axes (one encoder controls one channel, by detecting "press," the corresponding modification amount flashes to select whether to modify ScaleX or ScaleY, while the screen updates the unit length information);
6. Self-built Chinese character library, with button selection for Chinese or English version;
7. Add an acrylic panel shell;
 
Further vision (to be done depending on time and capabilities):
1. Reselect the main control chip, with sufficient resources and cost reduction as much as possible
; 2. Store waveform information on an SD card (c8t6 does not have an SD card interface);
3. Run the system? I haven't looked into it in detail yet (it seems the oscilloscopes in the lab all run operating systems?) (FreeRTOS and UCOS);
4. Low-power mode when not in use?
WeChat_20231120141034.mp4
LCSC - Oscilloscope.doc
Ming-LCSC Oscilloscope Code - No Portable Screen Flying Wire Version.zip
PDF_LCSC - Oscilloscope (To be completed).zip
Altium_LCSC-Oscilloscope (To be completed).zip
PADS_LCSC-Oscilloscope (To be completed).zip
BOM_LCSC-Oscilloscope (To be completed).xlsx
97103
electronic
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2026-03-28 10:34:28

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号