Abstract:
Provided is a magnetic sensor device, which is configured to connect each terminal of a Hall element to another end of a variable resistor having one end connected to GND by switching of four switches. Thus, a detection voltage level for a magnetic field intensity can be arbitrarily set with a small-scale circuit. The detection voltage level is determined only by the resistance ratio, and hence the influence of fluctuations in power supply voltage and manufacturing fluctuations can be suppressed. This configuration can simplify signal processing and achieve higher-speed signal processing.

Description:
RELATED APPLICATIONS 
     This application claims priority under 35 U.S.C. §119 to Japanese Patent Application No. 2012-031935 filed on Feb. 16, 2012, the entire content of which is hereby incorporated by reference. 
     BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a magnetic sensor device for converting a magnetic field intensity into an electric signal, and for example, to a magnetic sensor device to be employed as a sensor for detecting an open/close state used in a flip phone, a notebook computer, or the like, or a sensor for detecting a rotational position of a motor. 
     2. Description of the Related Art 
     A magnetic sensor device has been employed as a sensor for detecting the open/close state used in a flip phone, a notebook computer, or the like, or a sensor for detecting a rotational position of a motor. 
     In the magnetic sensor device, a magnetoelectric conversion element (for example, Hall element) outputs a voltage proportional to a magnetic field intensity or a magnetic flux density, an amplifier amplifies the output voltage, and a comparator determines the voltage to output a binary signal of an H signal or an L signal. The output voltage of the magnetoelectric conversion element is minute, and hence, easily affected by an offset voltage (element offset voltage) of the magnetoelectric conversion element, an offset voltage (input offset voltage) of the amplifier or the comparator, or noise within a conversion device, which leads to a problem. The element offset voltage is mainly generated by a stress or the like exerted on the magnetoelectric conversion element by a package. The input offset voltage is mainly generated by a characteristic variation of an element that forms an input circuit of the amplifier. The noise is mainly generated by flicker noise of a monolithic transistor that forms a circuit, or thermal noise of the monolithic transistor or a resistive element. 
     There has been devised a magnetic sensor device which reduces an influence of the above-mentioned offset voltage of the magnetoelectric conversion element or the amplifier (for example, see Japanese Patent Application Laid-open No. 2010-281801). A conventional magnetic sensor device illustrated in  FIG. 3  includes a Hall element  51  serving as a magnetoelectric conversion element, a switching circuit  52 , a differential amplifier  53 , a comparator  54 , a detection voltage setting circuit  55 , a first capacitor C 51  and a second capacitor C 52 , and a first switch S 51  and a second switch S 52 . 
       FIG. 4  illustrates a timing chart of the operation of the conventional magnetic sensor device. One period T of the detection operation is divided into a first detection state T 1  and a second detection state T 2  depending on the operation of the switching circuit  52 . In the first detection state T 1 , a first pair of terminals A and C of the Hall element  51  inputs a power supply voltage, and a second pair of terminals B and D outputs a detection voltage. In the second detection state T 2 , the second pair of terminals B and D inputs the power supply voltage, and the first pair of terminals A and C outputs the detection voltage. One period T is further divided into a first sample phase F 1 , a second sample phase F 2 , and a comparison phase F 3  depending on the open/close states of the respective switches. Then, in the comparison phase F 3 , offset components are removed. 
     In the conventional magnetic sensor device, however, the detection voltage setting circuit  55  formed of a bleeder resistor is required to be provided in order to set a detection voltage level for the magnetic field intensity, resulting in the complicated circuit configuration. Further, different power supply systems are necessary for the Hall element  51  and the detection voltage setting circuit  55 , resulting in a problem in that an error occurs in the setting of the detection voltage level. Still further, as described above, the total of three signal processing periods, two sample phases and one comparison phase, are necessary for removing the offset components. 
     SUMMARY OF THE INVENTION 
     It is an object of the present invention to provide a magnetic sensor device capable of accurately setting a detection voltage level and performing high-speed signal processing with a simple circuit configuration using a combination of a Hall element and a resistor. 
     In order to solve the above-mentioned problem inherent in the related art, the magnetic sensor device according to an exemplary embodiment of the present invention is configured as follows. 
     By switching of four switches, each terminal of a Hall element can be connected to another terminal of a variable resistor having one end connected to GND. 
     According to the magnetic sensor device of the present invention, the detection voltage level for the magnetic field intensity can be arbitrarily set with a small-scale circuit. The detection voltage level is determined only by the resistance ratio, and is therefore not affected by fluctuations in power supply voltage and manufacturing fluctuations. The magnetic sensor device can also be dealt with spinning current, and hence can cancel out offsets of the Hall element. Further, the detection voltage can be set regardless of the polarity of an applied magnetic field, and hence fluctuations in the detection voltage between the polarities can be suppressed as well. Besides, this configuration can simplify signal processing and achieve higher-speed signal processing. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       In the accompanying drawings: 
         FIG. 1  is a circuit diagram illustrating a magnetic sensor device according to a first embodiment of the present invention; 
         FIG. 2  is a circuit diagram of an application example of the magnetic sensor device according to the first embodiment of the present invention; 
         FIG. 3  is a circuit diagram of a conventional magnetic sensor device; and 
         FIG. 4  is a timing chart of the conventional magnetic sensor device. 
     
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     First Embodiment 
       FIG. 1  is a circuit diagram illustrating a magnetic sensor device according to a first embodiment of the present invention. The magnetic sensor device in this embodiment includes a Hall element  1  represented by an equivalent bridge circuit of resistors R 1  to R 4 , a variable resistor Ra, a comparator  2 , and switches S 1  to S 12 . 
     The variable resistor Ra has one end connected to GND, and the other end connected to terminals V 1  to V 4  of the Hall element  1  via the switches S 9  to S 12 , respectively. The terminals V 1  and V 2  are connected to a power source via the switches S 1  and S 2 , respectively. The terminals V 1  and V 2  are also connected to a first input terminal of the comparator  2  via the switches S 5  and S 6 , respectively. The terminals V 3  and V 4  are connected to GND via the switches S 3  and S 4 , respectively. The terminals V 3  and V 4  are also connected to a second input terminal of the comparator  2  via the switches S 7  and S 8 , respectively. 
     Next, the operation of the magnetic sensor device is described. As a first phase, the switches S 1 , S 3 , S 6 , and S 8  are turned OFF, and the switches S 2 , S 4 , S 5 , and S 7  are turned ON. Depending on the polarity of a magnetic field to be detected, one of the switch S 10  and the switch S 12  is turned ON and the other switch is turned OFF. 
     For example, it is supposed that the switch S 10  is turned ON and the switches S 9 , S 11 , and S 12  are turned OFF in the first phase. When the voltage of the terminal V 1  and the voltage of the terminal V 3  at which the output of the comparator  2  is inverted are equal to each other, the relationship of Expression (1) is established.
 
 Ra=R 1* R 3* R 4/( R 2* R 4− R 1* R 3)  (1)
 
Provided that R 1 =R 2 =R 3 =R 4 =R is established in the state in which no magnetic field is present and the respective resistance values have a variation ΔR in the state in which a certain level of magnetic field is applied, R 1 =R−ΔR, R 2 =R+ΔR, R 3 =R−ΔR, and R 4 =R+ΔR are expected to be established in the above-mentioned state of Expression (1). Those values are substituted into Expression (1) to derive Expression (2).
 
 Ra=R   2 *(1−Δ R/R −(Δ R/R ) 2 +(Δ R/R ) 3 )/(4*Δ R )  (2)
 
ΔR is sufficiently smaller than R, and hence, when the second-order and third-order terms of (ΔR/R) are ignored, Expression (3) is established.
 
Δ R/R≈ 1/(1+4* Ra/R )  (3)
 
Therefore, in the present invention, the detection voltage can be determined only by the resistance ratio Ra/R without depending on fluctuations in power supply voltage and manufacturing fluctuations. As a result, highly-accurate setting of the detection voltage level can be realized.
 
     Note that, also in the case where the switches S 1 , S 3 , S 6 , and S 8  are turned ON and the switches S 2 , S 4 , S 5 , and S 7  are turned OFF in the second phase, and in the case where the polarity of the applied magnetic field is opposite, the detection voltage setting expressed by Expression (3) can be performed by turning ON and OFF the switches S 9  to S 12  in the opposite manner to the above-mentioned case. Further, as is apparent from the foregoing, only one kind of variable resistor, that is, the variable resistor Ra, is required to be connected as the component other than the Hall element. Thus, fluctuations among elements less occur, and a magnetic sensor device having small fluctuations in detection voltage level can be realized. 
     Further, even when one end of the variable resistor Ra may be connected to VDD instead of GND, the same effects can be obtained. 
     Note that, the magnetic sensor device according to the embodiment of the present invention can be configured to output an analog signal by changing the comparator to a differential amplifier. 
     According to the present invention, spinning current (technique of canceling out an offset by alternating currents between the first and second phases) can also be performed without any modifications. 
     Then, when a combination of a differential amplifier, a capacitor, and a switch is provided downstream of the comparator as in the conventional magnetic sensor device, the first phase can be used as a sample phase, and the second phase can be used as a comparison phase. Thus, unlike the conventional case where three signal processing phases are necessary for removing an offset, the present invention can complete signal processing in two phases. As a result, the signal processing period can be shortened (higher-speed signal processing can be realized). 
     Second Embodiment 
       FIG. 2  illustrates a circuit diagram of a magnetic sensor device according to a second embodiment of the present invention. The second embodiment is different from the first embodiment in that the variable resistor Ra in the first embodiment is divided into a variable resistor Rb and a variable resistor Rc. 
     The variable resistor Rb has one end connected to GND, and the other end connected to one end of the variable resistor Rc and to the switches S 9  to S 12  via a switch S 13 . The variable resistor Rc has the other end connected to the switches S 9  to S 12 . 
     In the case of setting a detection voltage, the switch S 13  is turned ON to select the variable resistor Rb. In the case of setting a canceling voltage, the switch S 13  is turned OFF to select the variable resistor Rb and the variable resistor Re. In this manner, the magnetic sensor device in this embodiment is capable of setting a hysteresis between the detection voltage and the canceling voltage. In this case, Expressions (4) and (5) are established in the detection voltage setting and the canceling voltage setting, respectively.
 
Δ R/R≈ 1/(1+4* Rb/R )  (4)
 
Δ R/R≈ 1/(1+4*( Rb+Rc )/ R )  (5)
 
     Therefore, in the magnetic sensor device in this embodiment, a hysteresis can be set between the detection voltage and the canceling voltage for the magnetic field intensity in the first phase or the second phase. 
     Similarly to the first embodiment, the magnetic sensor device in this embodiment can be configured to output an analog signal by changing the comparator to a differential amplifier. 
     Spinning current (technique of canceling out an offset by alternating currents between the first and second phases) can also be performed without any modifications. 
     Then, when a combination of a differential amplifier, a capacitor, and a switch is provided downstream of the comparator as in the conventional magnetic sensor device, the first phase can be used as a sample phase, and the second phase can be used as a comparison phase. Thus, unlike the conventional case where three signal processing phases are necessary for removing an offset, the present invention can complete signal processing in two phases. As a result, the signal processing period can be shortened (higher-speed signal processing can be realized). 
     The magnetic sensor device according to the present invention may be used for alternation detection (for example, rotation detection of a motor). The magnetic sensor device for alternation detection is configured to switch from a state in which only one polarity (for example, S-pole) is detected to a state in which only another polarity (N-pole) is detected upon detection of the one polarity.