1133 views|4 replies

407

Posts

7

Resources
The OP
 

【DigiKey Creative Contest】Work Submission + Simple Current Source [Copy link]

 This post was last edited by lansebuluo on 2024-1-9 09:10
digikey_iot_contest_2023_简易电流源.doc (7.32 MB, downloads: 8)
Simple current source
Author: lansebuluo
  1. Introduction
    During the project development process, standard current sources are sometimes used to test product performance indicators, such as 4-20mA sampling circuits and AC current transformer sampling circuits. Most signal sources on the market are voltage output types, and the price of current types is relatively high, so the idea of making a standard current signal source came into being. The STM32 microcontroller is used as the control unit, and the digital-to-analog converter is controlled through the SPI interface to generate a standard voltage signal, which is then converted into a current signal output through the analog conversion circuit. It is divided into DC mode and AC mode, and the current signal size is -200mA~+200mA. The interface uses a WIFI module to communicate with the PC, and can set the current signal mode, frequency, and amplitude.
    In this project, the main chips used are as follows: STM32G473CBT6, AD5449, ADR01, CA-IS3741HW, OPA2277, OP1177, TIP42C, TIP41C, etc. The main finished boards used are NUCLEO-G491RE, STLINK-V3MODS, and ESP-01S (WIFI) functions.
    STM32G473CBT6 has an Arm 32-bit Cortex-M4 CPU with FPU, a frequency of up to 170 MHz, 213 DMIPS, MPU and DSP instructions, 512 KB flash memory and 96 KB SRAM, and multiple peripherals such as CAN, SPI, I2C, and USART. This chip is used here, mainly focusing on SPI speed and operating frequency, and can quickly calculate the waveform and update it to the DAC through the SPI interface.
    AD5449 is a digital-to-analog conversion chip with 12-bit resolution, 50 MHz serial interface, and 2.47 MSPS update rate.
    ADR01 is a high-precision reference voltage source with a typical value of 3ppm/°C, providing a stable reference voltage for the DAC.
    CA-IS3741HW is a high-speed four-channel digital isolator with a signal transmission rate from DC to 150Mbps and an isolation withstand voltage of 5.0kV.
    OPA2277 and OP1177 are high-precision, low-temperature coefficient operational amplifiers that provide mutual conversion of analog signals.
    TIP42C and TIP41C are power transistors that provide output current capabilities.
    NUCLEO-G491RE mainly expands the key and display functions, and its features are as follows:
    STM32 microcontroller in LQFP64 or LQFP48 package
    1 user LED shared with ARDUINO
    1 user and 1 reset button
    32.768 kHz crystal oscillator
    Board connector:
    – ARDUINO Uno V3 expansion connector
    – ST morpho expansion pin header, full access to all STM32 I/O
    Flexible power supply options: ST-LINK USB VBUS or external power supply
    On-board ST-LINK debugger/programmer with USB re-enumeration function:
    STLINK-V3MODS is an emulation debugger that provides debugging functions for the core controller.
    ESP-01S is a wifi to UART module that provides convenient WiFi connection function.

    Main function board

    Key and display board

    Emulator
  2. System Block Diagram
The design idea of this project is shown in the figure below:
Overall framework diagram
Core board frame diagram
As the core of the whole device, the core board calculates the digital quantity of the output waveform and controls the DAC to generate the desired voltage waveform through SPI. Its external interfaces mainly include SPI interface expansion DAC chip, USART and WIFI module, USART and key and display function board, and the core control chip is provided with simulation debugging function by STLINK-V3MODS.
MCU control chip peripheral diagram
The MCU control chip peripherals provide the necessary interfaces for the STM32G473 to run, including the power supply port, the chip boot BOOT pin selection, and other GPIO functions are led out to H5.
Digital isolation port
High-speed digital isolator circuit, used for isolation between MCU and analog quantity, mainly SPI interface isolation, using one four-channel and one two-channel isolation chip. Signal transmission rate ranges from DC to 150Mbps, with an isolation withstand voltage of 2.5kV.
DAC conversion diagram
There are two DACs on an AD5449 chip. The reference voltage is provided by ADR01 (10V) and ADR02 (5V). The two op amp chips form a bipolar voltage output. This circuit was made according to the instructions, so there shouldn't be any problems. But I was careless. There are two DACs. One design has no problem, but the other design lacks a line. I designed the circuit diagram myself to show the problem.
Chip recommendation diagram:
Core board renderings
Voltage to Current Converter Circuit
This circuit is cleverly designed. It comes from an analog circuit book and was modified by myself. It was tested using simulation software. This circuit does not take into account the output load capacity. The output current is affected by the load resistance, so the circuit still needs to be optimized.
ESP-01S interface circuit
In addition to the 3.3V power supply, the reset pin and enable pin need to be high level, and the interface corresponds to the receiving and transmitting pins of the USART of the core board. The function of the button is to update the program of the ESP-01S module.
Onboard power supply
The circuit board uses multiple 3.3V. For the sake of accuracy, the analog and digital quantities each use an independent 3.3V power supply.
Current conversion board effect diagram
STLINK-V3MODS interface board
STLINK-V3MODS is a very small board. I didn't pay much attention to it when I bought it. After I came back, I found that it couldn't be used directly. According to the official information, I made an interface board, expanded SWD, JTAG, and virtual serial port. The program debugging and simulation of this project are completed through the SWD interface of this board. The configuration of the ESP-01S module is completed using the virtual serial port. This board is quite convenient to use.
STM32-V3MODS effect diagram
Button map
Rotary encoder
Key display panel effect diagram
3. Functional description of each part
3.1 Button display function
There are 6 buttons and a rotary encoder, and their corresponding functions are as follows:
The first line displays: current setting value, frequency value, for example: 300mA 50.00Hz.
After clicking OK, the setting value appears in the second line, and the current setting value is reversed. You can change the setting value to current or frequency by moving left and right.
After clicking "+" or "-" again, the set value is changed and the change range appears on the right.
After the change is completed, click OK again to update to the first line and send the set value to the control board.
When the current output value is set on the PC, the set value is updated to the screen.
The key display board is controlled by NUCLEO-G491RE and communicates with the main board via USART.
3.2 Communication Format
The mainboard communicates with the key display board and the WIFI module through two independent USARTs. The communication format is the same, as shown below:
The start, command, and end characters are fixed, which are 0xAA, 0x01, and 0x55 respectively.
The frequency unit is 0.01Hz, that is, when the value is 5000, the actual frequency = 5000 * 0.01Hz = 50.00Hz. The frequency range is 0-66Hz. When the frequency is 0, it represents DC mode, and other values represent AC mode.
The amplitude unit is 1mA, that is, when the value is 200, the actual amplitude = 200 * 1mA = 200mA.
3.3 PC
There is a server-like software on the PC side, waiting for the device to connect. When the device starts, the motherboard executes AT commands, configures the ESP-01S module, connects to the WIFI router, and attempts to access the TCP server. When the access is successful, the ESP-01S mode is configured as transparent transmission mode. The software of this project is written by MFC in VS2015, and the current and frequency values can be set through the software.
Host computer software interface
3.4 Circuit Simulation
There are many simulation software for analog circuits, such as Pspice and Saber, which are said to be easy to use, but they are charged. For a novice like me, I don’t need very powerful and stable functions, but only simple operations and the ability to simulate results. The performance indicators are not very high, so I chose LTspice software from ADI. The software is labeled Linear Technology, which has been acquired by ADI. Since ADI acquired Linear Technology and Maxim, the prices of ADC and DAC have risen by several levels. Is this the legendary monopoly that can control prices? It has hurt electronic enthusiasts like me. Of course, in addition to LTspice, you can also use TINA-TI from TI. I have never used it, so I will no longer consider this software. I used Multisim when I was in school. Multisim is from National Instruments (NI) Co., Ltd. of the United States and needs to be cracked.
After comprehensive consideration, LTspice software was used. The software is less than 70MByte, which is quite small depending on the version.
Circuit Simulation Diagram
  1. Work source code
Mainboard software mainly configures the WiFi module, controls the DAC output voltage waveform, and communicates with the key display board.
Key display board software, scan keys and rotary encoders, control LCD display modules.
The host computer software establishes a TCP server to communicate with the connected clients and transmit current and frequency values.
5. Demonstration video of the work’s functions
The operation button sets the current to 200mA 50Hz
The operation button sets the current to 150mA 55Hz
Operation button to set 100mA DC current
The host computer performs the above steps again:
6. Project Summary
The completion of this project mainly consists of four parts: hardware circuit design, software design, software and hardware debugging, and functional testing. The hardware circuit design uses the free EDA of EasyChuang. The circuit is not very complicated, so there is no problem in dealing with it. The main reason for using this software is the convenience of the device library, which saves a lot of time. At the same time, it can also provide free PCB proofing, saving costs. The main components of other designs were purchased from Digi-Key Electronics, and some other components were purchased from an official mall.
After I placed an order with Digi-Key, the item arrived in about 7 days. It included an STM32 development board. Before the designed circuit board arrived, I could debug the SPI interface, USART, and display software in advance, saving a lot of time.
From the above introduction, most of them are talking about hardware. Four circuit boards were made in this project. The new circuit boards need a debugging process. I was also very careless. I didn't draw a line on the core board, which damaged a DAC. I corrected it by flying wires. In the current conversion part, a dual-channel op amp was used, which caused the circuit to not work properly, so I redesigned the PCB.
Thanks to Digi-Key and EEWORLD, I was able to experience a relatively complete project design process from schematic design, circuit board soldering, software design, board debugging, functional testing, etc. Maybe the project was not completed very well, but the process gave me a deep understanding.
This post is from DigiKey Technology Zone

Latest reply

Look at the photo. Is this a circuit board made specifically for the competition? It's quite thoughtful.   Details Published on 2024-4-25 16:41
 
 

6828

Posts

11

Resources
2
 

Maybe the project was not completed very well, but the process gave me profound insights.

Excellent, and very modest!

This post is from DigiKey Technology Zone
 
 
 

4764

Posts

12

Resources
3
 
Driving LED? It's quite comfortable to be a constant current source to control the light source
This post is from DigiKey Technology Zone

Comments

It can also drive LEDs. This solution is used as a standard current signal source and is used as a testing tool. For example, in power system sampling, Hall signal acquisition circuits are often used, which can test circuit performance.  Details Published on 2024-1-8 08:55
 
 
 

407

Posts

7

Resources
4
 
Azuma Simeng posted on 2024-1-8 08:28 Do you drive LEDs? It's quite comfortable to make a constant current source to control the light source

It can also drive LEDs. This solution is used as a standard current signal source and is used as a testing tool. For example, in power system sampling, Hall signal acquisition circuits are often used, which can test circuit performance.

This post is from DigiKey Technology Zone
 
 
 

1118

Posts

2

Resources
5
 

Look at the photo. Is this a circuit board made specifically for the competition? It's quite thoughtful.

This post is from DigiKey Technology Zone
 
 
 

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list