0K5niLPDa

ESP32-based bicycle electronic fence

 
Overview
This ESP32-based bicycle electronic fence features multiple functions:
1. Anti-theft: Intrusion alarm, RFID card unlocking;
2. Fire prevention: Dispensing cooling liquid upon detecting flame (simultaneous response of flame and combustible gas sensors);
3. Remote control via APP: Real-time temperature and humidity display, and control of access control;
4. Automatic light activation upon detecting light or human proximity;
5. Fan ventilation: Automatically activates ventilation mode when temperature and humidity are too high.
PDF_ESP32-based Bicycle Electronic Fence.zip
Altium_ESP32-based Bicycle Electronic Fence.zip
PADS_ESP32-based Bicycle Electronic Fence.zip
BOM_ESP32-based Bicycle Electronic Fence.xlsx
92609
J-Link-OB-RA4M2 (Jlink OB)
J-Link-OB-RA4M2
Attention!!!

Select the 7628 stack.
Since the RST pin of the chip is not exposed, it is best to modify the SN and LICENSE before flashing the firmware. Otherwise, you will need to expose the RST pin or erase the chip before re-flashing the firmware.

Project

dimensions: 25mm * 13mm.
To maintain consistency with the J-Link Base V9 interface, TDI has been removed, therefore JTAG download is not possible.
Please refer to this project for firmware:
https://oshwhub.com/lsanor/j-link-ob-ra4m2_v1-1_24-06-04

Note:

Special note: H7 in the BOM does not need to be purchased.
The component is difficult to solder; please check carefully.
Downloading requires 1.27mm pitch probes, which are provided in the J-Link Base V9 project.

PDF_J-Link-OB-RA4M2 (Jlink OB).zip
Altium_J-Link-OB-RA4M2 (Jlink OB).zip
PADS_J-Link-OB-RA4M2 (Jlink OB).zip
BOM_J-Link-OB-RA4M2 (Jlink OB).xlsx
92612
STC8H8K64U Optical Coupler Board
STC8H8K64U Optical Coupler Board
Project Description:
This project aims to design a multifunctional, highly reliable control unit suitable for various industrial or automation applications. The core utilizes an STC8H8K64U microcontroller as the main controller, combined with isolated power supplies, optocoupler inputs/outputs, RS485/RS232 communication interfaces, and an ESP8266-01S wireless module. It also supports SPI/I2C. Screen Display
Core Functions


: Isolated DC-DC Power Supply: Supports 9~36V input; isolation design prevents external interference and protects the main control circuit.


Optical Input/Outputs:

10 optocoupler inputs are used to isolate and read external signals, such as sensor or switch status.
10 optocoupler outputs are used to control external devices, such as motors and indicator lights, achieving electrical isolation and improving system safety.



Communication Interfaces:

RS485 Isolation: Prevents damage to the main control circuit due to incorrect RS485 interface connection
. RS232 Isolation: Prevents damage to the main control circuit due to incorrect RS232 interface connection.
ESP8266-01S: Can be used for remote control and data transmission, connecting to STC8H8K64U via UART interface



. Display Interface: Supports LCD/OLED displays with SPI or I2C interfaces for displaying system status, parameters, or error signals.


Buzzer: Used to provide audible alerts or alarms. When the system detects an abnormal state (such as sensor failure, equipment overload, etc.), an alarm sound can be emitted via the buzzer to promptly notify the operator for handling.


Hardware Design:
Optocoupler Input:
Default input low level, input status indicated by LED.
Optocoupler Output: Output status indicated
by RS485 Isolation: Short-circuit H1 when a terminating resistor is required RS232 Isolation: Buzzer . Software Design: Communication adopts the standard MODBUS RTU protocol, and data exchange is achieved through the RS485 interface. Currently, MODBUS function code 03 is implemented to read the optocoupler input status; function code 06 is implemented to control the optocoupler output and buzzer status.







 

STC8H8K64U_Template.7z
PDF_STC8H8K64U Optical Coupler Board.zip
Altium_STC8H8K64U optocoupler board.zip
PADS_STC8H8K64U Optical Coupler Board.zip
BOM_STC8H8K64U Optical Coupler Board.xlsx
92613
underwater camera motherboard
This is a motherboard for an underwater camera, including STM32-controlled infrared illumination, stepper motor drivers, a TPS82130 ultra-small DC-DC converter, and an ultra-long-range USB 2.0 extender. Modules can be disassembled and used as needed.
Known Bugs:
1. The IIC connector lacks a pull-up switch; a pull-up switch is required at the sensor end.
2. The PB4 indicator light occupies the JTAG pin. The code needs to release the JTAG function before initializing PB4; otherwise, this pin will be uncontrollable.
3. The TPS82130 layout may be incorrect. The theoretical voltage setting for the resistors is 5.08V, but both multimeters measured an output of 5.2V.
 
Impedance reference process: JLC04121H-3313 (finished board thickness 1.16mm ± 10%)
DMDP: 90Ω CONCOP: 100Ω 485A485B: 120Ω
 
The 485 is still being debugged; code will be added later.
 
 
PDF_Underwater Camera Motherboard.zip
Altium underwater camera motherboard.zip
PADS_Underwater Camera Motherboard.zip
BOM_Underwater Camera Motherboard.xlsx
92614
Voltage and current meter---CW32
LCSC Development Board Bootcamp Open Source Ammeter and Voltmeter
I. Design Background

An ADC (Analog-to-Digital Converter) is an indispensable key component in electronic systems. It converts continuous analog signals into digital signals, enabling digital processing and analysis. ADCs play a crucial role in signal conversion, measurement and data acquisition, control system input, and communication and signal processing. Their widespread application promotes the intelligent and precise control of electronic equipment across various industries, and is one of the key factors driving modern technological progress. Digital voltmeters and ammeters combine ADC technology with circuit measurement principles, accurately converting analog voltage and current signals into digital displays for easy reading and analysis by electronic engineers. This device not only improves the accuracy and efficiency of circuit measurements but also helps engineers better understand circuit behavior, serving as a powerful assistant in electronic design and troubleshooting, and playing a vital supporting role in the work of electronic engineers. In product applications, digital voltmeters ensure the accuracy and safety of circuit design, while also providing strong support for product quality control and subsequent maintenance. Learning to design and build a digital voltmeter and ammeter
using a benchtop digital multimeter (Agilent 34401A)
is highly beneficial for improving one's professional skills. This digital voltmeter and ammeter project covers multiple aspects, including microcontroller circuit design and implementation, signal acquisition and processing circuit design, user interface development and optimization, and product appearance design. It integrates knowledge from various fields such as electronics, microcontroller programming, circuit design, and industrial design. Considering the learning pace and knowledge absorption capacity of beginners, we have specially launched this introductory-level digital voltmeter and ammeter project, which is very suitable for beginners in electronics and those who want to learn more about microcontroller applications. This project has the following highlights:

it adopts a core board plus expansion board design concept and uses plug-in components, making learning simpler and exploration more in-depth;
the core board uses the domestic Wuhan Xinyuan Semiconductor CW32 as the main controller, while also being compatible with other similar development boards; however, the CW32 has advantages.
The project is highly comprehensive and practical, and the completed design can be used as a desktop instrument.
The project offers abundant learning materials, including circuit design tutorials, PCB design, code programming, and training for engineers' debugging skills.

II. Hardware Design

1. Power Supply Circuit
LDO (Low Dropout Linear Regulator) Selection This project uses an LDO as the power supply. Considering that most voltmeter products are used in industrial scenarios with 24V or 36V power supplies, the SE8550K2 with a maximum input voltage of 40V was selected. The main reason for not using a DC-DC step-down circuit to handle the large voltage drop is to avoid introducing DC-DC ripple interference during the design process; a secondary reason is to reduce project costs.
2. MCU Selection Analysis
To reduce the learning cost, this project uses the LCSC CW32F030C8Tx development board (core board) as the main controller, but this does not mean we will cover this section less. From the perspective of training engineers, the correct selection of the main controller is crucial, as it relates to the overall advantages of the project. Regarding voltmeters and ammeters, I conducted some debugging and testing using STM32/CW32 and some other 32-bit microcontrollers. Here, I only compare them with the STM32F103C8T6 as a reference for learning device selection, primarily to provide ideas and improve understanding.
Avoid blind selection. When selecting an MCU (microcontroller unit) for this project, multiple aspects need to be considered to ensure the chosen MCU meets the project requirements.

Clearly define your project requirements: clearly understand how much computing power the project needs, including clock speed, processor core type, and whether a floating-point unit is required.
Clearly define the required I/O ports and important peripherals, such as ADC peripherals. Since this project is a development board project, the main purpose is debugging and learning; therefore, there are no strict limitations on the number of I/O ports: i.e., the resulting cost issues are not considered.

Key advantages of the CW32 in this project

: Wide operating temperature range: -40~105℃;
Wide operating voltage range: 1.65V~5.5V (STM32 only supports 3.3V systems)
; Superior interference immunity: HBM ESD 8KV; All ESD reliability meets the highest international standard (STM32 ESD 2KV)
; Project focus - Better ADC: 12-bit high-speed ADC, achieving ±1.0LSB INL 11.3ENOB; Multiple Vref reference voltages... (STM32 only supports VDD=Vref);
Stable and reliable eFLASH technology.

A detailed explanation of these advantages will be provided in the chapters on ADC sampling and related extensions.
The main characteristics of the CW32 ADC: This project requires a focus on the 4 reference voltage sources. (Content from the "CW32x030 User Manual")
3. Voltage Sampling Circuit:
The voltage divider resistors in this project are designed to be 220K+10K, therefore the voltage division ratio is 22:1 (ADC_IN11).
The voltage divider resistor selection

is designed to measure the maximum voltage. For safety reasons, this project uses 30V (the actual maximum display value can be 99.9V or 100V).
The ADC reference voltage is 1.5V in this project, and this reference voltage can be configured through the program.
To reduce the power consumption of the sampling circuit, the low-side resistor (R7) is usually chosen as 10K based on experience.

Then, the high-side resistance of the voltage divider resistor can be calculated using the above parameters.

The required voltage division ratio is calculated, i.e., the ADC reference voltage. The input voltage is designed; using known parameters, 1.5V/30V = 0.05 can be calculated.
The high-side resistance is calculated as the low-side resistance/voltage division ratio; using known parameters, 10K/0.05 = 200K can be calculated.
A standard resistor is selected: a resistor slightly higher than the calculated value of 200K is chosen. We usually choose E24 series resistors; therefore, in this project, 220K, which is greater than 200K and closest to the calculated value, is selected.

If, in actual use, the voltage to be measured is lower than 2/3 of the module's design voltage (66V), the voltage divider resistor can be replaced and the program modified to improve measurement accuracy. The following example illustrates this:

Assuming the measured voltage is no higher than 24V and other parameters remain unchanged,
calculations show 1.5V/24V = 0.0625, 10K/0.0625 = 160K. 160K is a standard E24 resistor and can be directly selected, or a higher value 180K can be chosen with some redundancy.

If, in actual use, the voltage to be measured is higher than the module's 99V design voltage, a different resistor can be selected. To expand the voltage measurement range, you can choose to replace the voltage divider resistor or modify the reference voltage. The following example illustrates this:

Assuming the measured voltage is 160V, we can choose to increase the voltage reference to expand the range.
Given that the voltage division ratio of the selected resistor is 0.0145, we can calculate 160V * 0.0145 = 2.32V using the formula. Therefore, we can choose a 2.5V voltage reference to expand the range (increasing the range will reduce accuracy).

Considering the potential fluctuations in the measured power supply, a 10nF filter capacitor is connected in parallel with the low-side voltage divider resistor in the circuit design to improve measurement stability.
(Range switching )
In this project, an additional voltage sampling circuit was added. Therefore, we can discuss the significance of range switching for improving measurement accuracy. Multimeters often have multiple range settings to achieve more accurate measurements. By adjusting different ranges, the optimal measurement accuracy of the measured point within the corresponding range can be obtained.
This project requires a combination of hardware and software to implement this function. When we first use the ADC_IN11 channel mentioned earlier to measure voltages below 30V, if the measured voltage is within 0~3V, then we use the ADC_IN9 channel for measurement. At this time, due to the reduced voltage division ratio, the measurement accuracy is greatly improved. There are many ways to implement range switching; the development board design provides more design possibilities.
4. Current Sampling Circuit
This project uses a low-side current sampling circuit for current detection. When learning the common ground between the low-side of the sampling circuit and the development board's meter interface, please do not solder R0!!!
The design analysis
for this project involves a sampling current of 3A, and the selected sampling resistor (R0) is 100mΩ. The selection of the sampling resistor mainly needs to consider the following aspects:

the maximum value of the pre-designed measurement current;
the voltage difference caused by the 3A current sensing resistor in this project; and
the power dissipation of the current sensing resistor, which should generally not exceed 0.5V. A suitable package should be selected based on this parameter. Considering the power dissipation (temperature) issue under high current, a 1W metal wire-wound resistor package was chosen
. The voltage amplification factor across the current sensing resistor is also important. Since no operational amplifier is used to build the amplification circuit in this project, the factor is 1.

The current sensing resistor value can then be calculated using the above parameters

. Since no amplifier circuit is used, a larger sampling resistor is needed to obtain a higher measured voltage for measurement.
However, considering that a larger resistor would result in a larger voltage drop and higher power consumption, an unlimited selection of a larger resistor is not feasible .
This project uses a 1W package resistor, corresponding to a power consumption of 1W.

Based on the above data, a 100mΩ current-sensing resistor was chosen. According to the formula, 3A * 100mΩ = 300mV, 900mW.
To handle different operating environments, especially high-current scenarios, the R0 resistor can be replaced with constantan wire or a shunt. The appropriate alternative can be chosen based on the specific application scenario. For safety and educational purposes, this project will not discuss measurements exceeding 3A, but the principle remains the same.
5. LCD Display
1. Module Source
Procurement Link: 1.47-inch LCD display, high-definition IPS 172x320, ST7789 driver LCD screen, high-definition LCD display
data download link: https://pan.baidu.com/s/15OWpndYzyW8kFPqmfKNfxQ
Data extraction code: 8888
2. Specifications
Operating Voltage: 3.3V
Operating Current: 90MA
Module Size: 30(H) x 37(V) MM
Pixel Size: 172(H) x 320(V) RGB
Driver Chip: ST7789V3
Communication Protocol: SPI
Number of Pins: 8 Pins (2.54mm pitch header)
The above information can be found in the manufacturer's data file
. File path
Size parameters
 
6. LED Indicator
This project additionally designed a power indicator and an IO working indicator.

LED1 is the power working indicator .

Since the chip I/O often has a sinking current capability greater than a pulling current capability, LED1 is designed to be I/O low level active (on).
To reduce the current consumption of the LED, some LED brightness was sacrificed, and the number of device parameters was reduced. The current-limiting resistor for the LED was chosen to be 10K.
7. Button Circuit Design:
There are various design methods for the button control circuit. Thanks to the CW32's internal I/O ports which can be configured with pull-up and pull-down resistors, the button control circuit on the outside of the chip does not need to be configured. One end of the button is connected to the MCU's I/O, and the other end is grounded. When the button is pressed, the I/O is pulled low.
8. TL431 Circuit Design for Voltage Measurement and Calibration:
This project adds an extra TL431 circuit to provide a 2.5V reference voltage. This can be used to provide an external voltage reference for the chip to calibrate the AD converter. From a product design perspective, due to the inherent ADC performance advantages of the CW32, this circuit is not necessary. This circuit is designed on the development board for learning the relevant application principles.
The TL431 is a relatively "old" device, very classic, and widely used; it is still found in many electronic products today.
Many beginners may be encountering this device for the first time. We will briefly explain the principles of this product to help everyone better apply the TL431.
TI defines it by its name as a precision programmable reference. On the first page of the references, we can focus on several key characteristics.
**Precision:** Precision indicates its highly accurate output voltage. The TL431 I used has ±0.5% accuracy, and at room temperature, it measured 2.495V on the board. This is a world of difference in accuracy compared to common Zener diodes. In application circuit diagrams, the TL431 is internally represented by a Zener diode symbol. **
Adjustable Output Voltage:** The adjustable output voltage is between Vref and 36V. In our project, we use the output Vref voltage, which is approximately 2.5V. Therefore, we use 2.5V in the description, which is approximately equal to Vref. **
Sinking Current Capability:** This refers to how much current the output voltage pin can provide. This is greatly influenced by the resistance value (R13) in the application circuit. It should not be less than 1mA. If there is no need for sinking current, do not design the current too high, as this will cause unnecessary power consumption.
III. Software Design
The software design references the official CW32 Digital Voltage and Current Meter Training Camp Project Tutorial Document | LCSC Development Board Technical Document Center (lckfb.com).
For the program porting to the 1.47-inch screen, refer to the porting tutorial in the Jingyuan 1.47-inch example program porting (CW32F030C8T6). It is worth noting that the porting tutorial uses SPI1, while this project uses SPI2.
The program is burned using DAPLINK. The complete program is attached.
IV. Physical Images
1. PCB Image
2. Physical Image
V. Some Notes
Due to oversights in the initial PCB design, the distance between the LCD screen and the digital tube is too close, making it impossible to simultaneously accommodate both. Therefore, in this project, only one display device can be selected.
Regarding the image extraction tutorial, relevant information is provided in the porting documentation.
Physical demonstration.mp4
CW32_Tem_Pro.zip
PDF_Voltmeter & Ammeter---CW32.zip
Altium Voltmeter & Ammeter - CW32.zip
PADS Voltage and Ammeter - CW32.zip
BOM_Voltage and Ammeter---CW32.xlsx
92615
CW32 Ammeter Practice
The current and voltage meter based on LCSC's Dizhengxing is made using the CW32F030C8T6 MCU from Chipsource Semiconductor. Most of the components have been replaced with surface mount technology to save space.
The photos taken during the debugging process
show the test voltage. A 5V reference voltage was provided using DuPont wires, and the digital display showed accurate readings.
CW32 digital voltmeter and ammeter with calibration function.hex
LCSC Development Board LOGO.png
Sinyuan Semiconductor LOGO.png
Current Surface Panel 2024-08-09.epanm
BOM_CW32 Voltage and Current Meter.xlsx
PDF_CW32 Ammeter Practice.zip
Altium_CW32 Ammeter Practice.zip
PADS_CW32 Ammeter Practice.zip
BOM_CW32 Ammeter Practice.xlsx
92616
[LCSC Taishanpai Development Board] Small Mobile Phone Project
Small mobile phone project
The small phone project
added backlighting and reduced chip heat generation
. It also supports touch and MIPI for a 3.1-inch screen.
Selective resistors are included in the backlight circuitry and can be added as needed.
bb69dbc6252f2372d3a80eba9a473c36.mp4
1994fb627edbc72289e8e2f9a572f252.mp4
PDF_【LCSC Taishanpai Development Board】Small Mobile Phone Project.zip
Altium_【LCSC Taishanpai Development Board】Small Mobile Phone Project.zip
PADS_【LCSC Taishanpai Development Board】Small Mobile Phone Project.zip
BOM_【LCSC Taishanpai Development Board】Small Mobile Phone Project.xlsx
92617
electronic
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2026-03-26 19:23:52

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号