LED TESTER R02 STM32F401 IPS 160x80px (Schematic Overview) | Part 1
Introduction
This article is an outline of the tester project development process. You can see basic features of LED TESTER device, testing, issues resolving and new features implementation in second board revision 😎
Revisions
3D Top and Bottom View

Structural Diagram
| Attention: real device has changes an opposite to the initial diagram (removed battery supply option, vibration motor). |
Schematic
| Attention: schematic has issues, that described below (MOSFET driver, buzzer back EMF diode, etc.) ! |
MCU
The previous microcontroller had too small memory size and due to using HAL SDK the resources was not enough for convenient developing and working with heavy display libraries (fonts and icons, strings). So, now it's Cortex M4 STM32F401CCU6, that used on "Black Pill":
- FLASH: 256kB
- RAM: 64kB
- HCLK (MAX): 84 MHz
- ADC: 12-bit, 2.5 MSPS
- Package: 48QFPN
The resources of this MCU is completely sufficient to operate with color screen, do floating point calculations, generate PWM-signal with pretty high resolution and even flash firmware with using USB DFU mode (last feature not implemented in this release)!

Basic components for MCU
On the tester's board mounted crystal 25MHz, same as «Black Pill».
In this version boot mode configured to main flash memory.
Capacitor C2 0.1uF tie RESET pin to ground to reset controller at power on, then capacitor charging through R8 4.7 kOhm to supply voltage 3.3V and controlled starting work.
Connector for programming/debugging with Serial Wire Debug (SWD) interface.

IPS Display
Previous version has one-color OLED screen SSD1306, so PLS-2.54-4 connector added just in case, the main problem was insufficient resolution 128x32. In the current version with same same cost the color IPS display with higher resolution ST7735 screen is installed:
- Type: IPS
- Size: 0.96 inch (16:9)
- Resolution: 160 px × 80 px
- Colors: 65535
- Driver: ST7735

Brightness regulation not used due to transistor and connector courtyard overlap on the board.
Voltage USB Input
Of course, the USB Type-C used for charging battery. Resistors 5.1k give a chance to get 5V from USB Power Delivery (PD) chargers.

It's recommended to add also TVS diode 5Vrm to the VBUS and increase capacity 0.1uF -> 1uF.
Note: Incorrect labels: SBU2 -> CC2; CC2 -> CC1
Note: shielding (body) it's recommended to connect to ground and it should have a pin on symbol.
Step-up (Boost) Converter

IRL640S (instead of VT4 IRL640 on the real board):
- Vds = 200 V
- Rds = 0.4
- Qg(MAX) = 40 nC
- Ciss = 1100 pF
- Vgs(th) = 1 V (MIN) – 2 V (MAX)
For protect transistor against Vgs overvoltage TVS diode VD2 SMBJ170:
- Vbr = 189 V
- Vrm = 170 V
- Package: SMB (DO-214AA)
Diode VD1 usually is Schottky, but in my case it's US5M
- Vreverse = 1000 V
- Ipeak = 5 A
- Vdrop (5A) = 1.7 V
- Trecovery = 75 ns
Current Measurement
Due to low expected current (up to 100 mA — 150 mA maximum), and high output voltage for measurement the current we need only resistor-shunt (without additional amplifier), that uses for monitoring the output current. It's required using to use high-power resistors, R31 10 Ohm it's shunt, the R17 resistor used to limit minimum output current, because output voltage is non-zero, even if pulse width of PWM signal is zero. Zener diode limit output voltage at 3.3V to protect ADC input.

Buzzer(need modifications)
Passive beeper is used for sound notification (as on a multimeter), this can be used for buttons, high voltage or battery notifications. For protect transistor against reverse EMF in additional in parallel to buzzer is installed on the board later.

MOSFET Discrete Driver* (need modifications)

This circuit could pass through current (through VT7 and VT10)Â
Controlled Voltage Divides*Â (need modifications)
One high voltage divider used for monitoring (dividing by 2), also Zener diode 3.3V limit output voltage to protect ADC input of microcontroller. Note, that controlling transistor must have high drain-to-source voltage (about 300V).
Second battery voltage divider used for monitoring battery voltage, the divider also could be turned-off to reduce consumption power.
NOTE: CTR_BAT_VOL should be always connected to ground to prevent ADC input overvoltage.
NOTE: VT3 should be always enabled to prevent ADC input overvoltage.
NOTE: now VT3 used as schematic of capacitor's high voltage discharger.

Li-ion Charger (NOT USED)
The most widespread in DIY electronics TP4056 controlled used for charging Li-ion battery with current up to 1 A with two LED indicators.Â

I forgot to connect CHRG and STBY pins to microcontroller in this version, but actually it's not critical, because I decided to eliminate battery powering at all.
Battery Holder (NOT USED)
The surface-mounted holder from KLS for one 18650Â cell mounted on the back side of board. This holder hold the battery very well, but it is difficult to insert it and remove it. It additional TVS diode added to protect against reverse polarity (enough for a few seconds, could be replaced by ordinary diode).

Control Buttons
Buttons, that I used good and cheap, easy to mount, but uncomfortable to use, because the device is held like a pen.

In my case it's much better to use right-angle buttons, that can be pressed by finger, so I solder new buttons on the old footprint place (see below).
Printed Circuit Board
Bare Copper
Artwork (TOP and BOT sides)

- Copper layer count: 2
- Sizes: 115.6 mm × 20 mm
- Thickness: 1.6 mm
- Material: FR-4
- Color: Green
Assembly
The most of components are 0603, but footprints are for 0805:
![]() | ![]() |
FPC connector pins soldered using soldering iron:
![]() |
Powerful MOSFET soldered using higher temperature:
![]() |
After manual soldering double check the soldering quality by visual inspection:
![]() |
Problems, that I faced and their Solving
💊 High residual voltage
The first issue, that I knew will be, it's high output residual voltage, at the output capacitor. When step up converter enabled by button pressing the low input voltage (from battery) convert to high output voltage and without load it can damage the tested MOS, due to high voltage, even if the no buttons pressed (because discharging process is slow without load, you can see in on the graph from STM32CubeMonitor).
✔ Solve
Temporary, instead of voltage divider controller the discharge resistor connected to MOSFET (with high VDS of course).
When button is released the output voltage connected to the 10 Ohm resistor to discharge the electrolytic capacitor (in period approximately 20-50 ms).
And now fall time to safety voltage value is extremally small, in comparison to initial ?

🔽 Inconvenient buttons
Up-pressed button inconvenient for pen-device, like that, also the other componentÂ
✔ Solve
Change button to right angle, so now other components don't bother pressing a button and it's good to press it, when  it lies in the hand like a pen.
🔋 Big battery powering
Due to big sizes, high weight it's not coinvent to hold device. Also battery powering increasing of schematic complexity, because need ORing, charger, battery monitoring circuit and low-power mode to minimize s standby current.
✔ Solve
I've decided to make the device USB-powered instead of battery/USB powered. Just a single wire to the battery bus. Also it's good to remove charger and other battery related components.
Sources
Will be published after R03 release.
Conclusions
| 🟢 | This revision (second R02) give a change to realize, that battery supplying is not very comfortable, because it much more increases the complexity of the device and make it large and heavy (due to using 18650 Lion battery), so I've changed powering to USB and I think that make sense, because it's pretty easy to power with using widespread power banks. Moreover, boosting such low voltage like battery to pretty big value (100V and more) is hard and 5V USB makes the task much easier. |
| 🟢 | The LED TESTER will use just standard USB 5V, so nor QC or PD is required, that makes it universal and you can use default power bank. |
| 🟢 | I also considered using vibration motor (like each smartphone has), but then I've decided to use only buzzer (beeper), due to high current consumption of vibro motor, cost and difficult mounting, so sound notification with different tones is completely enough (maybe additional RGB LED in the next revision will not be redundant). |
| 🟢 | Because it works on STM32 MCU to flash firmware it's required special tool ST-LINK debugger or at least USB-TTL converter, that pretty hard and non user-friendly. But this particular MCU (and some other) has USB flashing feature, so I can't leave such important thing. |
- Comments

















