Photoelectric information transmission system and method based on pulse width modulation
Through the pulse width modulation-based photoelectric information transmission system, the LED optical signal transmission device identification information of the IoT device is used to solve the limitations of traditional communication methods of sealed IoT devices in the production process, and efficient and reliable identification information transmission and automatic decoding are achieved.
Patent Information
- Application Number
- CN202510834013.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-08-05
AI Technical Summary
The prior art is difficult to efficiently and reliably transmit device identification information during the production process of sealed IoT devices. The traditional wired interface is unavailable, wireless communication is limited, and physical tags are easily confused, resulting in difficulty in collecting device identification information.
The pulse width modulation-based photoelectric information transmission system is adopted to identify information through the LED optical signal transmission device of the IoT device, use Manchester encoding rules and synchronization head signals, and combine the encoding transmitting terminal and the decoding receiving terminal to realize contactless information transmission and automatic decoding.
It realizes reliable identification information transmission of sealed IoT devices, has low bit error rate, avoids label confusion, reduces production line adaptation costs, and meets the real-time needs of high-speed production lines.
Smart Images

Figure CN120434276A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of Internet of Things equipment production, and specifically relates to a photoelectric information transmission system and method based on pulse width modulation. Background Art
[0002] In the manufacturing process of IoT devices, the conventional production process requires obtaining device identification information (such as MAC address and serial number SN) and printing labels after the entire device is assembled. However, existing technical methods have many shortcomings: (1) Wired interfaces are unavailable: Most products are sealed during the assembly phase, making the physical interfaces inaccessible. Over 90% of sealed IoT devices cannot read device identification information through the physical interface after assembly.
[0003] (2) Limited wireless communication: On the production line, the average interference intensity in the 2.4GHz frequency band is as high as -70dBm, resulting in a wireless communication bit error rate exceeding 5%. In addition, some products do not support wireless communication. Electromagnetic interference in the production line environment also affects the stability of wireless communication. Different wireless communication protocols need to be connected separately, which greatly reduces work efficiency.
[0004] (3) Label confusion risk: Before the device is installed with structural components, MAC / SN information is usually obtained and a temporary label is printed, which is then physically attached to the device. However, when the structural components are installed, the label needs to be removed. During this process, due to manual operation or label management errors, it is very easy to cause labels on different devices to be misplaced, omitted, or confused, affecting the accuracy of device identification.
[0005] Therefore, the limitations of existing technologies make it difficult for sealed IoT devices to efficiently and reliably transmit and collect identification information during the production process. There is an urgent need for a new information transmission solution that does not rely on physical interfaces and wireless communications. Summary of the Invention
[0006] The technical problem to be solved by the present invention is: to propose a photoelectric information transmission system and method based on pulse width modulation, to achieve reliable transmission of device identification information through the LED light signal of the IoT device, and to solve the usage limitations of traditional wired / wireless communications in sealed equipment or complex production line environments.
[0007] The technical solution adopted by the present invention to solve the above technical problems is: In one aspect, the present invention provides a photoelectric information transmission system based on pulse width modulation, which includes an encoding transmitter and a decoding receiver; The coding transmitter is integrated into the IoT device to implement the encoding of device identification information and optical signal modulation, including: The information preprocessing module is used to convert the device identification information of the IoT device into a binary data frame and add a CRC check bit; A synchronization header generation module is used to insert a continuous square wave as a synchronization header signal into the header of a data frame; The pulse width modulation module uses the Manchester encoding rule to map each bit in the data frame after the synchronization header signal is inserted into the LED on / off state within a certain period. The PWM interface of the IoT device's main control chip drives the IoT device's LED to form a light signal sequence. The decoding receiving end is an independent hardware device used to capture, process and decode optical signals, including: A photoelectric sensing unit, configured to receive a light signal sequence using an illumination sensor and convert the light signal into an analog electrical signal; A signal shaping module is used to amplify and threshold-shape analog electrical signals; The decoding algorithm module is used to trigger the dynamic decoding mechanism based on the synchronization header, restore the binary data frame according to the Manchester encoding rule, verify the data integrity through the CRC check bit, and then extract the device identification information; The USB transmission module is used to convert the decoded device identification information into a USB signal and transmit it to the production test software.
[0008] Furthermore, the signal shaping module amplifies the analog electrical signal through an operational amplifier and performs threshold shaping through a Schmitt trigger.
[0009] Furthermore, the synchronization header generation module is used to insert a continuous square wave with a period of 5ms into the header of the data frame as a synchronization header signal.
[0010] Furthermore, the pulse width modulation module adopts the Manchester encoding rule to map each bit in the data frame after the synchronization header signal is inserted into the LED on and off state within a 50ms period, wherein, if the bit is "0", it is mapped to the low level in the first 25ms + the high level in the last 25ms; if the bit is "1", it is mapped to the high level in the first 25ms period + the low level in the last 25ms, the low level corresponds to the LED off state, and the high level corresponds to the LED on state.
[0011] Furthermore, the decoding algorithm module triggers a dynamic decoding mechanism based on the synchronization header, including: locking the starting point of the data frame through an edge detection algorithm, and using a dynamic phase-locked loop to track the 50ms bit period of the transmitter.
[0012] On the other hand, based on the above system, the present invention also provides a method for transmitting photoelectric information based on pulse width modulation, comprising the following steps: S1. The IoT device's encoding transmitter reads the device identification information; S2. Convert the device identification information into a binary data frame and add a CRC check bit; S3 inserts a continuous square wave as a synchronization header signal in the header of the data frame; S4. Using the Manchester encoding rule, each bit in the data frame after the synchronization header signal is inserted is mapped to the LED on / off state within a certain period. The PWM interface of the IoT device's main control chip drives the IoT device's LED light to form a light signal sequence; S5. The decoding receiving end receives the optical signal sequence and converts it into an analog electrical signal; S6. amplifying and threshold shaping the analog electrical signal; S7. Based on the synchronization header, the dynamic decoding mechanism is triggered, and the binary data frame is restored according to the Manchester encoding rules. The data integrity is verified using the CRC check bit, and the device identification information is then extracted. S8. Convert the decoded device identification information into a USB signal and transmit it to the production test software.
[0013] Furthermore, in step S6, the analog electrical signal is amplified by an operational amplifier and threshold shaping is performed by a Schmitt trigger.
[0014] Furthermore, in step S3, a continuous square wave with a period of 5 ms is inserted into the head of the data frame as a synchronization header signal.
[0015] Furthermore, in step S4, the Manchester coding rule is used to map each bit in the data frame after the synchronization header signal is inserted to the LED on and off state within a 50ms period, where if the bit is "0", it is mapped to the low level in the first 25ms + the high level in the last 25ms; if the bit is "1", it is mapped to the high level in the first 25ms period + the low level in the last 25ms, where the low level corresponds to the LED off state, and the high level corresponds to the LED on state.
[0016] Furthermore, in step S7, the triggering of the dynamic decoding mechanism based on the synchronization header includes: locking the starting point of the data frame through an edge detection algorithm, and using a dynamic phase-locked loop to track the 50ms bit period of the transmitter.
[0017] The beneficial effects of the present invention are: (1) Solve the limitations of traditional communication methods in sealed equipment: By replacing physical interfaces with LED optical signal transmission, the problem of more than 90% of sealed IoT devices being unable to read identification information through wired interfaces after assembly is resolved, thus achieving contactless information transmission.
[0018] Through the anti-interference design of Schmitt trigger and dynamic threshold sampling, the bit error rate is less than 0.01% under 300lx ambient light, which is significantly better than traditional 2.4GHz wireless communication (bit error rate > 5%).
[0019] (2) Eliminate the risk of confusion caused by physical labels: Directly transmit MAC address, serial number and other identification information through LED light signals, eliminating the manual process of "printing labels - attaching - removing", and fundamentally avoiding label confusion when installing structural parts.
[0020] Based on the linkage between the decoding receiving end and the production testing software, information entry is automatically completed, ensuring that the device identification corresponds to the hardware one by one, eliminating human operational errors.
[0021] (3) Strong compatibility: The implementation of the solution relies on the LED lights built into the IoT device and the PWM interface of the main control chip, requiring no additional hardware modification, greatly reducing the production line adaptation cost.
[0022] In addition, the encoding transmitter and decoding receiver adopt a modular architecture and can be quickly integrated into different models of equipment.
[0023] (4) High data transmission efficiency: It adopts a transmission rate of 50ms / bit and supports the transmission of 20 bytes of data within 1.005s, meeting the real-time requirements of high-speed production lines. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 2 is a structural diagram of a photoelectric information transmission system based on pulse width modulation in an embodiment of the present invention.
[0025] Figure 2 This is a flow chart of a method for transmitting photoelectric information based on pulse width modulation in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] This invention aims to provide a pulse-width modulation-based optoelectronic information transmission system and method. This system uses LED light signals from IoT devices to reliably transmit device identification information, addressing the limitations of traditional wired and wireless communications in sealed devices or complex production line environments. The core concept is to combine pulse-width modulation (PWM) technology with LED light signals to create a contactless information transmission solution suitable for sealed IoT devices. This overcomes the limitations of traditional wired and wireless communications in production line environments and enables reliable and efficient transmission of device identification information. Specifically, the system includes: (1) Using the standard LED of IoT devices as the information transmission medium, the device identification information (such as MAC address, serial number SN) is encoded into a light intensity change signal, and the traditional physical interface or wireless electromagnetic wave transmission is replaced by "light flashing".
[0027] (2) By combining the Manchester coding rule with pulse width modulation technology, a standardized protocol for optical signal transmission is established: a "0" bit is defined as a low level for the first 25ms (LED off) + a high level for the next 25ms (LED on); a "1" bit is defined as a high level for the first 25ms + a low level for the next 25ms. Each bit period is 50ms to ensure clock synchronization. (3) A continuous square wave with a period of 5ms is inserted into the data frame header as a synchronization header, which is used by the receiving end to lock the starting point of the data frame and avoid decoding errors caused by clock deviation.
[0028] (4) Adopting an end-to-end modular system architecture, the reliable transmission and processing of information is achieved through the separated design of "encoding transmitter + decoding receiver". The encoding transmitter is integrated into the IoT device, and the decoding receiver is an independent hardware device. The decoding algorithm module tracks the bit period through a dynamic phase-locked loop, restores the data according to the Manchester encoding rule, and transmits it to the production test software via USB.
[0029] The solution of the present invention is further described below with reference to the accompanying drawings and embodiments.
[0030] This embodiment first provides a photoelectric information transmission system based on pulse width modulation, see Figure 1 It consists of two major parts: the encoder transmitter and the decoder receiver. The encoder transmitter is integrated into the IoT device and is responsible for encoding device identification information and modulating optical signals. The decoder receiver is an independent device responsible for capturing, processing, and decoding optical signals.
[0031] 1. Encoding transmitter: It includes information preprocessing module, synchronization header generation module and pulse width modulation module. The functions of each module are as follows: (1) Information preprocessing module: This module is responsible for converting device identification information (such as MAC / SN) into binary data frames. The specific process is as follows: First, parse the original character data (such as "00:1A:2B:3C:4D:5E" and "SN-20231001-001"), extract valid characters and convert them into a binary sequence; The CRC-16 or CRC-32 algorithm is then used to generate a check bit, which is appended to the end of the data frame to form a complete binary code containing the check information, ensuring the integrity of the data during transmission.
[0032] (2) Synchronization header generation module: A continuous square wave with a period of 5ms (i.e., alternating between 2.5ms high level and 2.5ms low level) is inserted into the data frame header as a synchronization signal. This synchronization header is used to synchronize the initial clock at the decoding end, ensuring that the receiving end can accurately identify the starting position of the data frame and avoid decoding errors caused by clock deviation.
[0033] (3) Pulse Width Modulation Module: The Manchester encoding rule is used to modulate binary data, and each bit is mapped to the LED on / off state within a 50ms period: the "0" bit is defined as a low level (LED off) for the first 25ms and a high level (LED on) for the next 25ms; the "1" bit is defined as a high level (LED on) for the first 25ms and a low level (LED off) for the next 25ms; the LED is driven through the PWM (pulse width modulation) interface of the device's main control chip (such as STM32, ESP32), and the on / off timing is precisely controlled to form a light signal sequence that carries data.
[0034] 2. Decoding receiving end: It includes a photoelectric sensor unit, a signal shaping module, a decoding algorithm module, and a USB transmission module. The functions of each module are as follows: (1) Photoelectric sensing unit: Use TSL2561 illumination sensor (response time ≤ 30ms, spectral range 280nm-1100nm, covering visible light and near-infrared bands), with a focusing lens or filter, to collect the light intensity change signal emitted by the device LED in real time and convert the light signal into an analog electrical signal.
[0035] (2) Signal shaping module: pre-processing of analog electrical signals: First, the signal is amplified through an operational amplifier (such as LM358) to improve the readability of weak signals; Then, a Schmitt trigger (such as 74HC14) is used to perform threshold shaping, converting the noisy analog signal into a digital signal with clear edges (TTL level), eliminating interference from ambient light (such as background light below 300lx), and outputting a regular square wave signal.
[0036] (3) Decoding algorithm module: dynamic decoding mechanism based on synchronization header triggering: First, the 5ms synchronization header signal is detected, and the starting point of the data frame is locked using an edge detection algorithm (such as rising / falling edge time difference calculation). A dynamic phase-locked loop (PLL) is used to track the 50ms bit period of the transmitter, and the sampling clock is calibrated in real time to ensure the midpoint sampling accuracy within each bit period. The sampled signal is parsed according to the Manchester encoding rule (for example, a high-level to low-level transition represents a "1", and a low-level to high-level transition represents a "0") to restore the binary data frame. The CRC check bits are used to verify data integrity and eliminate error frames.
[0037] (4) USB transmission module: Using a USB-to-serial port chip such as CH340 or CP2102, the decoded MAC / SN information is converted into a USB signal and transmitted to the supporting production test software in real time. The production test software can automatically analyze the data and complete the entry, comparison and label printing of device identification information.
[0038] Based on the above system, in practical application, an illustrative implementation is as follows: 1. Decoding receiving end initialization and connection: The production test software establishes communication with the decoder receiver (such as an STM32F4 main control board equipped with an OVM7690 camera module) via a USB interface, configures sensor parameters (such as sampling frequency and gain), and enters a standby state for optical signal acquisition. In image sensor mode, the camera module captures changes in LED light intensity through its pixel array, assisting the TSL2561 sensor in improving signal capture accuracy.
[0039] 2. Device-side signal transmission: After the IoT device is powered on, the main control chip calls the built-in firmware, reads the MAC / SN information from the storage unit (such as EEPROM, Flash), and generates a binary data frame with CRC check through the information preprocessing module. The control LED flashes according to the "synchronization header + data frame" format: first sending a 5ms synchronization header square wave, and then sending the 50ms on and off signal corresponding to each bit in sequence (for example, the total time taken for a 20-byte data frame is approximately 20×50ms+5ms=1005ms, meeting the efficiency requirement of a single transmission of less than 2s).
[0040] 3. Receiver decoding and data transmission: The decoding receiver converts the optical signal into a digital signal through a photoelectric sensor unit and a signal shaping module, and then restores the data frame through the decoding algorithm module. It first verifies the CRC check bit. If the check passes, the MAC / SN information is extracted and transmitted to the production test software via USB. If the check fails, the current frame is discarded and the next frame signal is waited for. After receiving the information, the production test software automatically completes the device identification entry and resets the decoding receiver to prepare to receive the signal from the next device, forming a streamlined automated information collection process.
[0041] The process of the photoelectric information transmission method based on pulse width modulation provided in this embodiment is shown in FIG. Figure 2 , including the following steps: S1. Read device identification: In this step, the coding transmitter of the IoT device reads the device identification information.
[0042] S2. Device identification information conversion: In this step, the device identification information is converted into a binary data frame and a CRC check bit is added.
[0043] S3. Insert synchronization header signal: In this step, a continuous square wave is inserted into the head of the data frame as a synchronization header signal.
[0044] S4. Data encoding and LED driving: In this step, the Manchester encoding rule is used to map each bit in the data frame after the synchronization header signal is inserted into the LED on and off state within a certain period. The PWM interface of the main control chip of the IoT device drives the LED light of the IoT device to form a light signal sequence.
[0045] S5. Optical signal reception: In this step, the decoding receiving end receives the optical signal sequence and converts it into an analog electrical signal.
[0046] S6.Signal amplification and shaping: In this step, the analog electrical signal is amplified and threshold shaped.
[0047] S7. Data decoding: In this step, the dynamic decoding mechanism is triggered based on the synchronization header, the binary data frame is restored according to the Manchester encoding rule, the data integrity is verified through the CRC check bit, and then the device identification information is extracted.
[0048] S8. Upload the decoded data: In this step, the decoded device identification information is converted into a USB signal and transmitted to the production test software.
[0049] It should be noted that since the specific implementation of each function has been described in the functional module description of the system, and the specific steps of the method are implemented by the corresponding functional modules of the system, the specific implementation means will not be repeated in the description of the above method steps.
[0050] Although the embodiments of the present invention have been described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations may be made to these embodiments without departing from the principles and spirit of the present invention, all without departing from the scope of protection of the present invention.
Claims
1. A photoelectric information transmission system based on pulse width modulation, characterized in that: Including encoding transmitter and decoding receiver; The coding transmitter is integrated into the IoT device to implement the encoding of device identification information and optical signal modulation, including: An information preprocessing module is used to convert the device identification information of the IoT device into a binary data frame and add a CRC check bit; A synchronization header generation module is used to insert a continuous square wave as a synchronization header signal into the header of a data frame; The pulse width modulation module uses the Manchester encoding rule to map each bit in the data frame after the synchronization header signal is inserted into the LED on / off state within a certain period. The PWM interface of the IoT device's main control chip drives the IoT device's LED to form a light signal sequence. The decoding receiving end is an independent hardware device used to capture, process and decode optical signals, including: A photoelectric sensing unit, configured to receive a light signal sequence using an illumination sensor and convert the light signal into an analog electrical signal; A signal shaping module is used to amplify and threshold-shape analog electrical signals; The decoding algorithm module is used to trigger the dynamic decoding mechanism based on the synchronization header, restore the binary data frame according to the Manchester encoding rule, verify the data integrity through the CRC check bit, and then extract the device identification information; The USB transmission module is used to convert the decoded device identification information into a USB signal and transmit it to the production test software.
2. The photoelectric information transmission system based on pulse width modulation according to claim 1, characterized in that: The signal shaping module amplifies the analog electrical signal through an operational amplifier and performs threshold shaping through a Schmitt trigger.
3. The photoelectric information transmission system based on pulse width modulation according to claim 1, characterized in that: The synchronization header generation module is used to insert a continuous square wave with a period of 5ms into the header of the data frame as a synchronization header signal.
4. The photoelectric information transmission system based on pulse width modulation according to claim 1, characterized in that: The pulse width modulation module uses the Manchester encoding rule to map each bit in the data frame after the synchronization header signal is inserted into the LED on / off state within a 50ms period. If the bit is "0", it is mapped to a low level in the first 25ms and a high level in the last 25ms. If the bit is "1", it is mapped to a high level in the first 25ms period and a low level in the last 25ms. The low level corresponds to the LED off state, and the high level corresponds to the LED on state.
5. The photoelectric information transmission system based on pulse width modulation according to claim 4, characterized in that: The decoding algorithm module is based on a dynamic decoding mechanism triggered by a synchronization header, including: locking the starting point of the data frame through an edge detection algorithm, and using a dynamic phase-locked loop to track the 50ms bit period of the transmitter.
6. A method for transmitting photoelectric information based on pulse width modulation, applied to the system according to any one of claims 1 to 5, characterized in that: The method comprises the following steps: S1. The IoT device's encoding transmitter reads the device identification information; S2. Convert the device identification information into a binary data frame and add a CRC check bit; S3 inserts a continuous square wave as a synchronization header signal in the header of the data frame; S4. Using the Manchester encoding rule, each bit in the data frame after the synchronization header signal is inserted is mapped to the LED on / off state within a certain period. The PWM interface of the IoT device's main control chip drives the IoT device's LED light to form a light signal sequence; S5. The decoding receiving end receives the optical signal sequence and converts it into an analog electrical signal; S6. amplifying and threshold shaping the analog electrical signal; S7. Based on the synchronization header, the dynamic decoding mechanism is triggered, and the binary data frame is restored according to the Manchester encoding rules. The data integrity is verified using the CRC check bit, and the device identification information is then extracted. S8. Convert the decoded device identification information into a USB signal and transmit it to the production test software.
7. The photoelectric information transmission method based on pulse width modulation according to claim 6, characterized in that: In step S6, the analog electrical signal is amplified by an operational amplifier and threshold shaping is performed by a Schmitt trigger.
8. The photoelectric information transmission method based on pulse width modulation according to claim 6, characterized in that: In step S3, a continuous square wave with a period of 5 ms is inserted into the head of the data frame as a synchronization header signal.
9. The method for transmitting photoelectric information based on pulse width modulation according to claim 6, wherein: In step S4, the Manchester encoding rule is used to map each bit in the data frame after the synchronization header signal is inserted into the LED on and off state within a 50ms period. If the bit is "0", it is mapped to a low level in the first 25ms + a high level in the last 25ms. If the bit is "1", it is mapped to a high level in the first 25ms period + a low level in the last 25ms. The low level corresponds to the LED off state, and the high level corresponds to the LED on state.
10. The photoelectric information transmission method based on pulse width modulation according to claim 9, characterized in that: In step S7, the triggering of the dynamic decoding mechanism based on the synchronization header includes: locking the starting point of the data frame by an edge detection algorithm, and using a dynamic phase-locked loop to track the 50ms bit period of the transmitter.
