Method for detecting water ingress into a USB interface and electronic device
By setting a detection pin and resistor protection in the processor, water ingress into the USB interface is detected by the change of electrical signal, which solves the problem that the limited space of electronic devices makes it impossible to detect water ingress into the USB interface, and achieves cost savings and circuit protection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2020-07-31
- Publication Date
- 2026-04-21
AI Technical Summary
Electronic devices such as watches and wristbands have limited space and cannot accommodate water ingress detection chips, which means they cannot effectively detect whether water has entered the USB port, potentially leading to damage to the internal circuitry.
By setting first and second detection pins in the processor and utilizing the electrical signal changes of the first idle pin and the first voltage pin, combined with resistor and diode protection, water ingress detection of the USB interface can be achieved, avoiding the need for an additional water ingress detection chip.
It enables effective detection of water ingress into USB ports without increasing hardware costs or space, protecting internal circuitry and preventing short-circuit damage.
Smart Images

Figure CN114064381B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic testing technology, and in particular to a method and electronic device for detecting water ingress into a USB interface. Background Technology
[0002] With the development of communication technology, electronic devices such as smartphones, watches, and fitness trackers are increasingly widely used in daily life. These electronic devices can be charged or transmit data via a Universal Serial Bus (USB) interface. If the USB port gets wet, and the USB port is connected to an external power source via the USB cable, it may cause a short circuit in the USB port pins, thereby damaging the internal circuitry and components of the electronic device.
[0003] Therefore, electronic devices need to have the ability to detect water ingress into their USB ports. If the electronic device detects water ingress into the USB port, it should alert the user. This allows users to avoid connecting the electronic device to an external power source when the USB port is wet. In existing technology, electronic devices can use a water ingress detection chip to detect water ingress into the USB port. However, for some electronic devices, such as watches and fitness trackers, the limited space available for a chip prevents the installation of a water ingress detection chip. Therefore, these electronic devices cannot perform USB port water ingress detection.
[0004] Therefore, how to effectively detect water ingress into USB interfaces using fewer hardware components is an urgent problem to be solved. Summary of the Invention
[0005] This application provides a method and electronic device for detecting water ingress into a USB interface. This electronic device can perform water ingress detection of the USB interface without the need for an additional water ingress detection chip.
[0006] In a first aspect, an electronic device is provided, comprising a processor and a USB interface. The processor includes a first detection pin and a second detection pin, and the USB interface includes a first idle pin and a first voltage pin. The first detection pin is connected to the first idle pin, the second detection pin is connected to the first idle pin, and the first detection pin is connected to the second detection pin, wherein: the first detection pin is used to output a first signal, and the second detection pin receives a second signal; the first idle pin is left floating, and the first voltage pin is connected to a first voltage; the processor is used to determine water ingress into the USB interface based on changes in the second signal.
[0007] When the USB port is not wet, the second signal received by the second detection pin is determined by the first signal. When water enters the USB port, water covers the first idle pin and the first voltage pin. The voltage of the first idle pin changes to the first voltage. The second signal received by the second detection pin is determined by the first voltage. The processor can determine that the USB port is wet based on the change in the second signal. In this way, a USB water ingress detection chip is not needed; the electronic device can detect water ingress into the USB port through the processor. This saves manufacturing costs and internal space of the electronic device.
[0008] In conjunction with the first aspect, in one possible implementation, the electronic device further includes a first resistor; the first detection pin is connected to a first idle pin, specifically including: the first detection pin is connected to the first idle pin via the first resistor. Since there is voltage at the first idle pin after water enters the USB interface, this voltage will be input to the first detection pin. The first resistor serves to reduce the voltage received by the first detection pin. In this way, the first resistor can protect the first detection pin.
[0009] In conjunction with the first aspect, in one possible implementation, the electronic device further includes a second resistor connected to the first resistor; the second detection pin is connected to the first idle pin, specifically including: the second detection pin is connected to the first idle pin via the second resistor. Since water will enter the USB interface, there will be voltage at the first idle pin, and this voltage will be input to the second detection pin. The first resistor serves to reduce the voltage received by the second detection pin. In this way, the first resistor can protect the second detection pin.
[0010] In conjunction with the first aspect, in one possible implementation, the first detection pin is connected to the second detection pin, specifically by connecting the first detection pin to the second detection pin via a first resistor and a second resistor. The first voltage signal output from the first detection pin is divided by the first resistor and the second resistor and then input to the second detection pin. In this way, the first resistor and the second resistor can protect the second detection pin and prevent overvoltage.
[0011] In conjunction with the first aspect, in one possible implementation, the USB interface further includes a second idle pin and a second voltage pin, with the second detection pin connected to the second idle pin; wherein: the second idle pin is left floating, and the second voltage pin is connected to a second voltage.
[0012] In conjunction with the first aspect, in one possible implementation, the second voltage is equal to the first voltage.
[0013] In conjunction with the first aspect, in one possible implementation, the electronic device further includes a first resistor and a second resistor connected together; a first detection pin is connected to a first idle pin, specifically by connecting the first detection pin to the first idle pin via the first resistor; a second detection pin is connected to a second idle pin, specifically by connecting the second detection pin to the second idle pin via the second resistor. Thus, when water enters the USB interface, if the first idle pin and the first voltage pin are not covered by liquid, while the second detection pin and the second voltage pin are covered by liquid, the processor can also detect the water ingress into the USB interface.
[0014] In conjunction with the first aspect, in one possible implementation, the first resistor includes a first pin and a second pin, and the second resistor includes a third pin and a fourth pin;
[0015] The first detection pin is connected to the first idle pin through the first resistor, specifically including: the first detection pin is connected to the first pin, and the second pin is connected to the first idle pin;
[0016] The second detection pin is connected to the second idle pin through the second resistor, specifically including: the second detection pin is connected to the third pin, and the fourth pin is connected to the second idle pin;
[0017] The first resistor is connected to the second resistor, specifically including the connection between the second pin and the fourth pin.
[0018] In conjunction with the first aspect, in one possible implementation, the first resistor is connected to the second resistor, specifically including: the second pin is connected to the third pin.
[0019] In conjunction with the first aspect, in one possible implementation, the first resistor is connected to the second resistor, specifically including: the first pin is connected to the third pin.
[0020] In conjunction with the first aspect, in one possible implementation, the first resistor is connected to the second resistor, specifically including: the first pin is connected to the fourth pin.
[0021] In conjunction with the first aspect, in one possible implementation, the electronic device further includes a first diode and a second diode; wherein: a first detection pin is connected to the anode of the first diode, a first resistor is connected to the anode of the first diode, a second detection pin is connected to the anode of the second diode, and a second resistor is connected to the anode of the second diode; the cathode of the first diode is connected to a third voltage, and the second diode is connected to a fourth voltage. In this way, the first and second diodes can prevent excessive voltage from being received at the second detection pin. The first and second diodes can protect the second detection pin.
[0022] In conjunction with the first aspect, in one possible implementation, the first signal is a periodically changing voltage signal, and the first voltage is greater than the voltage value of the highest level of the first signal.
[0023] In conjunction with the first aspect, in one possible implementation, the processor is specifically used to: determine that the USB interface has not been exposed to water when the change period of the second signal is the same as the change period of the first signal; and determine that the USB interface has been exposed to water when the change period of the second signal is different from the change period of the first signal.
[0024] In conjunction with the first aspect, in one possible implementation, the processor is specifically used to: determine that the USB interface has been flooded when the second signal is a fixed value.
[0025] In conjunction with the first aspect, in one possible implementation, the first signal is a fifth voltage with a fixed voltage, and the fifth voltage is less than the first voltage.
[0026] In conjunction with the first aspect, in one possible implementation, the processor is specifically used to: determine that the USB interface has not been in contact with water when the second signal is less than or equal to the first threshold, the first threshold being determined based on the fifth voltage; and determine that the USB interface has been in contact with water when the second signal is greater than or equal to the second threshold, the second threshold being determined based on the first voltage, the second threshold being greater than the first threshold.
[0027] In conjunction with the first aspect, in one possible implementation, in the first preset USB protocol, the second idle pin is in an idle state when the USB interface is charging or transmitting data.
[0028] In conjunction with the first aspect, in one possible implementation, the first frequency of the first signal output by the first detection pin is less than or equal to the upper limit of the frequency at which the second signal is received by the second detection pin.
[0029] In conjunction with the first aspect, in one possible implementation, the first detection pin has a first internal resistance, and the second detection pin has a second internal resistance; wherein the resistance value of the first resistor is less than the resistance value of the first internal resistance, and the resistance value of the second resistor is less than the resistance value of the second internal resistance. If the resistance values of the first and second resistors are too large, the second signal received by the second detection pin will be relatively small and may not be detected. Therefore, limiting the values of the first and second resistors can avoid affecting the detection of the second signal.
[0030] Secondly, this application provides a method for detecting water ingress into a USB interface. The method is applied to an electronic device, which includes a processor and a USB interface. The processor includes a first detection pin and a second detection pin, and the USB interface includes a first idle pin and a first voltage pin. The first detection pin is connected to the first idle pin, and the second detection pin is connected to the first idle pin. The method includes: the electronic device outputting a first signal through the first detection pin; the electronic device acquiring a second signal received by the second detection pin; and the electronic device determining water ingress into the USB interface based on the change of the second signal.
[0031] The electronic device can output a first signal through the processor's first detection pin, and then detect a second signal from the processor's second detection pin. If the change period of the second signal matches the first signal, the electronic device determines that the USB interface is not wet; if the second signal is a fixed value, the electronic device determines that the USB interface is wet. No additional USB interface water ingress detection chip is needed; the electronic device can perform USB interface water ingress detection. This saves on manufacturing costs and reduces power consumption.
[0032] In conjunction with the second aspect, in one possible implementation, the first voltage pin is connected to the first voltage, and the first idle pin is left floating.
[0033] In conjunction with the second aspect, in one possible implementation, the first signal is a periodically changing voltage signal, and the first voltage is greater than the voltage value of the highest level of the first signal.
[0034] In conjunction with the second aspect, in one possible implementation, the electronic device determines that the USB interface has been infiltrated by water based on the change of the second signal, including: when the change period of the second signal is the same as the change period of the first signal, the electronic device determines that the USB interface has not been infiltrated by water; when the change period of the second signal is different from the change period of the first signal, the electronic device determines that the USB interface has been infiltrated by water.
[0035] In conjunction with the second aspect, in one possible implementation, when the change period of the second signal is different from the change period of the first signal, the electronic device determines that the USB interface has been flooded. Specifically, when the second signal is a fixed value, the electronic device determines that the USB interface has been flooded.
[0036] In conjunction with the second aspect, in one possible implementation, the first signal is a fifth voltage with a fixed voltage, and the fifth voltage is less than the first voltage.
[0037] In conjunction with the second aspect, in one possible implementation, the electronic device determines that the USB interface has been infiltrated by water based on the change of the second signal, including: when the second signal is less than or equal to a first threshold, the electronic device determines that the USB interface has not been infiltrated by water, the first threshold being determined based on a fifth voltage; when the second signal is greater than or equal to a second threshold, the electronic device determines that the USB interface has been infiltrated by water, the second threshold being determined based on a first voltage, and the second threshold being greater than the first threshold.
[0038] Thirdly, an electronic device is provided, comprising: a communication interface, a memory, and a processor; the communication interface, the memory, and the processor are coupled together, the memory being used to store computer program code, the computer program code including computer instructions, wherein when the processor reads the computer instructions from the memory, the electronic device executes any possible implementation as described in the first aspect.
[0039] Fourthly, a computer-readable storage medium is provided, comprising instructions, characterized in that, when the instructions are executed on an electronic device, the electronic device performs any possible implementation as described in the second aspect.
[0040] Fifthly, a computer product is provided such that when the computer program product is run on a computer, the computer performs any of the possible implementations of the second aspect. Attached Figure Description
[0041] Figure 1A-Figure 1B A schematic diagram of an electronic device provided in an embodiment of this application;
[0042] Figure 2 A schematic diagram of another electronic device provided in the embodiments of this application;
[0043] Figure 3 A schematic diagram of a USB interface provided in an embodiment of this application;
[0044] Figure 4 A schematic diagram of a USB interface water ingress detection circuit provided in an embodiment of this application;
[0045] Figure 5 This is a schematic diagram of the hardware structure of a USB interface water ingress detection device provided in an embodiment of this application;
[0046] Figures 6-7 A circuit diagram of a USB interface before it gets wet, provided as an embodiment of this application;
[0047] Figures 8-9 A circuit diagram illustrating a USB interface after water ingress is provided in an embodiment of this application;
[0048] Figure 10 A schematic diagram of the voltage waveform of a pin in an electronic device provided in an embodiment of this application;
[0049] Figure 11 A schematic diagram of the hardware structure of another USB interface water ingress detection device provided in this application embodiment;
[0050] Figures 12-13 A circuit diagram of a USB interface before it gets wet, provided as an embodiment of this application;
[0051] Figures 14-15 A circuit diagram illustrating a USB interface after water ingress is provided in an embodiment of this application;
[0052] Figure 16 A schematic diagram of the hardware structure of another USB interface water ingress detection device provided in an embodiment of this application;
[0053] Figures 17-18 A circuit diagram of a USB interface before it gets wet, provided as an embodiment of this application;
[0054] Figures 19-20 A circuit diagram illustrating a USB interface after water ingress is provided in an embodiment of this application;
[0055] Figure 21 A schematic diagram of the hardware structure of another USB interface water ingress detection device provided in an embodiment of this application;
[0056] Figures 22-23 A circuit diagram of a USB interface before it gets wet, provided as an embodiment of this application;
[0057] Figures 24-25 A circuit diagram illustrating a USB interface after water ingress is provided in an embodiment of this application;
[0058] Figure 26 This is a schematic diagram of the hardware structure of a USB interface water ingress detection device provided in an embodiment of this application;
[0059] Figures 27-28 A circuit diagram of a USB interface before it gets wet, provided as an embodiment of this application;
[0060] Figures 29-30 A circuit diagram illustrating a USB interface after water ingress is provided in an embodiment of this application;
[0061] Figure 31 A schematic diagram of the hardware structure of another USB interface water ingress detection device provided in an embodiment of this application;
[0062] Figures 32-33 A circuit diagram of a USB interface before it gets wet, provided as an embodiment of this application;
[0063] Figures 34-35A circuit diagram illustrating a USB interface after water ingress is provided in an embodiment of this application;
[0064] Figure 36 A schematic diagram of the hardware structure of another USB interface water ingress detection device provided in an embodiment of this application;
[0065] Figures 37-38 A circuit diagram of a USB interface before it gets wet, provided as an embodiment of this application;
[0066] Figures 39-40 A circuit diagram illustrating a USB interface after water ingress is provided in an embodiment of this application;
[0067] Figure 41 A flowchart illustrating a method for water ingress into a USB interface, provided in an embodiment of this application;
[0068] Figure 42 A user interface diagram provided for an embodiment of this application;
[0069] Figure 43 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0070] Figure 44 This is a schematic diagram of a software framework provided for an embodiment of this application. Detailed Implementation
[0071] The technical solutions in the embodiments of this application will now be described clearly and in detail with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0072] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0073] Many electronic devices today (such as wristbands, watches, mobile phones, computers, etc.) have USB ports. For example, Figure 1A and Figure 1B The wristband 100 is shown. Figure 1AAs shown, the bracelet 100 may include a bracelet body 101 and a wristband watch 102. (As...) Figure 1B As shown, the main body 101 of the wristband may include a USB interface 103. It is understood that... Figure 1B The USB interface 103 in the bracelet 100 is shown only as an example; the location of the USB interface in the bracelet 100 is not limited in this embodiment. Figure 2 As shown, Figure 2 A watch 200 is illustrated as an example, which may include a USB interface 201. It is understood that... Figure 2 The USB interface 201 in the watch 200 is shown only as an example, and the specific location of the USB interface in the watch 200 is not limited in this embodiment.
[0074] Bracelet 100, watch 200, and other electronic devices such as mobile phones can be connected via USB interface (e.g. Figure 1B The USB interface 103 shown is connected to an external power source for charging. Electronic devices can also connect to other electronic devices for data transfer via the USB interface. However, when water gets into the USB interface, the water will connect to multiple pins in the USB connector. Therefore, connecting an external power source to a water-damaged USB interface may damage some components in the electronic device (e.g., damage to the internal resistance of the USB interface, or burnout of the electronic device's battery). USB interfaces are generally classified into several types, such as mini USB, micro USB, and USB Type-C. This application uses USB Type-C as an example for illustration. For details on mini USB and micro USB, please refer to the descriptions in the prior art; these will not be repeated in this application.
[0075] Figure 3 A schematic diagram of a USB Type-C interface is shown. (For example...) Figure 3 As shown, the USB Type-C interface can include 24 pins. Of these 24 pins, pins A1-A12 (12 pins in total) and pins B1-B12 (12 pins in total) are symmetrically arranged vertically. Pins A1, B1, A12, and B12 are GND pins, i.e., ground pins. Pins A4, B4, A9, and B9 are VBUS pins, i.e., voltage pins. In the USB 3.1 protocol, the voltage at the VBUS pins is 5V. The USB Type-C interface also includes pins CC1, CC2, TX1+, TX1-, TX2+, TX2-, D-, D+, TX1+, TX1-, TX2+, TX2-, SBU1, SBU2, etc. The functions of these pins can be found in existing technologies and will not be elaborated here.
[0076] In the existing USB protocol, all VBUS and GND pins are used when the USB interface is charging. When the USB interface is transmitting data, pins CC1, CC2, TX1+, TX1-, TX2+, TX2-, D-, D+, TX1+, TX1-, TX2+, and TX2- are used. When the USB interface is charging and transmitting data, both SBU1 and SBU2 pins may not be used. In this embodiment, pins that are not used for charging and / or transmitting data are referred to as idle pins.
[0077] Understandably, with the evolution of the USB protocol, the number of idle pins in a USB interface can vary. No limit is placed on the number of idle pins in a USB interface here.
[0078] When a USB port is exposed to liquid (such as water), the liquid can connect some pins. For example, if liquid covers the area between pins A4 (VBUS) and A5 (SBU1), then the VBUS and SBU1 pins will be connected through the liquid. In this case, the voltage at the SBU1 pin will be equal to the voltage at the VBUS pin. Similarly, if liquid covers the area between pins B9 (VBUS) and B8 (SBU1), then the VBUS and SBU2 pins will be connected through the liquid. In this case, the voltage at the SBU2 pin will be equal to the voltage at the VBUS pin.
[0079] When water or liquid gets into the USB port, the electronic device needs to detect it promptly. This allows the device to alert the user. If the USB port is wet and connected to an external power source via the USB cable, it could short-circuit the USB port pins, potentially damaging the device's internal circuitry and components. This prevents users from unknowingly connecting the USB port to an external power source when it is wet.
[0080] Figure 4 A circuit diagram of a USB interface water ingress detection device provided in the prior art is shown. Figure 4As shown, the USB interface water ingress detection circuit may include a processor 300, a water ingress detection chip 301, a logic chip 302, an audio codec chip 303, a digital signal processor 304, and a USB interface 305. Specifically, the SBU1 and SBU2 pins of the water ingress detection chip 301 are connected to the SBU1 and SBU2 pins of the USB interface 305, respectively. The DN_L pin of the water ingress detection chip 301 is connected to the DN pin of the USB interface 305. The DP_R pin of the water ingress detection chip 301 is connected to the DP pin of the USB interface 305. When the voltage of any pin in the water ingress detection chip 301 exceeds a preset threshold, the water ingress detection chip 301 reports this to the processor 300. The processor 300 identifies the pins whose voltage exceeds the preset threshold. If the voltage at the SBU1, SBU2, DP, and DN pins of the water ingress detection chip 301 exceeds the preset threshold, the processor 300 determines that water has entered the USB interface 305. The logic chip 302 can be used to determine whether the USB cable inserted into the USB interface is plugged in correctly or incorrectly. The audio codec chip 303 can be used for audio stream encoding and decoding. The digital signal processor 304 can be used to transmit digital signals. Here, the specific functions of the processor 300, water ingress detection chip 301, logic chip 302, audio codec chip 303, digital signal processor 304, and USB interface 305 can be found in existing technology and will not be described in detail here.
[0081] In existing USB interface water ingress detection circuits, an additional chip is required, namely... Figure 4 The water ingress detection chip 301 shown is used to detect whether water has entered the USB interface. However, some electronic devices (such as...) Figure 1A The limited size of the hardware in the illustrated wristband prevents the placement of a dedicated chip for water ingress detection. This prevents these electronic devices from performing water ingress detection via the USB interface.
[0082] To address the problems in existing technologies, this application provides a USB interface water ingress detection device for electronic devices. The device includes a processor and a USB interface. The processor may include a first detection pin and a second detection pin, and the USB interface may include a first idle pin and a first voltage pin. Both the first and second detection pins are connected to the first idle pin. The first detection pin outputs a first signal, and the first voltage pin is connected to a first voltage. The first idle pin is floating in the USB interface and is not connected to voltage. The processor determines that the USB interface is infested with water based on a change in a second signal at the second detection pin. When the USB interface is not infested with water, the second signal received by the second detection pin is determined by the first signal. When the USB interface is infested with water, water covers the first idle pin and the first voltage pin. The voltage of the first idle pin changes to the first voltage. The second signal received by the second detection pin is determined by the first voltage. The processor can determine that the USB interface is infested with water based on the change in the second signal. Thus, a USB water ingress detection chip is unnecessary; the electronic device can detect water ingress into the USB interface directly through the processor. This saves manufacturing costs and internal space for the electronic device.
[0083] The USB interface water ingress detection device provided in this application embodiment is described in detail below with reference to the accompanying drawings.
[0084] Figure 5 This diagram illustrates a structural block diagram of a USB interface water ingress detection device according to an embodiment of this application. The USB interface water ingress detection device provided in this embodiment can be... Figure 1A The wristband 100 shown, and Figure 2 The watch 200 shown, or electronic devices such as mobile phones and tablets, etc. Figure 5 As shown in the figure, a USB interface water ingress detection device provided in this application embodiment may include: a processor 500 and a USB interface 530. The processor 500 may include a first detection pin 501 and a second detection pin 502. The USB interface may include a first idle pin 531 and a first voltage pin 534. Wherein:
[0085] The first detection pin 501 is connected to the first idle pin 531, the first detection pin 501 is connected to the second detection pin 502, and the second detection pin 502 is connected to the first idle pin 531.
[0086] The first detection pin 501 outputs the first signal.
[0087] In one possible implementation, the first signal is a periodically changing signal. The transmission frequency of the first signal is related to the sampling frequency of the second detection pin 502. The transmission frequency of the first signal can be a first frequency. The sampling frequency of the second detection pin 502, that is, the frequency at which the second detection pin 502 can receive signals, has an upper frequency limit. The first frequency is less than the upper frequency limit. This application embodiment does not limit the specific magnitude of the first frequency and the upper frequency limit. The maximum voltage of the first signal does not exceed a first threshold. The first threshold is the maximum voltage value that the first detection pin 501 can withstand. That is, if the voltage at the first detection pin 501 exceeds the first threshold, the internal resistance of the first detection pin 501 will be overvoltage.
[0088] The first idle pin 531 is a floating pin in the USB interface 530. That is, no voltage is applied to the first idle pin 531. The first idle pin 531 is a pin in the USB interface 530 that is in an idle state.
[0089] The first voltage pin 534 is connected to a first voltage. This first voltage is greater than the maximum value of the first signal. For example, if the maximum value of the first signal is 1.8V, then the first voltage is greater than 1.8V.
[0090] The second detection pin 502 receives the second signal.
[0091] It is understandable that there may be internal resistance in the first detection pin 501 and the second detection pin 502; this is not a limitation.
[0092] The processor 500 can determine if the USB interface 530 is in water based on the change in the second signal.
[0093] In one possible implementation, if the change in the second signal is the same as the change in the first signal, the processor 500 determines that the USB interface 530 has not been exposed to water. If the second signal is a constant value, the processor 500 determines that the USB interface 530 has been exposed to water.
[0094] In this way, a USB water ingress detection chip is unnecessary; the electronic device can detect water ingress into the USB interface directly through the processor. This saves on manufacturing costs and internal space for the electronic device.
[0095] Figure 6 It shows Figure 5 The circuit diagram of the USB interface detection circuit device provided in the document before water ingress into the USB interface. Figure 5 The first detection pin 501 shown in the diagram can be Figure 6 The GPIO pins are shown. Here, a GPIO pin can be a pin in a general-purpose input / output (GPIO) module. Figure 5 The second detection pin 502 shown can be Figure 6 The ADC pins are shown in the diagram. Here, the ADC pins can be one of the pins in an analog-to-digital converter (ADC). Figure 5 The first free pin 531 in the middle can be Figure 6 The SBU1 pin is shown in the image. Figure 5 The first voltage pin 534 shown in the diagram can be Figure 6 The VBUS pins are shown in the image. Figure 6 The GPIO pins are connected to the ADC pins and the SBU1 pins. The ADC pins are connected to the SBU1 pins. Figure 6 The SBU1 pin in the middle can be Figure 3 The A5 pin in the USB interface is shown. Figure 6 The VBUS pin can be Figure 3 The A4 pin in the USB interface is shown. It can be understood that the first idle pin 531 can be a pin in the USB interface that is in an idle state, for example... Figure 3 The B8 pin shown is the SBU2 pin.
[0096] Figure 7 To Figure 6 The diagram shows a simplified circuit diagram of the USB interface before it gets wet. Figure 7 As shown, before the USB interface is submerged in water, the second signal received at the ADC pin (e.g.) Figure 7 V2 shown in the figure is equal to the first signal output by the GPIO pin (e.g., Figure 7 (V1 shown). Since the USB interface is not wet, the voltage at the USB1 pin is 0. At this time, the voltage signal V1 output from the GPIO pin can be directly input to the ADC pin. Figure 7 In the circuit shown, the current can flow from the GPIO pin to the ADC pin.
[0097] Figure 8 It shows Figure 5 The circuit diagram of the USB interface after water ingress in the USB interface detection device provided in the document is shown. Figure 8 As shown, after water entered the USB 530 interface, the liquid covered the SBU1 and VBUS pins, meaning the SBU1 and VBUS pins were connected through the liquid. Therefore, the voltage at the VBUS pin was supplied to the SBU1 pin through the liquid. Figure 5 The first detection pin 501 shown in the diagram can be Figure 8 The GPIO pins are shown. Figure 5 The second detection pin 502 shown can be Figure 8 The ADC pins are shown in the diagram. Figure 5 The first free pin 531 in the middle can be Figure 8 The SBU1 pin is shown in the image. Figure 5 The first voltage pin 534 shown in the diagram can be Figure 8 The VBUS pins are shown in the image. Figure 8 The GPIO pins, ADC pins, SBU1 pins, and VBUS pins shown are for reference. Figure 6 The description in the text will not be repeated here.
[0098] Figure 9 To Figure 8 The diagram shows a simplified circuit diagram of the USB interface after it has been submerged in water. Figure 9 As shown, the voltage V1 of the VBUS pin is supplied to the SBU1 pin. The voltage at the SBU1 pin is higher than the voltage at the GPIO pin. Therefore, the current flow direction in the circuit is different before and after the USB interface is submerged in water. After the USB interface is submerged in water, the voltage V2 at the ADC pin is equal to the voltage V3 at the SBU1 pin.
[0099] In a USB water ingress detection device provided in this application embodiment, the second signal received at the second detection pin is different before and after water enters the USB interface. For example, Figure 7 In the circuit diagram shown, before water enters the USB interface, the second signal at the second detection pin can be equal to V1. For example, Figure 9 In the circuit diagram shown, after water enters the USB interface, the second signal at the second detection pin can be equal to V3. V1 is a periodically changing voltage signal. V3 is a constant voltage signal. Thus, the processor 500 can determine whether the USB interface has entered water based on the second signal at the second detection pin. If the second signal is a periodically changing voltage signal, the processor 500 determines that the USB interface 530 has not entered water. If the second signal is a voltage signal that does not change within a certain time, the processor 500 determines that the USB interface has entered water.
[0100] Figure 10 A schematic diagram of the waveforms of the first and second signals is shown as an example. Figure 10 As shown, the first signal output by the first detection pin 501 can be as follows: Figure 10 The first signal shown is 800, a periodically changing square wave signal. The first signal can be a square wave, a sine wave, a cosine wave, etc., and is not limited here. When the first signal is... Figure 10 The square wave signal shown, and assuming the USB port is not wet, the second signal can be... Figure 10 The second signal 801 is shown in the diagram. The second signal 801 is a periodically changing square wave signal, with the same period as the first signal 800. After water enters the USB interface, the second signal can be as follows: Figure 10 The second signal 802 is shown. The second signal 802 is a voltage signal whose value changes by 0 within a certain time period.
[0101] Optionally, the USB interface water ingress detection device provided in this application embodiment may further include a first resistor and a second resistor. Figure 11 This illustration shows yet another USB interface water ingress detection device provided in an embodiment of this application. For example... Figure 11 As shown, the USB interface water ingress detection device may include: a processor 500, a first resistor 500, a second resistor 520, and a USB interface 530. The processor 500 may include a first detection pin 501 and a second detection pin 502. The USB interface 530 may include a first idle pin 531 and a first voltage pin 534. Wherein:
[0102] The first detection pin 501 is connected to the first idle pin 531 via the first resistor 510. The second detection pin 502 is connected to the first idle pin 531 via the second resistor 520. The first resistor 510 can be connected to the second resistor 520. The first detection pin 501 can be connected to the second detection pin 502 via the first resistor 510, the second resistor 520, and the second detection pin 502.
[0103] For details regarding the first detection pin 501 and the second detection pin 502, please refer to the above. Figure 5 The description in the document is omitted here. For information on the first idle pin 531 and the first voltage pin 534, please refer to the above. Figure 5 The description in the text will not be repeated here.
[0104] The resistance values of the first resistor 510 and the second resistor 520 are related to the first signal output from the first detection pin 501. The larger the value of the first signal, the larger the resistance values of the first resistor 510 and the second resistor 520. The resistance value of the first resistor 510 is less than the internal resistance value in the first detection pin. The resistance value of the second resistor 520 is less than the internal resistance value in the second detection pin. For example, the resistance value of the first resistor 510 can be 330 kΩ, and the resistance value of the second resistor 520 can be 1 kΩ. This application embodiment does not limit the specific resistance values of the first resistor 510 and the second resistor 520.
[0105] It is understood that the first resistor 510 can be composed of one or more resistors, or it can be composed of multiple different components (e.g., capacitors, inductors, etc.) forming an equivalent resistance; this is not limited here. The second resistor 520 can be composed of one or more resistors, or it can be composed of multiple different components (e.g., capacitors, inductors, etc.) forming an equivalent resistance; this is not limited here.
[0106] The first resistor 510 may include pins A and B, and the second resistor 520 may include pins C and D. There are several ways to connect the first resistor 510 and the second resistor 520, such as connecting pins A and C, pins A and D, pins B and C, or pins B and D. Please refer to the descriptions below for details, which will not be elaborated upon here.
[0107] Figure 12 It shows Figure 11 The circuit diagram of the USB interface detection circuit device provided in the document before water ingress into the USB interface. Figure 11 The first detection pin 501 shown in the diagram can be Figure 12 GPIO pins in the system. Figure 11 The second detection pin 502 shown in the figure can be Figure 12 The ADC pin in the code. Figure 11 The first resistor 510 shown in the figure can be Figure 12 The resistor R1 is shown in the figure. Figure 11 The second resistor 520 shown in the figure can be Figure 12 The resistor R2 is shown in the figure. Figure 11 The first free pin shown in the figure can be Figure 12 The SBU1 pin in the middle. Figure 11 The first voltage pin 534 shown in the diagram can be Figure 12 The VBUS pin is specified in the provided text. For information on GPIO pins, ADC pins, SBU1 pins, and VBUS pins, please refer to [reference needed]. Figure 6 The description in the text will not be repeated here.
[0108] Figure 12 Resistor R1 may include pins A and B. Resistor R2 may include pins C and D. The connection between resistors R1 and R2 may include connecting pin B of resistor R1 and pin D of resistor R2.
[0109] Figure 13 To Figure 12 The diagram shows a simplified circuit diagram of the USB interface before it gets wet. Figure 13 As shown, before the USB interface is exposed to water, the voltage at the SBU1 pin is 0. At this time, the voltage signal V1 output from the GPIO pin is input to the ADC pin after passing through resistors R1 and R2. The voltage at the ADC pin is V2 = V1 - V(R1) - V(R2). V(R1) represents the voltage across resistor R1, and V(R2) represents the voltage across resistor R2. Thus, when the voltage V1 output from the GPIO pin is too high or exceeds the maximum threshold voltage at the ADC pin, resistors R1 and R2 can divide the voltage, protecting the ADC pin.
[0110] Figure 14 It shows Figure 11The circuit diagram of the USB interface after water ingress in the provided USB interface detection device. Figure 14 As shown, after water entered the USB interface, the liquid covered the SBU1 and VBUS pins, meaning the SBU1 and VBUS pins were connected through the liquid. Therefore, the voltage at the VBUS pin was supplied to the SBU1 pin through the liquid. Figure 11 The first detection pin 501 shown in the diagram can be Figure 14 GPIO pins in the system. Figure 11 The second detection pin 502 shown in the figure can be Figure 14 The ADC pin in the code. Figure 11 The first resistor 510 shown in the figure can be Figure 14 The resistor R1 is shown in the figure. Figure 11 The second resistor 520 shown in the figure can be Figure 14 The resistor R2 is shown in the figure. Figure 11 The first free pin shown in the figure can be Figure 14 The SBU1 pin in the middle. Figure 11 The first voltage pin 534 shown in the diagram can be Figure 14 The VBUS pin is specified in the provided text. For information on GPIO pins, ADC pins, SBU1 pins, and VBUS pins, please refer to [reference needed]. Figure 6 The description in the text will not be repeated here.
[0111] Figure 14 Resistor R1 may include pins A and B. Resistor R4 may include pins C and D. The connection between resistors R1 and R2 may include connecting pin B of resistor R1 and pin D of resistor R2.
[0112] Figure 15 for Figure 14 The diagram shows a simplified circuit diagram of the USB interface after it has been submerged in water. Figure 15 As shown, after the USB interface gets wet, the VBUS pin connects to the SBU1 pin through the liquid. The voltage at the SBU1 pin changes from 0 volts before water ingress to V3. The voltage at the SBU1 pin is higher than that at the GPIO pin. Thus, the current flow in the circuit differs before and after water ingress. After water ingress, the current flow in the circuit splits into two paths. One current flows from the SBU1 pin to the GPIO pin. The other current flows from the SBU1 pin to the ADC pin. At this time, the voltage at the ADC pin is V2 = V3 - V(R2), where V(R2) represents the voltage across resistor R2.
[0113] In a USB interface water ingress detection device provided in this application embodiment, the second detection pin 502 (e.g., an ADC pin) in the processor 500 receives different voltage signals before and after water ingress into the USB interface 530. Thus, the processor 500 can determine whether the USB interface 530 has been ingressed with water based on the change in the second signal. If the second signal is a periodically changing voltage signal, the processor 500 determines that the USB interface 530 has not been ingressed with water. If the second signal does not change within a certain time, the processor 500 determines that the USB interface has been ingressed with water. Furthermore, the first resistor 510 and the second voltage 520 in this device can protect the second detection pin before water ingress into the USB interface 530, preventing overvoltage. After water ingress into the USB interface 530, the first resistor 510 can protect the first detection pin 501, preventing overvoltage. The second resistor 520 can protect the second detection pin 502, preventing overvoltage.
[0114] Optionally, the above Figure 11 In the illustrated USB water ingress detection device, the USB interface 530 may further include more idle pins and voltage-connected pins. When the USB water ingress detection device uses only the first idle pin and the first voltage pin of the USB interface, the device can detect whether water has entered between the first idle pin and the first voltage pin. When the device includes multiple pins of the USB interface, the device can detect whether water has entered between these multiple pins. This allows for the detection of water ingress over a wider area of the USB interface.
[0115] In an exemplary example, Figure 16 A schematic diagram of another USB interface water ingress detection device is shown. Figure 16 As shown, the USB interface water ingress detection device may include: a processor 500, a first resistor 500, a second resistor 520, and a USB interface 530. The processor 500 may include a first detection pin 501 and a second detection pin 502. The USB interface 530 may include a first idle pin 531 and a first voltage pin 534, as well as a second idle pin 532 and a second voltage pin 533. Wherein:
[0116] The first detection pin 501 is connected to the first idle pin 531 via the first resistor 510. The second detection pin 502 is connected to the second idle pin 532 via the second resistor 520. The first resistor 510 can be connected to the second resistor 520. The first detection pin 501 can be connected to the second detection pin 502 via the first resistor 510, the second resistor 520, and the second detection pin 502.
[0117] The second idle pin 532 is floating in the USB interface 530 and has no voltage applied. The second idle pin 532 is a pin in an idle state. For example, Figure 3 The B8 pin (i.e., SBU2 pin) is shown in the diagram. The second voltage pin can be... Figure 3 As shown in the diagram, pin B9 (i.e., the VBUS pin) is connected to the second voltage pin 533. The second voltage can be equal to the first voltage; this is not limited here.
[0118] For details regarding the first detection pin 501 and the second detection pin 502, please refer to the above. Figure 5 The description in the document is omitted here. For information on the first idle pin 531 and the first voltage pin 534, please refer to the above. Figure 5 The description in the text will not be repeated here.
[0119] For details regarding the resistance values of the first resistor 510 and the second resistor 520, as well as the connection method of the first resistor 510 and the second resistor 520, please refer to the above. Figure 11 As described in the text, it will not be repeated here.
[0120] Figure 17 It shows Figure 16 The circuit diagram of the USB interface detection circuit device provided in the document before water ingress into the USB interface. Figure 16 The first detection pin 501 shown in the diagram can be Figure 17 GPIO pins in the system. Figure 16 The second detection pin 502 shown in the figure can be Figure 17 The ADC pin in the code. Figure 16 The first resistor 510 shown in the figure can be Figure 17 The resistor R1 is shown in the figure. Figure 16 The second resistor 520 shown in the figure can be Figure 17 The resistor R2 is shown in the figure. Figure 16 The first free pin shown in the figure can be Figure 17 The SBU1 pin in the middle. Figure 16 The first voltage pin 534 shown in the diagram can be Figure 17 VBUS1 pin. Figure 16 The second free pin 532 shown in the figure can be Figure 17 The SBU2 pin in the middle. Figure 16 The second voltage pin 533 shown in the diagram can be Figure 17 The VBUS2 pin is mentioned. For information on GPIO pins, ADC pins, and SBU1 pins, please refer to [reference needed]. Figure 6 The description in [the documentation] will not be repeated here. Please refer to [the documentation] for the VBUS1 and VBUS2 pins. Figure 6 The description of the VBUS pins is already provided and will not be repeated here. For the SBU2 pins, please refer to [reference needed]. Figure 6 The description of the SBU1 pins is already provided and will not be repeated here.
[0121] Figure 17 Resistor R1 may include pins A and B. Resistor R2 may include pins C and D. The connection between resistors R1 and R2 may include connecting pin B of resistor R1 and pin D of resistor R2.
[0122] Figure 18 To Figure 17 The diagram shows a simplified circuit diagram of the USB interface before it gets wet. Figure 18 As shown, before the USB interface is exposed to water, the voltage at the SBU1 pin is 0. At this time, the voltage signal V1 output from the GPIO pin is input to the ADC pin after passing through resistors R1 and R2. The voltage at the ADC pin is V2 = V1 - V(R1) - V(R2). V(R1) represents the voltage across resistor R1, and V(R2) represents the voltage across resistor R2. Thus, when the voltage V1 output from the GPIO pin is too high or exceeds the maximum threshold voltage at the ADC pin, resistors R1 and R2 can divide the voltage, protecting the ADC pin.
[0123] Figure 19 It shows Figure 16 The circuit diagram of the USB interface after water ingress in the provided USB interface detection device. Figure 19 As shown, after water enters the USB port, the liquid covers the SBU1 and VBUS1 pins, meaning the SBU1 and VBUS pins are connected through the liquid. Therefore, the voltage at the VBUS1 pin will be supplied to the SBU1 pin through the liquid. Similarly, the liquid covers the SBU2 and VBUS2 pins, meaning the SBU2 and VBUS pins are connected through the liquid. Therefore, the voltage at the VBUS2 pin will be supplied to the SBU2 pin through the liquid. Figure 16 The first detection pin 501 shown in the diagram can be Figure 19 GPIO pins in the system. Figure 16 The second detection pin 502 shown in the figure can be Figure 19 The ADC pin in the code. Figure 16 The first resistor 510 shown in the figure can be Figure 19 The resistor R1 is shown in the figure. Figure 16 The second resistor 520 shown in the figure can be Figure 19 The resistor R2 is shown in the figure. Figure 16 The first free pin shown in the figure can be Figure 19 The SBU1 pin in the middle. Figure 16 The first voltage pin 534 shown in the diagram can be Figure 19 VBUS1 pin. Figure 16 The second free pin 532 shown in the figure can be Figure 19 The SBU2 pin in the middle. Figure 16 The second voltage pin 533 shown in the diagram can be Figure 19 VBUS2 pin.
[0124] In one possible implementation, the first idle pin 531 and the first voltage pin 534 are adjacent. The second idle pin 532 and the second voltage pin 533 are adjacent.
[0125] Figure 20 for Figure 19 The diagram shows a simplified circuit diagram of the USB interface after it has been submerged in water. Figure 20 As shown, after the USB interface gets wet, the VBUS1 pin connects to the SBU1 pin through the liquid. The voltage at the SBU1 pin changes from 0 volts before water ingress to V3. The VBUS2 pin connects to the SBU1 pin through the liquid. The voltage at the SBU2 pin changes from 0 volts before water ingress to V3. The voltages at the SBU1 and SBU2 pins are higher than those at the GPIO pins. Thus, the current flow in the circuit before and after water ingress into the USB interface is different. After water ingress into the USB interface, the current flow in the circuit splits into two paths. One current flows from the SBU1 pin to the GPIO pin. The other current flows from the SBU2 pin to the ADC pin. At this time, the voltage at the ADC pin is V2 = V3 - V(R2). V(R2) represents the voltage across resistor R2.
[0126] In a USB interface water ingress detection device provided in this application embodiment, the second detection pin 502 (e.g., an ADC pin) in the processor 500 receives different voltage signals before and after water ingress into the USB interface 530. Thus, the processor 500 can determine whether the USB interface 530 has been ingressed with water based on the change in the second signal. If the second signal is a periodically changing voltage signal, the processor 500 determines that the USB interface 530 has not been ingressed with water. If the second signal does not change within a certain time, the processor 500 determines that the USB interface has been ingressed with water. Furthermore, the first resistor 510 and the second voltage 520 in this device can protect the second detection pin before water ingress into the USB interface 530, preventing overvoltage. After water ingress into the USB interface 530, the first resistor 510 can protect the first detection pin 501, preventing overvoltage. The second resistor 520 can protect the second detection pin 502, preventing overvoltage.
[0127] Optionally, the connection between the first resistor 510 and the second resistor 520 may include: the B pin of the first resistor 510 may be connected to the C pin of the second resistor 520.
[0128] like Figure 21Another USB interface water ingress detection device is shown, which may include: a processor 500, a first resistor 500, a second resistor 520, and a USB interface 530. The processor 500 may include a first detection pin 501 and a second detection pin 502. The USB interface 530 may include a first idle pin 531 and a first voltage pin 534, as well as a second idle pin 532 and a second voltage pin 533. Wherein:
[0129] The first detection pin 501 is connected to the first idle pin 531 via the first resistor 510. The second detection pin 502 is connected to the second idle pin 532 via the second resistor 520. The first detection pin 501 can be connected to the second detection pin 502 via the first resistor 510. The first resistor 510 can be connected to the second resistor 520. Specifically, pin B of the first resistor 510 can be connected to pin C of the second resistor 520.
[0130] For details regarding the first detection pin 501 and the second detection pin 502, please refer to the above. Figure 5 The description in the document is omitted here. For information on the first idle pin 531 and the first voltage pin 534, please refer to the above. Figure 5 The description in the text will not be repeated here.
[0131] For details on how to select the resistance values of the first resistor 510 and the second resistor 520, please refer to the above. Figure 11 As described in the text, it will not be repeated here.
[0132] Figure 22 It shows Figure 21 The circuit diagram of the USB interface detection circuit device provided in the document before water ingress into the USB interface. Figure 21 The first detection pin 501 shown in the diagram can be Figure 22 GPIO pins in the system. Figure 21 The second detection pin 502 shown in the figure can be Figure 22 The ADC pin in the code. Figure 21 The first resistor 510 shown in the figure can be Figure 22 The resistor R1 is shown in the figure. Figure 21 The second resistor 520 shown in the figure can be Figure 22 The resistor R2 is shown in the figure. Figure 21 The first free pin shown in the figure can be Figure 22 The SBU1 pin in the middle. Figure 21 The first voltage pin 534 shown in the diagram can be Figure 22 VBUS1 pin. Figure 21 The second free pin 532 shown in the figure can be Figure 22 The SBU2 pin in the middle. Figure 21 The second voltage pin 533 shown in the diagram can be Figure 22 The VBUS2 pin is mentioned. For information on GPIO pins, ADC pins, and SBU1 pins, please refer to [reference needed]. Figure 6 The description in [the documentation] will not be repeated here. Please refer to [the documentation] for the VBUS1 and VBUS2 pins. Figure 6 The description of the VBUS pins is already provided and will not be repeated here. For the SBU2 pins, please refer to [reference needed]. Figure 6 The description of the SBU1 pins is already provided and will not be repeated here.
[0133] Figure 23 To Figure 22 The diagram shows a simplified circuit diagram of the USB interface before it gets wet. Figure 22 As shown, before the USB interface is exposed to water, the voltages of pins SBU1 and SBU2 are 0. At this time, the voltage signal V1 output from the GPIO pin is input to the ADC pin after passing through resistor R1. The voltage V2 at the ADC pin is V1 - V(R1). V(R1) represents the voltage across resistor R1. Thus, when the voltage V1 output from the GPIO pin is too high or exceeds the maximum threshold voltage at the ADC pin, resistor R1 can divide the voltage, protecting the ADC pin.
[0134] Figure 24 It shows Figure 21 The circuit diagram of the USB interface after water ingress in the provided USB interface detection device. Figure 24 As shown, after water enters the USB port, the liquid covers the SBU1 and VBUS1 pins, meaning the SBU1 and VBUS pins are connected through the liquid. Therefore, the voltage at the VBUS1 pin will be supplied to the SBU1 pin through the liquid. Similarly, the liquid covers the SBU2 and VBUS2 pins, meaning the SBU2 and VBUS pins are connected through the liquid. Therefore, the voltage at the VBUS2 pin will be supplied to the SBU2 pin through the liquid. Figure 21 The first detection pin 501 shown in the diagram can be Figure 24 GPIO pins in the system. Figure 21 The second detection pin 502 shown in the figure can be Figure 24 The ADC pin in the code. Figure 21 The first resistor 510 shown in the figure can be Figure 24 The resistor R1 is shown in the figure. Figure 21 The second resistor 520 shown in the figure can be Figure 24 The resistor R2 is shown in the figure. Figure 21 The first free pin shown in the figure can be Figure 24 The SBU1 pin in the middle. Figure 21 The first voltage pin 534 shown in the diagram can be Figure 24 VBUS1 pin. Figure 21 The second free pin 532 shown in the figure can be Figure 24The SBU2 pin in the middle. Figure 21 The second voltage pin 533 shown in the diagram can be Figure 24 VBUS2 pin.
[0135] Figure 25 for Figure 24 The diagram shows a simplified circuit diagram of the USB interface after it has been submerged in water. Figure 25 As shown, after the USB interface gets wet, the VBUS1 pin connects to the SBU1 pin through the liquid. The voltage at the SBU1 pin changes from 0 volts before water ingress to V3. The VBUS2 pin connects to the SBU1 pin through the liquid. The voltage at the SBU2 pin changes from 0 volts before water ingress to V3. The voltages at the SBU1 and SBU2 pins are higher than those at the GPIO pins. Thus, the current flow in the circuit is different before and after water ingress. After water ingress into the USB interface, the current flow in the circuit splits into two paths. One current flows from the SBU1 pin to the GPIO pin. The other current flows from the SBU2 pin to the ADC pin. At this time, the voltage at the ADC pin is V2 = V3.
[0136] In a USB interface water ingress detection device provided in this application embodiment, the second detection pin 502 (e.g., an ADC pin) in the processor 500 receives different voltage signals before and after water ingress into the USB interface 530. Thus, the processor 500 can determine whether the USB interface 530 has been ingressed with water based on the change in the second signal. If the second signal is a periodically changing voltage signal, the processor 500 determines that the USB interface 530 has not been ingressed with water. If the second signal does not change within a certain time, the processor 500 determines that the USB interface has been ingressed with water. Furthermore, the first resistor 510 and the second voltage 520 in this device can protect the second detection pin before water ingress into the USB interface 530, preventing overvoltage. After water ingress into the USB interface 530, the first resistor 510 can protect the first detection pin 501, preventing overvoltage. The second resistor 520 can protect the second detection pin 502, preventing overvoltage.
[0137] Optionally, the connection between the first resistor 510 and the second resistor 520 may include connecting pin A of the first resistor 510 to pin D of the second resistor 520.
[0138] like Figure 26 Another USB interface water ingress detection device is shown, which may include: a processor 500, a first resistor 500, a second resistor 520, and a USB interface 530. The processor 500 may include a first detection pin 501 and a second detection pin 502. The USB interface 530 may include a first idle pin 531 and a first voltage pin 534, as well as a second idle pin 532 and a second voltage pin 533. Wherein:
[0139] The first detection pin 501 is connected to the first idle pin 531 via the first resistor 510. The second detection pin 502 is connected to the second idle pin 532 via the second resistor 520. The first detection pin 501 can be connected to the second detection pin 502 via the second resistor 520. The first resistor 510 can be connected to the second resistor 520. Specifically, pin A of the first resistor 510 is connected to pin D of the second resistor 520.
[0140] For details regarding the first detection pin 501 and the second detection pin 502, please refer to the above. Figure 5 The description in the document is omitted here. For information on the first idle pin 531 and the first voltage pin 534, please refer to the above. Figure 5 The description in the text will not be repeated here.
[0141] For details on how to select the resistance values of the first resistor 510 and the second resistor 520, please refer to the above. Figure 11 As described in the text, it will not be repeated here.
[0142] Figure 27 It shows Figure 26 The circuit diagram of the USB interface detection circuit device provided in the document before water ingress into the USB interface. Figure 26 The first detection pin 501 shown in the diagram can be Figure 27 GPIO pins in the system. Figure 26 The second detection pin 502 shown in the figure can be Figure 27 The ADC pin in the code. Figure 26 The first resistor 510 shown in the figure can be Figure 27 The resistor R1 is shown in the figure. Figure 26 The second resistor 520 shown in the figure can be Figure 27 The resistor R2 is shown in the figure. Figure 26 The first free pin shown in the figure can be Figure 27 The SBU1 pin in the middle. Figure 26 The first voltage pin 534 shown in the diagram can be Figure 27 VBUS1 pin. Figure 26 The second free pin 532 shown in the figure can be Figure 27 The SBU2 pin in the middle. Figure 26 The second voltage pin 533 shown in the diagram can be Figure 27 The VBUS2 pin is mentioned. For information on GPIO pins, ADC pins, and SBU1 pins, please refer to [reference needed]. Figure 6 The description in [the documentation] will not be repeated here. Please refer to [the documentation] for the VBUS1 and VBUS2 pins. Figure 6 The description of the VBUS pins is already provided and will not be repeated here. For the SBU2 pins, please refer to [reference needed]. Figure 6The description of the SBU1 pins is already provided and will not be repeated here.
[0143] Figure 28 To Figure 27 The diagram shows a simplified circuit diagram of the USB interface before it gets wet. Figure 28 As shown, before the USB interface is exposed to water, the voltages of pins SBU1 and SBU2 are 0. At this time, the voltage signal V1 output from the GPIO pin is input to the ADC pin after passing through resistor R2. The voltage at the ADC pin is V2 = V1 - V(R2). V(R2) represents the voltage across resistor R2. Thus, when the voltage V1 output from the GPIO pin is too high or exceeds the maximum threshold voltage at the ADC pin, resistor R2 can divide the voltage, protecting the ADC pin.
[0144] Figure 29 It shows Figure 26 The circuit diagram of the USB interface after water ingress in the provided USB interface detection device. Figure 29 As shown, after water enters the USB port, the liquid covers the SBU1 and VBUS1 pins, meaning the SBU1 and VBUS pins are connected through the liquid. Therefore, the voltage at the VBUS1 pin will be supplied to the SBU1 pin through the liquid. Similarly, the liquid covers the SBU2 and VBUS2 pins, meaning the SBU2 and VBUS pins are connected through the liquid. Therefore, the voltage at the VBUS2 pin will be supplied to the SBU2 pin through the liquid. Figure 26 The first detection pin 501 shown in the diagram can be Figure 29 GPIO pins in the system. Figure 26 The second detection pin 502 shown in the figure can be Figure 29 The ADC pin in the code. Figure 26 The first resistor 510 shown in the figure can be Figure 29 The resistor R1 is shown in the figure. Figure 26 The second resistor 520 shown in the figure can be Figure 29 The resistor R2 is shown in the figure. Figure 26 The first free pin shown in the figure can be Figure 29 The SBU1 pin in the middle. Figure 26 The first voltage pin 534 shown in the diagram can be Figure 29 VBUS1 pin. Figure 26 The second free pin 532 shown in the figure can be Figure 29 The SBU2 pin in the middle. Figure 26 The second voltage pin 533 shown in the diagram can be Figure 29 VBUS2 pin.
[0145] Figure 30 for Figure 29 The diagram shows a simplified circuit diagram of the USB interface after it has been submerged in water. Figure 30 As shown, after the USB interface gets wet, the VBUS1 pin connects to the SBU1 pin through the liquid. The voltage at the SBU1 pin changes from 0 volts before water ingress to V3. The VBUS2 pin connects to the SBU1 pin through the liquid. The voltage at the SBU2 pin changes from 0 volts before water ingress to V3. The voltages at the SBU1 and SBU2 pins are higher than those at the GPIO pins. Thus, the current flow in the circuit before and after water ingress into the USB interface is different. After water ingress into the USB interface, the current flow in the circuit splits into two paths. One current flows from the SBU1 pin to the GPIO pin. The other current flows from the SBU2 pin to the ADC pin. At this time, the voltage at the ADC pin is V2 = V3 - V(R2). V(R2) represents the voltage across resistor R2.
[0146] In a USB interface water ingress detection device provided in this application embodiment, the second detection pin 502 (e.g., an ADC pin) in the processor 500 receives different voltage signals before and after water ingress into the USB interface 530. Thus, the processor 500 can determine whether the USB interface 530 has been ingressed with water based on the change in the second signal. If the second signal is a periodically changing voltage signal, the processor 500 determines that the USB interface 530 has not been ingressed with water. If the second signal does not change within a certain time, the processor 500 determines that the USB interface has been ingressed with water. Furthermore, the first resistor 510 and the second voltage 520 in this device can protect the second detection pin before water ingress into the USB interface 530, preventing overvoltage. After water ingress into the USB interface 530, the first resistor 510 can protect the first detection pin 501, preventing overvoltage. The second resistor 520 can protect the second detection pin 502, preventing overvoltage.
[0147] Optionally, the connection between the first resistor 510 and the second resistor 520 may include connecting the A pin of the first resistor 510 to the C pin of the second resistor 520.
[0148] like Figure 31 Another USB interface water ingress detection device is shown, which may include: a processor 500, a first resistor 500, a second resistor 520, and a USB interface 530. The processor 500 may include a first detection pin 501 and a second detection pin 502. The USB interface 530 may include a first idle pin 531 and a first voltage pin 534, as well as a second idle pin 532 and a second voltage pin 533. Wherein:
[0149] The first detection pin 501 is connected to the first idle pin 531 via the first resistor 510. The second detection pin 502 is connected to the second idle pin 532 via the second resistor 520. The first detection pin 501 can be connected to the second detection pin 502. The first resistor 510 can be connected to the second resistor 520. Specifically, pin A of the first resistor 510 is connected to pin C of the second resistor 520.
[0150] For details regarding the first detection pin 501 and the second detection pin 502, please refer to the above. Figure 5 The description in the document is omitted here. For information on the first idle pin 531 and the first voltage pin 534, please refer to the above. Figure 5 The description in the text will not be repeated here.
[0151] For details on how to select the resistance values of the first resistor 510 and the second resistor 520, please refer to the above. Figure 11 As described in the text, it will not be repeated here.
[0152] Figure 32 It shows Figure 31 The circuit diagram of the USB interface detection circuit device provided in the document before water ingress into the USB interface. Figure 31 The first detection pin 501 shown in the diagram can be Figure 32 GPIO pins in the system. Figure 31 The second detection pin 502 shown in the figure can be Figure 32 The ADC pin in the code. Figure 31 The first resistor 510 shown in the figure can be Figure 32 The resistor R1 is shown in the figure. Figure 31 The second resistor 520 shown in the figure can be Figure 32 The resistor R2 is shown in the figure. Figure 31 The first free pin shown in the figure can be Figure 32 The SBU1 pin in the middle. Figure 31 The first voltage pin 534 shown in the diagram can be Figure 32 VBUS1 pin. Figure 31 The second free pin 532 shown in the figure can be Figure 32 The SBU2 pin in the middle. Figure 31 The second voltage pin 533 shown in the diagram can be Figure 32 The VBUS2 pin is mentioned. For information on GPIO pins, ADC pins, and SBU1 pins, please refer to [reference needed]. Figure 6 The description in [the documentation] will not be repeated here. Please refer to [the documentation] for the VBUS1 and VBUS2 pins. Figure 6 The description of the VBUS pins is already provided and will not be repeated here. For the SBU2 pins, please refer to [reference needed]. Figure 6 The description of the SBU1 pins is already provided and will not be repeated here.
[0153] Figure 33 To Figure 32 The diagram shows a simplified circuit diagram of the USB interface before it gets wet. Figure 33 As shown, before the USB interface is exposed to water, the voltages of pins SBU1 and SBU2 are 0. At this time, the voltage signal V1 output from the GPIO pin is directly input to the ADC pin. The voltage V2 at the ADC pin is equal to V1.
[0154] Figure 34 It shows Figure 31 The circuit diagram of the USB interface after water ingress in the provided USB interface detection device. Figure 34 As shown, after water enters the USB port, the liquid covers the SBU1 and VBUS1 pins, meaning the SBU1 and VBUS pins are connected through the liquid. Therefore, the voltage at the VBUS1 pin will be supplied to the SBU1 pin through the liquid. Similarly, the liquid covers the SBU2 and VBUS2 pins, meaning the SBU2 and VBUS pins are connected through the liquid. Therefore, the voltage at the VBUS2 pin will be supplied to the SBU2 pin through the liquid. Figure 31 The first detection pin 501 shown in the diagram can be Figure 34 GPIO pins in the system. Figure 31 The second detection pin 502 shown in the figure can be Figure 34 The ADC pin in the code. Figure 31 The first resistor 510 shown in the figure can be Figure 34 The resistor R1 is shown in the figure. Figure 31 The second resistor 520 shown in the figure can be Figure 34 The resistor R2 is shown in the figure. Figure 31 The first free pin shown in the figure can be Figure 34 The SBU1 pin in the middle. Figure 31 The first voltage pin 534 shown in the diagram can be Figure 34 VBUS1 pin. Figure 31 The second free pin 532 shown in the figure can be Figure 34 The SBU2 pin in the middle. Figure 31 The second voltage pin 533 shown in the diagram can be Figure 34 VBUS2 pin.
[0155] Figure 35 for Figure 34 The diagram shows a simplified circuit diagram of the USB interface after it has been submerged in water. Figure 35As shown, after the USB interface gets wet, the VBUS1 pin connects to the SBU1 pin through the liquid. The voltage at the SBU1 pin changes from 0 volts before water ingress to V3. The VBUS2 pin connects to the SBU1 pin through the liquid. The voltage at the SBU2 pin changes from 0 volts before water ingress to V3. The voltages at the SBU1 and SBU2 pins are higher than those at the GPIO pins. Thus, the current flow in the circuit before and after water ingress into the USB interface is different. After water ingress into the USB interface, the current flow in the circuit splits into two paths. One current flows from the SBU1 pin to the GPIO pin. The other current flows from the SBU2 pin to the ADC pin. At this time, the voltage at the ADC pin is V2 = V3 - V(R2). V(R2) represents the voltage across resistor R2.
[0156] In a USB interface water ingress detection device provided in this application embodiment, the second detection pin 502 (e.g., an ADC pin) in the processor 500 receives different voltage signals before and after water ingress into the USB interface 530. Thus, the processor 500 can determine whether the USB interface 530 has been ingressed with water based on the change in the second signal. If the second signal is a periodically changing voltage signal, the processor 500 determines that the USB interface 530 has not been ingressed with water. If the second signal does not change within a certain time, the processor 500 determines that the USB interface has been ingressed with water. Furthermore, the first resistor 510 and the second voltage 520 in this device can protect the second detection pin before water ingress into the USB interface 530, preventing overvoltage. After water ingress into the USB interface 530, the first resistor 510 can protect the first detection pin 501, preventing overvoltage. The second resistor 520 can protect the second detection pin 502, preventing overvoltage.
[0157] Optionally, the USB interface water ingress detection device provided in this application embodiment may further include a diode, which is used to protect some pins of the USB interface water ingress detection device.
[0158] Figure 36 This application illustrates another USB interface water ingress detection device provided in an embodiment of the present application. For example... Figure 36 As shown, the USB interface water ingress detection device may include: a processor 500, a first resistor 500, a second resistor 520, and a USB interface 530, as well as a first diode 540 and a second diode 550. The processor 500 may include a first detection pin 501 and a second detection pin 502. The USB interface 530 may include a first idle pin 531 and a first voltage pin 534, as well as a second idle pin 532 and a second voltage pin 533. Wherein:
[0159] The first detection pin 501 is connected to the first idle pin 531 via the first resistor 510. The second detection pin 502 is connected to the second idle pin 532 via the second resistor 520. The first resistor 510 can be connected to the second resistor 520.
[0160] The anode of the first diode 540 is connected to the first detection pin 501, and the anode of the first diode 540 is connected to the first resistor 510. The anode of the second diode 550 is connected to the second detection pin 502, and the anode of the second diode 550 is connected to the second resistor 520. The cathode of the first diode 540 is connected to a third voltage (e.g., ...). Figure 36 As shown in the diagram (VCC1), the cathode of the second diode 550 is connected to a fourth voltage (e.g., VCC1). Figure 36 VCC2 is shown in the figure.
[0161] For details regarding the first detection pin 501 and the second detection pin 502, please refer to the above. Figure 5 The description in the document is omitted here. For information on the first idle pin 531 and the first voltage pin 534, please refer to the above. Figure 5 The description in the text will not be repeated here.
[0162] For details on how to select the resistance values of the first resistor 510 and the second resistor 520, please refer to the above. Figure 11 As described in the text, it will not be repeated here.
[0163] Figure 37 It shows Figure 36 The circuit diagram of the USB interface detection circuit device provided in the document before water ingress into the USB interface. Figure 36 The first detection pin 501 shown in the diagram can be Figure 37 GPIO pins in the system. Figure 36 The second detection pin 502 shown in the figure can be Figure 37 The ADC pin in the code. Figure 36 The first resistor 510 shown in the figure can be Figure 37 The resistor R1 is shown in the figure. Figure 36 The second resistor 520 shown in the figure can be Figure 37 The resistor R2 is shown in the figure. Figure 36 The first free pin shown in the figure can be Figure 37 The SBU1 pin in the middle. Figure 36 The first voltage pin 534 shown in the diagram can be Figure 37 VBUS1 pin. Figure 36 The second free pin 532 shown in the figure can be Figure 37 The SBU2 pin in the middle. Figure 36 The second voltage pin 533 shown in the diagram can be Figure 37 VBUS2 pin. Figure 36The first diode 540 shown in the figure can be Figure 37 Diode D1 in the middle. Figure 36 The second diode 550 shown in the figure can be Figure 37 Diode D2 is shown in the image. For information on GPIO pins, ADC pins, and SBU1 pins, please refer to [reference needed]. Figure 6 The description in [the documentation] will not be repeated here. Please refer to [the documentation] for the VBUS1 and VBUS2 pins. Figure 6 The description of the VBUS pins is already provided and will not be repeated here. For the SBU2 pins, please refer to [reference needed]. Figure 6 The description of the SBU1 pins is already provided and will not be repeated here.
[0164] like Figure 37 As shown, diode D1 can be connected to voltage VCC1, and diode D2 can be connected to voltage VCC2. Voltage VCC1 is connected to the cathode of diode D1, and voltage VCC2 is connected to the cathode of diode D2. Voltages VCC1 and VCC2 can be provided by processor 500. Voltages VCC1 and VCC2 can be equal. Voltages VCC1 and VCC2 can also be equal to V1. The specific magnitudes of voltages VCC1 and VCC2 are not limited here.
[0165] Figure 38 To Figure 37 The diagram shows a simplified circuit diagram of the USB interface before it gets wet. Figure 38 As shown, before the USB interface is exposed to water, the voltages of pins SBU1 and SBU2 are 0. If V1 is greater than VCC1, the current in this circuit flows from the GPIO pin to diode D1. At this time, there is no voltage input at the ADC pin, i.e., V2 = 0. When V1 is less than VCC1, the current in this circuit flows from the GPIO pin to resistors R1 and R2. If V1 - V(R1) - V(R2) is greater than VCC2, the current flows from resistor R2 to diode D2. At this time, there is no voltage input at the ADC pin, i.e., V2 = 0. The voltage at the ADC pin is V2 = V1. If V1 - V(R1) - V(R2) is less than VCC2, the current flows from resistor R2 to the ADC pin, V2 = V1 - V(R1) - V(R2). Here, V(R1) is the voltage across resistor R1, and V(R2) is the voltage across resistor R2. In this way, diodes D1 and D2 can prevent excessive voltage received at the ADC pins. Diodes D1 and D2 can protect the ADC pins.
[0166] Figure 39 It shows Figure 36 The circuit diagram of the USB interface after water ingress in the provided USB interface detection device. Figure 39As shown, after water enters the USB port, the liquid covers the SBU1 and VBUS1 pins, meaning the SBU1 and VBUS pins are connected through the liquid. Therefore, the voltage at the VBUS1 pin will be supplied to the SBU1 pin through the liquid. Similarly, the liquid covers the SBU2 and VBUS2 pins, meaning the SBU2 and VBUS pins are connected through the liquid. Therefore, the voltage at the VBUS2 pin will be supplied to the SBU2 pin through the liquid. Figure 36 The second detection pin 502 shown in the figure can be Figure 39 The ADC pin in the code. Figure 36 The first resistor 510 shown in the figure can be Figure 39 The resistor R1 is shown in the figure. Figure 36 The second resistor 520 shown in the figure can be Figure 39 The resistor R2 is shown in the figure. Figure 36 The first free pin shown in the figure can be Figure 39 The SBU1 pin in the middle. Figure 36 The first voltage pin 534 shown in the diagram can be Figure 39 VBUS1 pin. Figure 36 The second free pin 532 shown in the figure can be Figure 39 The SBU2 pin in the middle. Figure 36 The second voltage pin 533 shown in the diagram can be Figure 39 VBUS2 pin. Figure 36 The first diode 540 shown in the figure can be Figure 39 Diode D1 in the middle. Figure 36 The second diode 550 shown in the figure can be Figure 39 Diode D2 is shown in the image. For information on GPIO pins, ADC pins, and SBU1 pins, please refer to [reference needed]. Figure 6 The description in [the documentation] will not be repeated here. Please refer to [the documentation] for the VBUS1 and VBUS2 pins. Figure 6 The description of the VBUS pins is already provided and will not be repeated here. For the SBU2 pins, please refer to [reference needed]. Figure 6 The description of the SBU1 pins is already provided and will not be repeated here. For details regarding diodes D1 and D2, please refer to [reference needed]. Figure 37 The description in the text will not be repeated here.
[0167] Figure 40 for Figure 39 The diagram shows a simplified circuit diagram of the USB interface after it has been submerged in water. Figure 40As shown, after the USB interface gets wet, the VBUS1 pin connects to the SBU1 pin through the liquid. The voltage at the SBU1 pin changes from 0 volts before water ingress to V3. The VBUS2 pin connects to the SBU1 pin through the liquid. The voltage at the SBU2 pin changes from 0 volts before water ingress to V3. The voltages at the SBU1 and SBU2 pins are higher than those at the GPIO pins. Thus, the current flow in the circuit differs before and after water ingress. After water ingress, the current flow in the circuit splits into two paths. One current flows from the SBU1 pin to the GPIO pin. The other current flows from the SBU2 pin to the ADC pin. If the voltage V3 at the SBU1 pin, after being divided by resistor R1, is still greater than VCC1, then the current flows from the SBU1 pin to resistor R1 and then to diode D1. This prevents excessive voltage input to the GPIO pin. If the voltage V3 at the SBU2 pin, after being divided by resistor R2, is still greater than VCC2, then the current flows from the SBU2 pin to resistor R2 and then to diode D2. If the voltage V3 at the SBU1 pin, after being divided by resistor R1, is less than VCC1, then the current flows from the SBU1 pin to resistor R1 and then to the ADC pin. In this case, the voltage at the ADC pin is V2 = V3 - V(R2), where V(R2) represents the voltage across resistor R2. This prevents the input voltage to the ADC pin from being too high.
[0168] In a USB interface water ingress detection device provided in this application embodiment, the second detection pin 502 (e.g., an ADC pin) in the processor 500 receives different voltage signals before and after water ingress into the USB interface 530. Thus, the processor 500 can determine whether the USB interface 530 has been ingressed with water based on the change in the second signal. If the second signal is a periodically changing voltage signal, the processor 500 determines that the USB interface 530 has not been ingressed with water. If the second signal does not change within a certain time, the processor 500 determines that the USB interface has been ingressed with water. Furthermore, the first resistor 510 and the second voltage 520 in this device can protect the second detection pin before water ingress into the USB interface 530, preventing overvoltage. After water ingress into the USB interface 530, the first resistor 510 can protect the first detection pin 501, preventing overvoltage. The second resistor 520 can protect the second detection pin 502, preventing overvoltage. The first diode 540 can protect the first detection pin 501, preventing overvoltage. The second diode 550 can protect the second detection pin 502 and prevent overvoltage of the second detection pin 502.
[0169] Based on the USB interface water ingress detection device provided in the above embodiments, this application provides a USB interface water ingress detection method. It is understood that the USB interface water ingress detection device can also be an electronic device.
[0170] Figure 41 A schematic flowchart of a USB interface water ingress detection method provided in an embodiment of this application is shown. Figure 41 As shown in the figure, a USB interface water ingress detection method provided in this application embodiment may include:
[0171] S100. The electronic device outputs a first signal through a first detection pin. The first device includes a processor and a USB interface. The processor includes a first detection pin and a second detection pin. The first detection pin is connected to the USB interface, and the second detection pin is also connected to the USB interface. The first detection pin can be connected to the second detection pin.
[0172] In one possible implementation, the USB interface includes a first idle pin and a first voltage pin. The connection of the first detection pin to the USB interface specifically includes connecting the first detection pin to the first idle pin. The connection of the second detection pin to the USB interface specifically includes connecting the second detection pin to the first idle pin. (See reference here.) Figure 5 The specific descriptions of the connection between the first detection pin 501 and the first idle pin 531, and the connection between the second detection pin 502 and the first idle pin 534, will not be repeated here.
[0173] In one possible implementation, the electronic device further includes a first resistor and a second resistor, for example... Figure 11 The first resistor 510 and the second resistor 520 are shown. Connecting the first detection pin to the first idle pin can include: the first detection pin is connected to the first idle pin via the first resistor. Connecting the second detection pin to the first idle pin can include: the second detection pin is connected to the first idle pin via the second resistor. Connecting the first detection pin to the second detection pin can include: the first detection pin is connected to the second detection pin via both the first and second resistors. For details on how the first detection pin is connected to the first idle pin, and how the second detection pin is connected to the first idle pin, please refer to [reference needed]. Figure 11 The description in the text will not be repeated here.
[0174] In one possible implementation, the USB interface may further include a second idle pin and a second voltage pin. Both the first idle pin and the second idle pin are pins in an idle state within the USB interface. The distance between the first idle pin and the first voltage pin within the USB interface is less than a first preset distance. The distance between the second idle pin and the second voltage pin within the USB interface is less than a second preset distance. The first preset distance and the second preset distance can be equal. For example, as... Figure 3As shown, the first unused pin can be pin A5, and the first voltage pin can be pin A4, with pins A4 and A5 adjacent to each other. The second unused pin can be pin B8, and the second voltage pin can be pin B9, with pins B8 and B9 adjacent to each other. The first voltage pin is connected to a first voltage, and the second voltage pin is connected to a second voltage. The first voltage can be equal to the second voltage.
[0175] Furthermore, the connection between the first detection pin and the USB interface can include: the first detection pin is connected to a first idle pin, and the first detection pin is connected to a second idle pin through a first resistor. The connection between the second detection pin and the USB interface can also include: the second detection pin is connected to a second idle pin, and the second detection pin is connected to the first idle pin through a second resistor. For details on how the first and second detection pins in the processor are connected to the USB interface, please refer to [reference needed]. Figure 16 The description in the text will not be repeated here.
[0176] In one possible implementation, the first resistor is connected to the second resistor, and the first resistor may include a first pin and a second pin. The first pin may be... Figure 16 The second pin can be pin A shown in the diagram. Figure 16 The diagram shows pin B. The second resistor may include a third pin and a fourth pin. The third pin may be... Figure 16 The fourth pin of the C pin shown in the diagram can be... Figure 16 The D pin is shown in the diagram.
[0177] Optionally, the connection between the first resistor and the second resistor may include connecting the second pin of the first resistor to the fourth pin of the second resistor. See here for reference. Figure 16 The description in the text will not be repeated here.
[0178] Optionally, the connection between the first resistor and the second resistor may include connecting the second pin of the first resistor to the third pin of the second resistor. For details, please refer to [link / reference needed]. Figure 21 The description in the text will not be repeated here.
[0179] Optionally, the connection between the first resistor and the second resistor may include connecting the first pin of the first resistor to the fourth pin of the second resistor. For details, please refer to [link / reference needed]. Figure 26 The description in the text will not be repeated here.
[0180] Optionally, the connection between the first resistor and the second resistor may include connecting the first pin of the first resistor to the third pin of the second resistor. For details, please refer to [link / reference needed]. Figure 31 The description in the text will not be repeated here.
[0181] In one possible implementation, the connection between the first detection pin and the second detection pin can include: the first detection pin being connected to the second detection pin via a first resistor and a second resistor; the first detection pin being connected to the second detection pin via a first resistor; the first detection pin being connected to the second detection pin via a second resistor; or the first detection pin being directly connected to the second detection pin. For details, please refer to [reference needed]. Figures 16-31 The description in the text will not be repeated here.
[0182] In one possible implementation, connecting the first detection pin to the second idle pin can include: connecting the first detection pin to the second idle pin through a first resistor, or connecting the first detection pin to the second idle pin through a second resistor.
[0183] In one possible implementation, connecting the second detection pin to the first idle pin can include: connecting the second detection pin to the first idle pin via a first resistor, or connecting the second detection pin to the first idle pin via a second resistor.
[0184] In one possible implementation, the electronic device may include a first diode and a second diode. Specifically, this could be... Figure 36 The description in the text will not be repeated here.
[0185] In one possible implementation, connecting the first detection pin to the first idle pin can include connecting the first detection pin to the second idle pin via a first diode and a first resistor. Connecting the second detection pin to the second idle pin can include connecting the second detection pin to the second idle pin via a second diode and a second resistor.
[0186] Specifically, the first detection pin is connected to the anode of the first diode, and the first resistor is connected to the anode of the first diode. The second detection pin is connected to the anode of the second diode, and the second resistor is connected to the anode of the second diode.
[0187] In one possible implementation, the cathode of the first diode is connected to a third voltage, and the cathode of the second diode is connected to a fourth voltage. The third voltage could be... Figure 37 The voltage VCC1 shown in the figure, the fourth voltage can be Figure 37 The voltage VCC2 is shown in the figure. The third voltage can be equal to the fourth voltage.
[0188] S101. The electronic device detects a second signal, which is the voltage signal received by the second detection pin.
[0189] When the USB port is not wet, the voltage of the first and second idle pins in the USB port is 0. When water or other liquids enter the USB port, the water or other liquids will cover the first idle pin and the first voltage pin, as well as the second idle pin and the second voltage pin. The first voltage of the first voltage pin is connected to the first idle pin. The second voltage of the second voltage pin is connected to the second idle pin. For details, please refer to [link / reference]. Figures 5-40 The description in the text will not be repeated here.
[0190] When the USB port is not wet, the second signal received by the second detection pin is determined by the first signal. The second signal changes with the first signal; for example, if the first signal increases, the second signal increases, and vice versa. The voltage value of the second signal is less than or equal to the voltage value of the first signal. For details, please refer to [link / reference needed]. Figure 7 or Figure 13 middle, Figure 18 , Figure 23 Descriptions such as these will not be repeated here.
[0191] After water enters the USB port, the second signal received by the second detection pin is determined by the voltage at either the first or second detection pin. The voltage at either the first or second idle pin is a fixed value. Therefore, when water enters the USB port, the second signal is also a fixed value. (See reference here.) Figure 9 ,or Figure 15 , Figure 20 , Figure 25 Descriptions such as these will not be repeated here.
[0192] S102. The electronic device determines that the USB interface is in water based on the change of the second signal.
[0193] In one possible implementation, the first signal is a periodically changing signal, and the first voltage is greater than the voltage value of the highest level of the first signal. The electronic device determines that the USB interface has been exposed to water based on the change of the second signal, specifically including: when the change period of the second signal is the same as the change period of the first signal, the electronic device determines that the USB interface has not been exposed to water; when the change period of the second signal is different from the change period of the first signal, the electronic device determines that the USB interface has been exposed to water.
[0194] In one possible implementation, the electronic device determines that the USB interface has been infiltrated when the second signal is a fixed value.
[0195] In one possible implementation, the first signal is a fixed fifth voltage, which is less than the first voltage. The electronic device determines water ingress into the USB interface based on changes in the second signal, including: when the second signal is less than or equal to a first threshold, the electronic device determines that the USB interface is not water-ingressed, the first threshold being determined based on the fifth voltage; when the second signal is greater than or equal to a second threshold, the electronic device determines that the USB interface is water-ingressed, the second threshold being determined based on the first voltage, and the second threshold being greater than the first threshold.
[0196] In one possible implementation, after the electronic device determines that the USB port has been exposed to water, the electronic device triggers a notification message to inform the user that the USB port of the electronic device has been exposed to water.
[0197] Optionally, the notification message may be a pop-up displayed in the user interface of an electronic device. For example, Figure 42 The user interface of the wristband 100 shown can display prompt boxes. For example... Figure 42 As shown, the wristband 100 may include a user interface 104. The user interface 104 may include a prompt box 105 and a control 108. The prompt box 105 is used to notify the user that the USB port of the wristband 100 has been exposed to water. The prompt box 105 may include a prompt icon 106 and prompt text 107. The prompt text 107 may include prompt text such as "Charging risk" and "Dampness detected at the charging port, short circuit risk," etc. When the user clicks the control 108, the wristband 100 can hide the prompt box 105. This application embodiment does not limit the specific form of the prompt box or the specific prompt text in the prompt box.
[0198] Alternatively, the notification message could be the vibration of the electronic device's motor to alert the user that the USB port has been exposed to water. Once the electronic device detects water ingress into the USB port, its processor can send a command to instruct the motor to vibrate.
[0199] Optionally, the notification message can be a ringtone or a voice prompt. For example, when an electronic device detects water damage to its USB port, it may announce the message "USB port is wet, do not charge." The specific text of the message is not limited here. Alternatively, when an electronic device detects water damage to its USB port, it may ring for a preset duration. This preset duration could be 5 seconds, 10 seconds, etc., and is not limited here.
[0200] Optionally, the prompt message can be a combination of any two or more of the prompt messages mentioned above. For example, the prompt message can be a prompt box displayed in the user interface combined with motor vibration. The prompt message can be a prompt box displayed in the user interface combined with voice prompts. Alternatively, the prompt message can be a prompt box displayed in the user interface combined with motor vibration and voice prompts. No limitation is imposed here.
[0201] In a USB interface detection method provided in this application embodiment, the electronic device can output a first signal through the first detection pin of the processor, and then the electronic device detects a second signal output from the second detection pin of the processor. If the change period of the second signal is consistent with the second signal, the electronic device determines that the USB interface has not been exposed to water; if the second signal is a fixed value, the electronic device determines that the USB interface has been exposed to water. No additional USB interface water ingress detection chip is required; the electronic device can perform USB interface water ingress detection. This can save on the manufacturing cost of the electronic device and reduce its power consumption.
[0202] Figure 43 A schematic diagram of the structure of electronic device 400 is shown.
[0203] The following description uses electronic device 400 as an example to illustrate the embodiment. It should be understood that... Figure 43 The electronic device 400 shown is merely an example, and the electronic device 400 may have more than Figure 43 The more or fewer components shown can be combined into two or more components, or they can have different component configurations. The various components shown in the figure can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0204] Electronic device 400 may include: processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0205] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 400. In other embodiments of this application, the electronic device 400 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0206] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0207] The controller can be the nerve center and command center of the electronic device 400. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0208] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0209] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0210] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 400.
[0211] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.
[0212] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0213] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.
[0214] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 400 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 400 to display images.
[0215] The GPIO interface is configurable via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0216] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 400, and can also be used for data transfer between electronic device 400 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.
[0217] In some embodiments, the processor 110 may further include an ADC interface, a GPIO interface including a first detection pin, and an ADC interface including a second detection pin. The USB interface includes a first idle pin and a first voltage pin. The first detection pin is used to output a first signal, and the second detection pin is used to receive a second signal. The first detection pin can be connected to the first idle pin. The second detection pin can be connected to the first idle pin. The first idle pin is a pin in the USB interface that is in an idle state. The first voltage pin is connected to a first voltage. See the above for details. Figures 5-40 The description in the text will not be repeated here.
[0218] In some embodiments, the USB interface 130 may further include a second idle pin and a second voltage pin. A first resistor and a second resistor may also be included between the processor 110 and the USB interface 130. The second idle pin is in an idle state in the USB interface 130. The second voltage pin is connected to a second voltage. The first detection pin can be connected to the first idle pin via the first resistor. The second detection pin can be connected to the second idle pin via the second resistor. See details for further information. Figure 16 The description in the text will not be repeated here.
[0219] In some embodiments, a first diode and a second diode may also be included between the processor 110 and the USB interface 130. The first detection pin can be connected to a second idle pin via the first diode and a first resistor. Connecting the second detection pin to the second idle pin may include: the second detection pin can be connected to the second idle pin via a second diode and a second resistor. The first detection pin is connected to the anode of the first diode, and the first resistor is connected to the anode of the first diode. The second detection pin is connected to the anode of the second diode, and the second resistor is connected to the anode of the second diode. See details for further information. Figure 36 The description in the text will not be repeated here.
[0220] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 400. In other embodiments of this application, the electronic device 400 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0221] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 400. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0222] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.
[0223] The wireless communication function of the electronic device 400 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.
[0224] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 400 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.
[0225] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 400. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0226] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.
[0227] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 400, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0228] In some embodiments, antenna 1 of electronic device 400 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 400 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0229] Electronic device 400 implements display functions through a GPU, display screen 194, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0230] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 400 may include one or N displays 194, where N is a positive integer greater than 1.
[0231] Electronic device 400 can achieve shooting function through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0232] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0233] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 400 may include one or N cameras 193, where N is a positive integer greater than 1.
[0234] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 400 is selecting a frequency, the DSP is used to perform Fourier transforms on the frequency energy.
[0235] Video codecs are used to compress or decompress digital video. Electronic device 400 may support one or more video codecs. Thus, electronic device 400 can play or record video in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0236] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs can enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0237] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 400. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0238] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 400 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 400 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0239] Electronic device 400 can implement audio functions such as music playback and recording through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0240] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.
[0241] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. Electronic device 400 can listen to music or make hands-free calls through the speaker 170A.
[0242] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 400 answers a telephone call or voice message, the receiver 170B can be brought close to the listener's ear to receive the voice message.
[0243] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 400 may have at least one microphone 170C. In some embodiments, electronic device 400 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 400 may have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.
[0244] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.
[0245] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 400 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 400 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 400 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example: when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.
[0246] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 400. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 400 around three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 400's shake, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 400 through reverse movement, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.
[0247] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 400 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.
[0248] The magnetic sensor 180D includes a Hall sensor. The electronic device 400 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. In some embodiments, when the electronic device 400 is a flip phone, the electronic device 400 can detect the opening and closing of the flip cover using the magnetic sensor 180D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.
[0249] The 180E accelerometer can detect the magnitude of acceleration of an electronic device 400 in various directions (typically three axes). When the electronic device 400 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of the electronic device, and can be applied to applications such as screen orientation switching and pedometers.
[0250] A distance sensor 180F is used to measure distance. Electronic device 400 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 400 can utilize the distance sensor 180F for distance measurement to achieve fast focusing.
[0251] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 400 emits infrared light outward through the LED. The electronic device 400 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that an object is near the electronic device 400. When insufficient reflected light is detected, the electronic device 400 can determine that no object is near the electronic device 400. The electronic device 400 may use the proximity sensor 180G to detect when a user holds the electronic device 400 close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 180G can also be used in holster mode and pocket mode for automatic unlocking and locking of the screen.
[0252] The ambient light sensor 180L is used to sense the ambient light intensity. The electronic device 400 can adaptively adjust the brightness of its display screen 194 based on the sensed ambient light intensity. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking photos. The ambient light sensor 180L can also work in conjunction with the proximity sensor 180G to detect whether the electronic device 400 is in a pocket, preventing accidental touches.
[0253] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 400 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.
[0254] Temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 400 uses the temperature detected by temperature sensor 180J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 400 performs thermal protection by reducing the performance of a processor located near temperature sensor 180J to reduce power consumption. In other embodiments, when the temperature is below another threshold, electronic device 400 heats battery 142 to prevent abnormal shutdown of electronic device 400 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 400 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.
[0255] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 400, in a different position than display screen 194.
[0256] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 180M can also be incorporated into headphones to form bone conduction headphones. The audio module 170 can parse the voice signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 180M to realize voice functionality. The application processor can parse heart rate information from the blood pressure signals acquired by the bone conduction sensor 180M to realize heart rate detection functionality.
[0257] In some embodiments, the sensors in the sensor module 180 described above may be integrated into the processor 110.
[0258] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 400 can receive button input and generate key signal inputs related to user settings and function control of electronic device 400.
[0259] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations performed on different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations performed on different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.
[0260] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0261] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 400. The electronic device 400 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 400 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 400 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 400 and cannot be separated from the electronic device 400.
[0262] Figure 44 This is a software structure block diagram of an electronic device 400 according to an embodiment of the present invention. The electronic device may include an application layer, an application framework layer, and a kernel layer.
[0263] The application layer can include a series of application packages.
[0264] like Figure 44 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.
[0265] It is understood that the electronic device in the embodiments of this application may include more or fewer applications, and is not limited to... Figure 44 The application shown in the image.
[0266] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0267] like Figure 44 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, device manager, etc.
[0268] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0269] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0270] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0271] The phone manager is used to provide communication functions for electronic devices 400. For example, it manages call status (including connection, hang-up, etc.).
[0272] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0273] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0274] The Device Manager is used to control the output of the first signal of the General Purpose Input / Output (GPIO) interface.
[0275] The kernel layer is the layer between hardware and software. At a minimum, the kernel layer includes display drivers, camera drivers, audio drivers, sensor drivers, and general-purpose input / output (GPIO) interfaces.
[0276] The following example, using a scene of capturing a photograph, illustrates the workflow of the software and hardware of the electronic device 400.
[0277] When touch sensor 180K receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, etc.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking a touch click as an example, where the corresponding control is the camera application icon, the camera application calls the application framework layer's interface to launch the camera application, and then calls the kernel layer to launch the camera driver, capturing still images or videos through camera 193.
[0278] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. An electronic device, characterized in that, The electronic device includes a processor and a USB interface. The processor includes a first detection pin and a second detection pin. The USB interface includes a first idle pin and a first voltage pin. The first detection pin is connected to the first idle pin, and the second detection pin is connected to the first idle pin. The first detection pin is also connected to the second detection pin. The first detection pin is used to output a first signal, and the second detection pin receives a second signal; the first idle pin is left floating; the first voltage pin is connected to a first voltage. The processor is configured to determine that the USB interface is not in water when the change period of the second signal is the same as the change period of the first signal, and to determine that the USB interface is in water when the change period of the second signal is different from the change period of the first signal.
2. The electronic device according to claim 1, characterized in that, The electronic device further includes a first resistor; The first detection pin is connected to the first idle pin, specifically by connecting the first detection pin to the first idle pin through the first resistor.
3. The electronic device according to claim 2, characterized in that, The electronic device further includes a second resistor connected to the first resistor; The second detection pin is connected to the first idle pin, specifically by connecting the second detection pin to the first idle pin through the second resistor.
4. The electronic device according to claim 3, characterized in that, The first detection pin is connected to the second detection pin, specifically by connecting the first detection pin to the second detection pin through the first resistor and the second resistor.
5. The electronic device according to claim 1, characterized in that, The USB interface further includes a second idle pin and a second voltage pin, wherein the second detection pin is connected to the second idle pin; wherein: The second idle pin is left floating, and the second voltage pin is connected to the second voltage.
6. The electronic device according to claim 5, characterized in that, The second voltage is equal to the first voltage.
7. The electronic device according to any one of claims 5 or 6, characterized in that, The electronic device further includes a first resistor and a second resistor, wherein the first resistor is connected to the second resistor; The first detection pin is connected to the first idle pin, specifically including: the first detection pin is connected to the first idle pin through the first resistor; The second detection pin is connected to the second idle pin, specifically by connecting the second detection pin to the second idle pin through the second resistor.
8. The electronic device according to claim 7, characterized in that, The first resistor includes a first pin and a second pin, and the second resistor includes a third pin and a fourth pin; The first detection pin is connected to the first idle pin through the first resistor, specifically including: the first detection pin is connected to the first pin, and the second pin is connected to the first idle pin; The second detection pin is connected to the second idle pin through the second resistor, specifically including: the second detection pin is connected to the third pin, and the fourth pin is connected to the second idle pin; The first resistor is connected to the second resistor, specifically including: the second pin is connected to the fourth pin.
9. The electronic device according to claim 8, characterized in that, The first resistor is connected to the second resistor, specifically including: the second pin is connected to the third pin.
10. The electronic device according to claim 8, characterized in that, The first resistor is connected to the second resistor, specifically including: the first pin is connected to the third pin.
11. The electronic device according to claim 8, characterized in that, The first resistor is connected to the second resistor, specifically including: the first pin is connected to the fourth pin.
12. The electronic device according to claim 7, characterized in that, The electronic device further includes a first diode and a second diode; wherein: The first detection pin is connected to the anode of the first diode, the first resistor is connected to the anode of the first diode, the second detection pin is connected to the anode of the second diode, and the second resistor is connected to the anode of the second diode; the cathode of the first diode is connected to a third voltage, and the second diode is connected to a fourth voltage.
13. The electronic device according to any one of claims 1-6 or 8-12, characterized in that, The first signal is a periodically changing voltage signal, and the first voltage is greater than the voltage value of the highest level of the first signal.
14. The electronic device according to claim 13, characterized in that, The processor is specifically used to: determine that the USB interface has been flooded when the second signal is a fixed value.
15. The electronic device according to claim 14, characterized in that, The first signal is a fifth voltage with a fixed voltage, and the fifth voltage is less than the first voltage.
16. The electronic device according to claim 15, characterized in that, The processor is specifically used for: When the second signal is less than or equal to the first threshold, it is determined that the USB interface has not been exposed to water. The first threshold is determined based on the fifth voltage. When the second signal is greater than or equal to the second threshold, it is determined that the USB interface has been infiltrated by water. The second threshold is determined based on the first voltage and is greater than the first threshold.
17. The electronic device according to any one of claims 14-16, characterized in that, In the first preset USB protocol, the first idle pin is in an idle state when the USB interface is charging or transmitting data.
18. The electronic device according to claim 7, characterized in that, In the first preset USB protocol, the second idle pin is in an idle state when the USB interface is charging or transmitting data.
19. The electronic device according to claim 18, characterized in that, The first frequency of the first signal output by the first detection pin is less than or equal to the upper limit of the frequency at which the second signal is received by the second detection pin.
20. The electronic device according to claim 19, characterized in that, The first detection pin has a first internal resistance, and the second detection pin has a second internal resistance; wherein: the resistance value of the first resistor is less than the resistance value of the first internal resistance; and the resistance value of the second resistor is less than the resistance value of the second internal resistance.
21. A method for detecting water ingress into a USB interface, the method being applied to an electronic device, characterized in that, The electronic device includes a processor and a USB interface. The processor includes a first detection pin and a second detection pin. The USB interface includes a first idle pin and a first voltage pin. The first detection pin is connected to the first idle pin, and the second detection pin is connected to the first idle pin. The connection between the first detection pin and the second detection pin includes: The electronic device outputs a first signal through the first detection pin; The electronic device acquires the second signal received by the second detection pin; When the change period of the second signal is the same as the change period of the first signal, the electronic device determines that the USB interface has not been infiltrated by water; When the change period of the second signal is different from the change period of the first signal, the electronic device determines that the USB interface has been infiltrated by water.
22. The method according to claim 21, characterized in that, The first voltage pin is connected to the first voltage, and the first idle pin is left floating.
23. The method according to any one of claims 21 or 22, characterized in that, The first signal is a periodically changing voltage signal, and the first voltage is greater than the voltage value of the highest level of the first signal.
24. The method according to claim 23, characterized in that, When the change period of the second signal is different from the change period of the first signal, the electronic device determines that the USB interface has been infiltrated by water, specifically including: When the second signal is a fixed value, the electronic device determines that the USB interface has been infiltrated by water.
25. The method according to claim 21, characterized in that, The first signal is a fifth voltage with a fixed voltage, and the fifth voltage is less than the first voltage.
26. The method according to claim 25, characterized in that... After the electronic device acquires the second signal received by the second detection pin, the method further includes: When the second signal is less than or equal to the first threshold, the electronic device determines that the USB interface has not been exposed to water, and the first threshold is determined based on the fifth voltage; when the second signal is greater than or equal to the second threshold, the electronic device determines that the USB interface has been exposed to water, and the second threshold is determined based on the first voltage, and the second threshold is greater than the first threshold.
27. An electronic device, characterized in that, include: A communication interface, a memory, and a processor; the communication interface, the memory, and the processor are coupled together, the memory being used to store computer program code, the computer program code including computer instructions, which, when read from the memory, cause the electronic device to perform the method as described in any one of claims 21 to 26.
28. A computer storage medium, characterized in that, Includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 21 to 26.
Citation Information
Patent Citations
Charging interface detection circuit, intelligent wearable equipment and charging system
CN110888168A
Detect USB socket corruption circuit of intaking
CN206627597U