Electronic device comprising flexible display and method for detecting state of electronic device
An example electronic device includes a first housing; a second housing coupled to be movable with respect to the first housing; a flexible display disposed on at least a portion of the first housing and the second housing; a magnet having at least two polarities arranged in a first direction in one plane; a sensor configured to move in the first direction along the central axis of the magnet as the arrangement of the second housing relative to the first housing is changed, and detect at least two or more direction components including a first direction component and a second direction component of magnetic flux density; a memory configured to store state reference information on a state of the electronic device corresponding to the first direction component and the second direction component; and a processor configured to obtain magnetic detection data including the at least two or more direction components from the sensor; and detect the state of the electronic device based on the obtained magnetic detection data and the state reference information.
1 . An electronic device comprising:
a first housing;
a second housing coupled to the first housing so as to be movable relative to the first housing;
a flexible display disposed on at least a portion of the first housing and at least a portion of the second housing;
a magnet including a first flat surface and a second flat surface opposite the first flat surface, wherein a first pole and a second pole having a polarity opposite to a polarity of the first pole are arranged sequentially in a first direction on the first flat surface and the second pole and the first pole are arranged sequentially in the first direction on the second flat surface;
a sensor configured to move in the first direction along a central axis of the magnet over the magnet and detect at least two directional magnetic flux density components including a first directional magnetic flux density component and a second directional magnetic flux density component as a position of the second housing relative to the first housing is changed;
memory configured to store state reference information about a state of the electronic device corresponding to the first directional magnetic flux density component and the second directional magnetic flux density component; and
at least one processor, comprising processing circuitry, operationally connected with the sensor and the memory and
configured individually or collectively to:
obtain magnetic detection data including the at least two directional magnetic flux density components from the sensor; and
detect a state of the electronic device, based on the obtained magnetic detection data and the state reference information.
2 . The electronic device of claim 1 , wherein the first flat surface of the magnet is configured to face the sensor.
3 . The electronic device of claim 1 , wherein the magnet includes:
a first magnet configured to represent a first pole; and
a second magnet configured to represent a second pole different from the first pole, the second magnet being adjacent to the first magnet in the first direction.
4 . The electronic device of claim 1 , wherein at least one processor comprising processing circuitry is configured individually or collectively to detect a state of the electronic device using the second directional magnetic flux density component and the state reference information, based on the second directional magnetic flux density component included in the magnetic detection data being greater than or equal to a first value and less than or equal to a second value.
5 . The electronic device of claim 4 , wherein at least one processor comprising processing circuitry is configured individually or collectively to detect a state of the electronic device using the first directional magnetic flux density component and the state reference information, based on the second directional magnetic flux density component included in the magnetic detection data being less than the first value or exceeding the second value.
6 . The electronic device of claim 1 , wherein the state reference information includes a plurality of sections divided based on a first value and a second value of the second directional magnetic flux density component, and
wherein at least one processor comprising processing circuitry is configured individually or collectively to:
select one section from the plurality of sections, based on the second directional magnetic flux density component and the first directional magnetic flux density component included in the magnetic detection data; and
detect, in the selected section, a state of the electronic device using one of the first directional magnetic flux density component or the second directional magnetic flux density component.
7 . The electronic device of claim 6 , wherein the plurality of sections of the state reference information include at least one effective section of the second directional magnetic flux density component in which the second directional magnetic flux density component is greater than or equal to the first value and less than or equal to the second value and at least one effective section of the first directional magnetic flux density component in which the second directional magnetic flux density component is less than the first value or exceeds the second value, and
wherein at least one processor comprising processing circuitry is configured individually or collectively to:
detect a state of the electronic device corresponding to the second directional magnetic flux density component, based on the selected section being the at least one effective section of the second directional magnetic flux density component; and
detect a state of the electronic device corresponding to the first directional magnetic flux density component, based on the selected section being the at least one effective section of the first directional magnetic flux density component.
8 . The electronic device of claim 7 , wherein the at least one effective section of the second directional magnetic flux density component includes a first section in which the first directional magnetic flux density component and the second directional magnetic flux density component have negative values, a second section in which the first directional magnetic flux density component is saturated, and a third section in which the first directional magnetic flux density component has a negative value and the second directional magnetic flux density component has a positive value, and
wherein the at least one effective section of the first directional magnetic flux density component includes a fourth section in which the second directional magnetic flux density component is less than the first value and a fifth section in which the second directional magnetic flux density component exceeds the second value.
9 . The electronic device of claim 8 , wherein at least one processor comprising processing circuitry is configured individually or collectively to select one section from the plurality of sections of the state reference information, based on at least one of the first directional magnetic flux density component, a sign of the first directional magnetic flux density component, the second directional magnetic flux density component, or a sign of the second directional magnetic flux density component included in the magnetic detection data.
10 . The electronic device of claim 1 , wherein the magnetic detection data further includes a third directional magnetic flux density component, and
wherein at least one processor comprising processing circuitry is configured individually or collectively to detect noise, based on the third directional magnetic flux density component.
11 . The electronic device of claim 1 , wherein at least one processor comprising processing circuitry is configured individually or collectively to update the stored state reference information or generate new state reference information when a a magnetic field change greater than or equal to a specified value is sensed through the sensor.
12 . The electronic device of claim 11 , wherein at least one processor comprising processing circuitry is configured individually or collectively to:
detect the first directional magnetic flux density component and the second directional magnetic flux density component using the sensor while the electronic device is changed from a first state to a second state;
extract a maximum value and a minimum value of the second directional magnetic flux density component; and
set a plurality of sections and generate the state reference information, based on the maximum value and the minimum value of the second directional magnetic flux density component.
13 . The electronic device of claim 1 , further comprising:
a fixed member on which the magnet is mounted, the fixed member including a magnetic body,
wherein the magnet protrudes from the fixed member by a specified distance.
14 . The electronic device of claim 1 , further comprising:
a hinge structure configured to couple the first housing and the second housing,
wherein the display includes a folding region foldable based on movement of the hinge structure,
wherein the magnet is located on one region of the hinge structure,
wherein the sensor is located in the first housing, and
wherein at least one processor comprising processing circuitry is configured individually or collectively to detect a folding angle of the electronic device, based on the obtained magnetic detection data and the state reference information.
15 . The electronic device of claim 1 , wherein the second housing is coupled to the first housing so as to be slidable relative to the first housing,
wherein an exposed area of the display is extended or reduced based on sliding of the second housing,
wherein the magnet is located on one region in the first housing, and
wherein the sensor is located on one region of the second housing.
16 . A method for detecting a state of an electronic device including a magnet including a first flat surface and a second flat surface opposite the first flat surface and a sensor configured to move in a first direction along a central axis of the magnet, the method comprising:
obtaining magnetic detection data by detecting, through the sensor, at least two directional magnetic flux density components including a first directional magnetic flux density component and a second directional magnetic flux density component; and
detecting a state of the electronic device, based on the obtained magnetic detection data and state reference information about a state of the electronic device corresponding to the first directional magnetic flux density component and the second directional magnetic flux density component,
wherein a first pole and a second pole having a polarity opposite to a polarity of the first pole are arranged sequentially in the first direction on the first flat surface and the second pole and the first pole are arranged sequentially in the first direction on the second flat surface.
17 . The method of claim 16 , wherein a state of the electronic device is detected using the second directional magnetic flux density component and the state reference information, based on the second directional magnetic flux density component included in the magnetic detection data being greater than or equal to a first value and less than or equal to a second value.
18 . The method of claim 17 , wherein a state of the electronic device is detected using the first directional magnetic flux density component and the state reference information, based on the second directional magnetic flux density component included in the magnetic detection data being less than the first value or exceeding the second value.
19 . The method of claim 16 , wherein the state reference information includes a plurality of sections divided based on a first value and a second value of the second directional magnetic flux density component, wherein one section is selected from the plurality of sections, based on the second directional magnetic flux density component and the first directional magnetic flux density component included in the magnetic detection data, and wherein in the selected section, a state of the electronic device is detected using one of the first directional magnetic flux density component or the second directional magnetic flux density component.
20 . The method of claim 16 , wherein the magnetic detection data further includes a third directional magnetic flux density component, and
wherein noise is detected based on the third directional magnetic flux density component.