
Touch Screen Mini Electronic Load
PROTouch Screen Mini Electronic Load
License
:CC BY-NC-SA 3.0
Description
Project Updates
2023/11/2
Change the value of some resistors and capacitors of the power board, and merge some resistors and capacitors of different brands. Re-upload the list, does not involve PCB re-punching.
2023/11/22
The core board was updated to V2.0, and the original version of the power IC has been overloaded and used, which may have hidden problems.The replacement board doesn't match the original inner case very well, and you need to manually chip off a bit of material at the bottom position if you want to use the previous inner case.The core board changes are as follows:
- Remove the serial port pins on the usb side and replace them with regular usb wiring, remove the serial port select dipswitch, and remove the ch340.
- Add wifi bluetooth module to communicate via serial port.
- Remove the on-board speakers and replace the amplifier circuitry to increase power and provide 2p terminals to access an 8-ohm 2W speaker.
- Replace some of the io pins.
- Replace the power supply IC, the output current can be up to 1.2A.
This is a black edge full screen CNC electronic loadmeter, the shell is resin 3D printed, the whole size is 54x88x84mm. Because the shape is similar to a computer mainframe, I named it Xiao Shou1, abbreviated XS1. XS1 provides a typec port for communication as well as power supply (5V2A power supply is recommended), and also has a built-in 18650 power battery, while power supply is prioritized to use external power. The screen is a 3" 480x854 high resolution capacitive touchscreen.
Note:this project does not focus on cost-effective, mainly for learning and research. Compared with the same type of electronic load, the cost is about 50 dollars more, mainly touch screen cost.
Project parameters
Dimensions: 54x88x84mm (WxLxH)
Interaction:3" 480x854 TFT screen, capacitive touch, 2 light touch switches
Power supply: typec interface 5V, built-in 18650 battery
Load interfaces:typec port, xt30 port
Sampling range: voltage 0-60V, current 0-4A
Load capacity:constant current 0-4A, error <0.04A | constant voltage 0-48V, error <0.2V | constant resistance 1-1000R, error <5%, constant power 0-100W, error <5%
Carrying power: long time running 30W, short time running 100W (10S)
Protection mode: over-current protection, over-voltage protection, over-temperature protection, reverse connection protection
Open Source Protocol
This work is licensed under the Creative Commons Attribution-ShareAlike License CC-BY-NC-SA 4.0, please do not use it for commercial purposes, and please cite the source when reproducing it.
Project Introduction
1. Hardware
The PCB board is divided into two pieces, a core board and a power board, which are connected by a double row of pins.The layout of the two boards is slightly compact, and the resistor capacitance is basically a 0603 package with a 4-layer board design.The main control adopts SWM34SVET6 from HUAXIN MICRO, CortexM4 core with 8MSdram, which can drive the display with RGB interface.The core board mainly includes circuits such as MCU main control peripheral, power supply and charging/discharging, speaker, usb and serial communication, and display.The power board mainly includes load interface, PD protocol circuit, fan driver, analog sampling, MOS tube driver and feedback circuit. The core board can have a complete interface and can be used independently as other core boards.
1.1 Frameworks
1.2 Structures
The whole machine is roughly divided into shell, PCB, fan, radiator, screw accessories and so on.The two PCBs are connected by a double row of pins and can be separated. Internal air is expelled towards the back via a fan, and all ports are on the back as well. On the front is a full 3" touchscreen.
1.3 Principle introduction and hardware analysis
Electronic load as a power consumption device in the whole environment, can be simply understood as a high-power resistance value adjustable resistance.The actual circuit is by adjusting the gate voltage of the mos tube and thus controlling its on current, while controlling the MOS through the MCU's DAC or PWM can achieve a more accurate output.
The common operating modes of electronic loads are constant current, constant voltage, constant power, and constant resistance modes. Among them, constant power and constant resistance are calculated on the input voltage and then fed back by current, the same as constant current mode.Constant voltage is through the voltage feedback to the gate voltage of the MOS tube, so hardware I designed two kinds of feedback circuits, current and voltage, and through the IO port of the MCU to control whether it is put into use.
1.3.1 Constant Voltage and Constant Current Driver Circuit
The driving circuit diagram in constant current mode is as follows, in the following figure, the CC_MODE pin of MCU outputs high level, CV_MODE outputs low level, Q3 conducts, Q2 cutoff, at this time, the current feedback circuit works, and the voltage on the sampling resistor in the load loop is amplified by the op-amp and enters into the IN-port of U5.3, and the DAC pin enters into the IN+port of U5.3, forming a stable output to Q4 [mos tube] gate.
The driving circuit diagram in constant voltage mode is as follows, in the following figure, the CC_MODE pin of MCU outputs a low level, the CV_MODE outputs a high level, Q2 conducts and Q3 cuts off, at this time, the voltage feedback circuit works, and the load voltage enters into the IN+ port of U6.1 after the signal is reduced by the differential circuit, and the DAC pin enters into the IN- port of U6.1, which forms a stable output to the Q4 [mos-tube].
1.3.2 Power supply circuit
XS1 provides a typec port for connecting the power supply, note that the power supply voltage range should not be greater than 6V, and it is recommended to use a 5V2A power supply for power supply.Typec power supply is inserted, 5V first through the built-in diode of Q13 into the back stage, at this time and Q13G pole ground (USB_GND connected to the TYPEC's pin 1, the use of TYPEC header characteristics of the 1 foot and 12 feet connected and grounded) so that the Q13 conduction, the voltage of the A point is close to 5V.Q12 is cut off due to 5V at the G-pole, the battery enters the back stage through the internal diode of Q12, and the battery is not in operation because of 5V at point A. When the typec power supply is removed, the G-pole of Q13 dangles and thus cuts off, and the G-pole of Q12 is then 0V, Q12 conducts, and the voltage at point A is close to the battery voltage. This circuit reduces energy loss compared to direct series diode connection. The rear stage realizes software shutdown through Q14 and key on through SW1 and Q8.
With an input voltage range of 3-5V, the rear stage uses a TX4310B charge-pump DCDC chip, which produces a stable 3.3V output voltage from a 1.8V to 5V input with an error of ±4% (which also results in the DAC output varying slightly with input voltage fluctuations).
1.4 Interface
All of the XS1's interfaces are centered on the back, as shown below.One of the two xt30 interface to form a 4-wire measurement method, the test power supply needs to be accessed separately positive and negative (V + I + connected to the positive pole, V - I - connected to the negative pole), the advantage of the four-wire measurement method is that the voltage and current are divided into two ways to go, the voltage acquisition does not go through the current loop, there is no voltage drop is more accurate.Or just use the typec connector (which has 2 sets of internal power supplies for V and I, which are not shorted up on the female chassis).If you need type-a ports or dupont cables you can make another interface board to extend the typec ports.The fan interface is on the power board and is a 2p terminal. The fan driver circuit supports pwm speed regulation, the current firmware uses IO level driver, it will be updated later, you can adjust the wind speed according to the radiator temperature.
The bottom typec port is mainly for power supply, usb communication, and serial communication, and its internal dp1dn1 is connected to the usb pin of the mcu, and dp2dn2 is connected to the ch340 which is the serial port function.This saves the usb port but sacrifices the forward and reverse plugging capabilities of the typec. The serial port is connected to the ISP serial port or debug serial port via a dip switch on the core board.There is also a sd card socket at the bottom with untested functionality.
1.5 Circuit diagram simulation
For more complex circuits with logic classes, it is recommended to try them out with simulation software first to see if the results are as expected.
2.Software
The mcu code is based on FreeRTOS+LVGL, ide uses keil uvision5.38, and gui is generated using SquareLine Studio, which is simple and efficient.
2.1 Firmware Updates
The core board leads to a USB port and a serial port, which can be used for IAP mode as well as ISP mode firmware update, which has not yet been realized in the code part. Firmware can be burned in through the swd interface on the core board using Jlink. Open the keil project, click compile and burn.
2.2 GUI interface
Interfaces are generated using SquareLine Studio, a visual drag-and-drop UI editor that makes it quick and easy to create beautiful graphical user interfaces for embedded and desktop applications.Animation effects can be easily and intuitively realized through simple settings in the software.
The above figure is the main interface, which is divided into sampling display, constant value setting, mode setting and waveform display.There are two ways to set the fixed value, directly press the "+1", "+0.01" button , or click the fixed value label will pop up the numeric keypad, you can quickly set the fixed value. The mode is multi-selected, and there is an indicator light under the selected mode.Two waveforms can be displayed.
2.3 Debugging Assistant
A debugging software written based on QT5 (the same debugging assistant that was used to make the soldering box before) is used to view the load sample values and signals as well as to calibrate and modify parameters.The software uses serial port communication, set the serial port number before use, default 115200, 8, 1, no parity.After connecting the device, click the "Connect" button to perform other operations.[mcu side code not adapted]
Read modification parameters
View real-time data
Calibration factor
View waveform
2.4 Code Analysis
The code is based on the FreeRTOS operating system and establishes four main tasks: load_task load output task, gui_task screen display interaction task, sample_task analog calculation task, and pc_task communication task with the PC.
The main introduction to load_task is that the task is timed via vTaskDelay(pdMS_TO_TICKS(20));it is executed approximately once every 20ms.After entering the while(1) loop, the loadFaultCheck() function is called first to check if there are faults such as over-temperature and over-voltage, and if there are, the output is stopped. If there is no fault, it will enter the corresponding mode to calculate the new DAC.The process is as follows:
MCU built-in 8Msdram, on the board I designed spi flash (w25Q64) and through the mcu's sfc interface to access, will be mapped to the mcu's storage space, so that some constants directly in the code defined in the spi flash.
2.5 Software Calibration
Although the charge pump chip TX4310B can have an input range of 1.8-5V, its output varies with the input voltage, with a 4% error. The ideal DAC has its output proportional to the set value, but in reality there is an error due to factors such as temperature operating voltage.Here mainly mentioned the operating voltage, the lower the operating voltage under the same set value the higher the dac output.
There are two types of solutions,one is to modify the power supply scheme on the hardware, use two 18650 batteries to make the inputs are above 5V, and then use a high-precision LDO to make 5V to 3.3V such as the AMS1117. the other is to calibrate it on the software, by sampling the operating voltage, converting the actual DAC drift voltage, and then counting the drift voltage in the setup.However, because the swm34s adc sampling is also affected by the operating voltage, it is necessary to compensate for the error, the overall performance of the constant current mode 0.1-2A in the error of 10mA (without taking into account the temperature drift factor).
3. Assemble
Put the keycaps into the inner case first, then fix the heat sink to the MOS tubes on the power board (the heat sink is pre-punched), and add heat-conducting pads between the heat sink and the MOS tubes.I use ceramic chips, which cost a little more.Note that the NTC resistor on the power board is going to touch the heat sink and can be coated with thermally conductive silicone grease.The two boards are connected by rows of pins and fixed to the inner case. Then the fan is placed in the corresponding position and fixed by inserting screws from the back. Finally the LCD screen is glued into the slot on the front of the inner case, and the fpc wires are connected to the core board from the bottom gap. Finally put on the shell, there is loose to fix the bottom with screws, need 2.5 screws.
4.Functions
It is mainly used as an electronic load, or can be inserted into the sd card to play music and pictures, built-in battery and clock chip can also be used as a desktop clock ornament.
4.1 electronic load
- Operating mode:
Supports constant current, constant voltage, constant power, and constant resistance modes.
- Fail-safe:
Support over-temperature shutdown protection, over-current shutdown protection, over-voltage shutdown protection, reverse connection protection. Fan is automatically turned on when the temperature exceeds the set value.
- Waveform display:
Two waveforms are displayed, and the sampled values can be freely bound, such as load current, load voltage, and heat sink temperature.
- Built-in battery:
Built-in 18650 power battery, high output current, can drive bigger cooling fan. usb port can charge the battery, charging current 0.5A.
- Digital full keypad:
The advantage of a touch screen for quick parameterization.
- Charger detection:
Built-in FUSB302 chip, support PD protocol control, with constant current mode can directly test the charger output capacity.Code not implemented.
- Voice prompts:
There is a built-in speaker that announces a voice in the event of a malfunction.Code not implemented.
5. Usage and testing
Connect the measured power supply through TypeC port or XT30, XT30 is 4-wire measurement mode. For power supply, it can be powered by usb or internal battery, press the power on button on the back to turn on the device, the screen will display the logo and enter into the main interface, select the corresponding mode and set value, press the start button. Press the shutdown button on the back to pop up the shutdown dialog box, you can choose to cancel or shutdown button.
Test video wiring is as follows, the test is a regulated power supply, in order to more accurately display the current, test constant current constant resistance constant power mode will be a multimeter selected to the DC current gear series into the circuit.Constant voltage mode is mainly used to test the load carrying capability of current source type power supplies or power supplies with current limiting protection (the power supply is in the maximum current output state, equivalent to a current source).I strung an armored resistor for current limiting to keep the power supply from burning out.Multimeter selected to the DC voltage block, note that previously measured the current to connect the pen back to the voltage connector.
Please see the attached video for specific use,
Project Reference
The project design before reading some open source projects, there are many gains. Part of the hardware circuit prototype has reference to the following projects. Thanks to the authors of the following projects open source!
Author micespring, CNC DC Electronic Loads
Author yueyunno1, Electronic Load Crowdfunding Project
Else
Because the project is initially scheduled to be a small power mini electronic load, the size is made to limit. Although the current output in 0-4A, voltage 0-50V, but not much power to do. Some devices such as fans, heat sinks, MOS tubes, etc. do not support long-term high-power load.
IRFP150MPBF has some chance to burn out when outputting around 100W power (3A, 35V), and the over-current, over-voltage, and over-temperature protection are not activated.If you want high power output, it is recommended to change the mos tube model such as IRFP260 and so on.
3D printing can just print the inner shell,The heat dissipation performance is better than those with a shell, and it also saves money.
Copyright belongs to @flyn
Link:https://oshwhub.com/flyn/mi-ni-dian-zi-fu-zai
Design Drawing

BOM


Project Members

Comment