Abstract:
Provided is a temperature compensation circuit capable of solely and independently adjusting a temperature compensation amount. The temperature compensation circuit includes: a first temperature compensation voltage terminal connected to a node between a first resistor and a second resistor; a second temperature compensation voltage terminal connected to a node between a third resistor and a fourth resistor; a first voltage terminal formed at a node between the first resistor and the fourth resistor; a second voltage terminal formed at a node between the second resistor and the third resistor; a fifth resistor connected between a power supply terminal and the first voltage terminal; and a sixth resistor connected between a ground terminal and the second voltage terminal.

Description:
RELATED APPLICATIONS 
       [0001]    This application claims priority under 35 U.S.C. §119 to Japanese Patent Application No. 2015-112309 filed on Jun. 2, 2015, the entire content of which is hereby incorporated by reference. 
       BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
       [0002]    The present invention relates to a temperature compensation circuit and a sensor device, and more particularly, to a circuit configured to perform temperature compensation of the sensitivity of a sensor element. 
       2. Description of the Related Art 
       [0003]    These days, various kinds of sensor devices are mounted on electronic apparatus and are utilized. For example, a magnetic sensor device is mounted on an electronic apparatus and a magnet is provided on a lid or a cover thereof When the lid or the cover is away from the electronic apparatus, the electronic apparatus provides normal operation, and, when the lid or the cover is close to the electronic apparatus, the electronic apparatus operates to shift to a power saving mode. The magnetic sensor device is configured to determine whether the lid or the cover is away from or close to the electronic apparatus using change in density of a magnetic flux from the magnet and output signals indicating whether the density of the applied magnetic flux is below or above a predetermined value so that the signals can be transferred to the electronic apparatus. In this case, it is ideal that an output signal from the sensor device is constant when the temperature changes. However, an output signal of a sensor element itself included in the sensor device depends on the temperature, and thus, it is required to mount, on the sensor device, a temperature compensation circuit for compensating for the temperature dependence of the sensor element. 
         [0004]      FIG. 10  is an exemplary circuit diagram of a related-art temperature compensation circuit. A related-art temperature compensation circuit BL 1  includes resistors R 11  to R 14  that are connected in series in this order between a power supply terminal VDD and a ground terminal VSS, and a resistor R 41 . A first reference voltage VTH 1  is output from a first output terminal NTH 1  that is a node between the resistor R 11  and the resistor R 12 , a reference voltage VREF is output from a reference voltage terminal NREF that is a node between the resistor R 12  and the resistor R 13 , and a second reference voltage VTH 2  is output from a second output terminal NTH 2  that is a node between the resistor R 13  and the resistor R 14 . The resistor R 41  is connected between the first output terminal NTH 1  and the second output terminal NTH 2 . 
         [0005]    With regard to the resistors R 11  to R 14 , the resistors R 11  and R 14  have the same resistance value, the resistors R 12  and R 13  have the same resistance value, and the resistance values of the resistors R 11  to R 14  have the same temperature coefficient. The resistance value of the resistor R 41  has a temperature coefficient that is different from the temperature coefficient of the resistance values of the resistors R 11  to R 14 . Here, for the sake of convenience of description, the temperature coefficient of the resistance values of the resistors R 11  to R 14  is assumed to be larger than the temperature coefficient of the resistance value of the resistor R 41 . Then, the following expressions are established. 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       VTH 
                        
                       
                           
                       
                        
                       1 
                     
                     - 
                     VREF 
                   
                   = 
                   
                     VDD 
                     × 
                     
                       
                         
                           RX 
                           / 
                           R 
                         
                          
                         
                             
                         
                          
                         11 
                       
                       
                         2 
                         × 
                         
                           ( 
                           
                             2 
                             + 
                             
                               
                                 RX 
                                 / 
                                 R 
                               
                                
                               
                                   
                               
                                
                               11 
                             
                           
                           ) 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   
                     A 
                      
                     
                         
                     
                      
                     1 
                   
                   ) 
                 
               
             
             
               
                 
                   
                     
                       VTH 
                        
                       
                           
                       
                        
                       2 
                     
                     - 
                     VREF 
                   
                   = 
                   
                     
                       - 
                       VDD 
                     
                     × 
                     
                       
                         
                           RX 
                           / 
                           R 
                         
                          
                         
                             
                         
                          
                         11 
                       
                       
                         2 
                         × 
                         
                           ( 
                           
                             2 
                             + 
                             
                               
                                 RX 
                                 / 
                                 R 
                               
                                
                               
                                   
                               
                                
                               11 
                             
                           
                           ) 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   A2 
                   ) 
                 
               
             
             
               
                 
                   VREF 
                   = 
                   
                     VDD 
                     2 
                   
                 
               
               
                 
                   ( 
                   A3 
                   ) 
                 
               
             
           
         
       
     
         [0006]    In this case, the voltage at the ground terminal VSS is assumed to be zero. Further, RX is a resistance value between the first output terminal NTH 1  and the second output terminal NTH 2  and is expressed by the following expression. 
         [0000]    
       
         
           
             
               
                 
                   RX 
                   = 
                   
                     
                       2 
                       × 
                       4 
                        
                       R 
                        
                       
                           
                       
                        
                       11 
                       × 
                       R 
                        
                       
                           
                       
                        
                       41 
                     
                     
                       
                         2 
                         × 
                         R 
                          
                         
                             
                         
                          
                         11 
                       
                       + 
                       
                         R 
                          
                         
                             
                         
                          
                         41 
                       
                     
                   
                 
               
               
                 
                   ( 
                   A4 
                   ) 
                 
               
             
           
         
       
     
         [0007]    By substituting Expression (A4) into Expression (A1) and Expression (A2), the following expressions are obtained. 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       VTH 
                        
                       
                           
                       
                        
                       1 
                     
                     - 
                     VREF 
                   
                   = 
                   
                     
                       + 
                       VDD 
                     
                     × 
                     
                       1 
                       
                         4 
                         · 
                         
                           ( 
                           
                             
                               R 
                                
                               
                                   
                               
                                
                               
                                 11 
                                 / 
                                 R 
                               
                                
                               
                                   
                               
                                
                               41 
                             
                             + 
                             1 
                           
                           ) 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   A5 
                   ) 
                 
               
             
             
               
                 
                   
                     
                       VTH 
                        
                       
                           
                       
                        
                       2 
                     
                     - 
                     VREF 
                   
                   = 
                   
                     
                       - 
                       VDD 
                     
                     × 
                     
                       1 
                       
                         4 
                         · 
                         
                           ( 
                           
                             
                               R 
                                
                               
                                   
                               
                                
                               
                                 11 
                                 / 
                                 R 
                               
                                
                               
                                   
                               
                                
                               41 
                             
                             + 
                             1 
                           
                           ) 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   A6 
                   ) 
                 
               
             
           
         
       
     
         [0008]    As the temperature becomes higher, the resistance value of the resistor R 41  becomes smaller with respect to the resistance value of the resistor R 11 , and thus, the term R 11 /R 41  becomes larger as the temperature becomes higher. As shown in  FIG. 11 , (VTH 1 −VREF) becomes smaller as the temperature becomes higher. (VREF−VTH 2 ) also becomes smaller as the temperature becomes higher. As described above, through allowing the reference voltage to be temperature dependent and fitting the temperature coefficient of the reference voltage to the temperature coefficient of the sensor element, output of the sensor device becomes constant when the temperature changes and hence highly precise output without temperature dependence can be achieved. Further, through adjusting the resistance values of the resistor R 41  and of the resistors R 11  to R 14  to adjust the ratio of the resistance values among the resistors having different temperature coefficients, the temperature compensation amount can be adjusted. Thus, a temperature compensation circuit applicable to a wide range of sensor devices or semiconductor devices can be achieved with a small circuit scale. 
         [0009]    However, in the related-art temperature compensation circuit, not only the temperature compensation amount but also the compensation amount at a certain reference temperature changes, and thus, there is a problem in that a resistance value range in which both an optimum compensation amount at the reference temperature and an optimum temperature compensation amount can be attained is narrow, and a range in which the temperature compensation circuit can be used is limited. In other words, there is a problem in that the temperature compensation amount cannot be solely and independently adjusted. 
       SUMMARY OF THE INVENTION 
       [0010]    In order to solve the related-art problems as described above, a temperature compensation circuit according to one embodiment of the present invention has the following configuration. 
         [0011]    The temperature compensation circuit includes: at least six resistors of a first resistor to a sixth resistor; a first output terminal connected to a node between the first resistor and the second resistor; a second output terminal connected to a node between the third resistor and the fourth resistor; a first voltage terminal formed at a node between the first resistor and the fourth resistor; and a second voltage terminal formed at a node between the second resistor and the third resistor, the fifth resistor being connected between a power supply terminal and the first voltage terminal, the sixth resistor being connected between a ground terminal and the second voltage terminal, in which a resistance value of at least one of the first resistor to the fourth resistor has a temperature coefficient that is different from a temperature coefficient of a resistance value of another of the first resistor to the fourth resistor, and in which the resistance value of the at least one of the first resistor to the fourth resistor is adjusted so that a temperature compensation voltage that is output from the first output terminal and a temperature compensation voltage that is output from the second output terminal is equal to each other at a predetermined temperature. 
         [0012]    According to the temperature compensation circuit of the present invention, through effectively using the resistors having different temperature coefficients, a temperature compensation circuit that can adjust only the temperature coefficient and that can adjust the temperature compensation amount can be achieved with a relatively small circuit scale. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0013]      FIG. 1  is a circuit diagram of a temperature compensation circuit according to a first embodiment of the present invention. 
           [0014]      FIG. 2  is a graph for showing temperature dependence of resistors used in the first embodiment. 
           [0015]      FIG. 3  is a graph for showing temperature dependence of an output voltage according to the first embodiment. 
           [0016]      FIG. 4  is a circuit diagram of a temperature compensation circuit according to a second embodiment of the present invention. 
           [0017]      FIG. 5  is a circuit diagram of a temperature compensation circuit according to a third embodiment of the present invention. 
           [0018]      FIG. 6  is a graph for showing temperature dependence of sensitivity of a sensor element. 
           [0019]      FIG. 7  is a circuit diagram of a case in which the temperature compensation circuit according to the present invention is applied to a magnetic sensor device. 
           [0020]      FIG. 8  is a circuit diagram of another case in which the temperature compensation circuit according to the present invention is applied to a magnetic sensor device. 
           [0021]      FIG. 9  is a circuit diagram for illustrating an exemplary reference voltage circuit used in a magnetic sensor device. 
           [0022]      FIG. 10  is a circuit diagram of a related-art temperature compensation circuit. 
           [0023]      FIG. 11  is a graph for showing temperature dependence of a reference voltage in the related-art temperature compensation circuit. 
       
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
       [0024]    A temperature compensation circuit according to the present invention can be widely used as a temperature compensation circuit in a semiconductor circuit. The temperature compensation circuit according to the present invention is described in the following with reference to the attached drawings. 
       First Embodiment 
       [0025]      FIG. 1  is a circuit diagram of a temperature compensation circuit according to a first embodiment of the present invention. A temperature compensation circuit  1  according to the first embodiment includes resistors R 1  to R 6 . 
         [0026]    A first output terminal Nr 1  is connected to a node between the resistor R 1  and the resistor R 2 . A second output terminal Nr 2  is connected to a node between the resistor R 3  and the resistor R 4 . A first voltage terminal Na is formed at a node between the resistor R 1  and the resistor R 4 , and a second voltage terminal Nb is formed at a node between the resistor R 2  and the resistor R 3 . The resistor R 5  is connected between a power supply terminal VDD and the first voltage terminal Na, and the resistor R 6  is connected between a ground terminal VSS and the second voltage terminal Nb. 
         [0027]    Voltages at the first output terminal Nr 1 , at the second output terminal Nr 2 , at the first voltage terminal Na, and at the second voltage terminal Nb are represented by Vr 1 , Vr 2 , Va, and Vb, respectively. Vr 1  and Vr 2  are calculated by the following expressions. 
         [0000]    
       
         
           
             
               
                 
                   
                     Vr 
                      
                     
                         
                     
                      
                     1 
                   
                   = 
                   
                     
                       
                         R 
                          
                         
                             
                         
                          
                         2 
                         × 
                         Va 
                       
                       + 
                       
                         R 
                          
                         
                             
                         
                          
                         1 
                         × 
                         Vb 
                       
                     
                     
                       
                         R 
                          
                         
                             
                         
                          
                         1 
                       
                       + 
                       
                         R 
                          
                         
                             
                         
                          
                         2 
                       
                     
                   
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
             
               
                 
                   
                     Vr 
                      
                     
                         
                     
                      
                     2 
                   
                   = 
                   
                     
                       
                         R 
                          
                         
                             
                         
                          
                         3 
                         × 
                         Va 
                       
                       + 
                       
                         R 
                          
                         
                             
                         
                          
                         4 
                         × 
                         Vb 
                       
                     
                     
                       
                         R 
                          
                         
                             
                         
                          
                         3 
                       
                       + 
                       
                         R 
                          
                         
                             
                         
                          
                         4 
                       
                     
                   
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
         [0028]    When a difference between Vr 1  and Vr 2  is represented by a temperature compensation voltage ΔVr, the temperature compensation voltage ΔVr is expressed by the following expression. 
         [0000]    
       
         
           
             
               
                 
                   
                     Δ 
                      
                     
                         
                     
                      
                     Vr 
                   
                   = 
                   
                     
                       
                         Vr 
                          
                         
                             
                         
                          
                         1 
                       
                       - 
                       
                         Vr 
                          
                         
                             
                         
                          
                         2 
                       
                     
                     = 
                     
                       
                         
                           
                             R 
                              
                             
                                 
                             
                              
                             2 
                             × 
                             R 
                              
                             
                                 
                             
                              
                             4 
                           
                           - 
                           
                             R 
                              
                             
                                 
                             
                              
                             1 
                             × 
                             R 
                              
                             
                                 
                             
                              
                             3 
                           
                         
                         
                           
                             ( 
                             
                               
                                 R 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               + 
                               
                                 R 
                                  
                                 
                                     
                                 
                                  
                                 2 
                               
                             
                             ) 
                           
                           × 
                           
                             ( 
                             
                               
                                 R 
                                  
                                 
                                     
                                 
                                  
                                 3 
                               
                               + 
                               
                                 R 
                                  
                                 
                                     
                                 
                                  
                                 4 
                               
                             
                             ) 
                           
                         
                       
                       × 
                       
                         ( 
                         
                           Va 
                           - 
                           Vb 
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
         [0029]    At least one resistor of the resistors R 1  to R 4  has a temperature coefficient that is different from a temperature coefficient of the resistance value of another of the resistors. 
         [0030]      FIG. 2  is a graph for showing temperature dependence of the resistance values of the resistors R 1  to R 4  used in the first embodiment. For the sake of convenience of description, as an example, it is assumed that the resistance values of the resistors R 1 , R 3 , and R 4  are equal to one another, the temperature coefficients of the respective resistance values are equal to one another, and the temperature coefficient of the resistance value of the resistor R 2  is different from, in particular, smaller than, the temperature coefficient of the resistance values of the resistors R 1 , R 3 , and R 4 . The temperature coefficient of the resistance values of the resistors R 1 , R 3 , and R 4  is referred to as a first temperature coefficient, while the temperature coefficient of the resistance value of the resistor R 2  is referred to as a second temperature coefficient. It is further assumed that, at a certain temperature T 0 , the resistance value of the resistor R 1  and the resistance value of the resistor R 2  are equal to each other. Then, from Expression (3), the temperature compensation voltage ΔVr is expressed as follows. 
         [0000]    
       
         
           
             
               
                 
                   
                     Δ 
                      
                     
                         
                     
                      
                     Vr 
                   
                   = 
                   
                     
                       1 
                       2 
                     
                     × 
                     
                       
                         α 
                         - 
                         1 
                       
                       
                         α 
                         + 
                         1 
                       
                     
                     × 
                     
                       ( 
                       
                         Va 
                         - 
                         Vb 
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
         [0031]    In Expression (4), a is a ratio between the resistance value of the resistor R 2  and the resistance value of the resistor R 1 , that is, α=R 2 /R 1 . At the temperature T 0 , the resistance value of the resistor R 1  and the resistance value of the resistor R 2  are equal to each other and α=1, and thus, the temperature compensation voltage ΔVr is zero. At a temperature higher than the temperature T 0 , the resistance value of the resistor R 2  is smaller than the resistance value of the resistor R 1 , that is, α&lt;1, and thus, the temperature compensation voltage ΔVr is a negative value. At a temperature lower than the temperature T 0 , the resistance value of the resistor R 2  is larger than the resistance value of the resistor R 1 , that is, α&gt;1, and thus, the temperature compensation voltage ΔVr is a positive value. This is shown in  FIG. 3 . 
         [0032]      FIG. 3  is a graph for showing temperature dependence of an output voltage according to the first embodiment. At the temperature T 0 , ΔVr=Vr 1 −Vr 2 =0, and thus, Vr 1 =Vr 2 . At a temperature higher than the temperature T 0 , ΔVr=Vr 1 −Vr 2 &lt;0, and thus, Vr 1 &lt;Vr 2 . At a temperature lower than the temperature T 0 , ΔVr=Vr 1 −Vr 2 &gt;0, and thus, Vr 1 &gt;Vr 2 . 
         [0033]    Further, the temperature compensation voltage ΔVr at a temperature other than the temperature T 0  varies, as expressed by Expression (4), depending on α=R 2 /R 1 , that is, the resistance values of the resistors R 1  and R 2 . As described above, the resistance values of the resistors R 1  and R 2  are adjusted so as to be equal to each other at the temperature T 0 , and thus, it is difficult to adjust the resistance values at a temperature other than the temperature T 0 . The resistor R 5  and the resistor R 6  are formed for the purpose of adjusting the temperature compensation voltage ΔVr. 
         [0034]    As expressed by Expression (4), the temperature compensation voltage ΔVr varies depending on the value of (Va−Vb). In the following, (Va−Vb) is calculated. When a current flowing through the resistor R 5  and a current flowing through the resistor R 6  are represented by I 5  and I 6 , respectively, I 5  and I 6  are expressed by the following expressions. 
         [0000]    
       
         
           
             
               
                 
                   
                     I 
                      
                     
                         
                     
                      
                     5 
                   
                   = 
                   
                     
                       VDD 
                       - 
                       Va 
                     
                     
                       R 
                        
                       
                           
                       
                        
                       5 
                     
                   
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
             
               
                 
                   
                     I 
                      
                     
                         
                     
                      
                     6 
                   
                   = 
                   
                     
                       Vb 
                       - 
                       VSS 
                     
                     
                       R 
                        
                       
                           
                       
                        
                       6 
                     
                   
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
           
         
       
     
         [0035]    When the above expressions are deformed to determine Va and Vb, and further, Va−Vb, the following expressions are obtained. 
         [0000]        Va=VDD−I 5· R 5   (7)
 
         [0000]        Vb=VSS−I 6· R 6   (8)
 
         [0000]        Va−Vb =( VDD−VSS )− I 5· R 5+ I 6− R 6   (9)
 
         [0036]    Because of the circuit configuration, the current I 5  and the current I 6  are equal to each other, and thus, Expression (9) is expressed as follows. 
         [0000]        Va−Vb =( VDD−VSS )− I 5·( R 5+ R 6)   (10)
 
         [0037]    Here, when a resistor equivalent to the resistors R 1  to R 4  is represented by Ra and a resistor equivalent to the resistors R 1  to R 6  is represented by Rt, the resistance values of the equivalent resistor Ra and the equivalent resistor Rt are expressed by the following expressions. 
         [0000]    
       
         
           
             
               
                 
                   Ra 
                   = 
                   
                     
                       
                         ( 
                         
                           
                             R 
                              
                             
                                 
                             
                              
                             1 
                           
                           + 
                           
                             R 
                              
                             
                                 
                             
                              
                             2 
                           
                         
                         ) 
                       
                       × 
                       
                         ( 
                         
                           
                             R 
                              
                             
                                 
                             
                              
                             3 
                           
                           + 
                           
                             R 
                              
                             
                                 
                             
                              
                             4 
                           
                         
                         ) 
                       
                     
                     
                       
                         ( 
                         
                           
                             R 
                              
                             
                                 
                             
                              
                             1 
                           
                           + 
                           
                             R 
                              
                             
                                 
                             
                              
                             2 
                           
                         
                         ) 
                       
                       + 
                       
                         ( 
                         
                           
                             R 
                              
                             
                                 
                             
                              
                             3 
                           
                           + 
                           
                             R 
                              
                             
                                 
                             
                              
                             4 
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   11 
                   ) 
                 
               
             
             
               
                 
                   Rt 
                   = 
                   
                     
                       R 
                        
                       
                           
                       
                        
                       5 
                     
                     + 
                     
                       R 
                        
                       
                           
                       
                        
                       6 
                     
                     + 
                     Ra 
                   
                 
               
               
                 
                   ( 
                   12 
                   ) 
                 
               
             
           
         
       
     
         [0038]    Because of the circuit configuration, a current flowing through the resistor R 5  and a current flowing through the equivalent resistor Rt are equal to each other, and thus the following expression is established. 
         [0000]    
       
         
           
             
               
                 
                   
                     Va 
                     - 
                     Vb 
                   
                   = 
                   
                     
                       ( 
                       
                         1 
                         - 
                         
                           
                             
                               R 
                                
                               
                                   
                               
                                
                               5 
                             
                             + 
                             
                               R 
                                
                               
                                   
                               
                                
                               6 
                             
                           
                           Rt 
                         
                       
                       ) 
                     
                     × 
                     
                       ( 
                       
                         VDD 
                         - 
                         VSS 
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   13 
                   ) 
                 
               
             
           
         
       
     
         [0039]    When Expression (13) is substituted into Expression (10), the following expression is obtained. 
         [0000]    
       
         
           
             
               
                 
                   
                     Va 
                     - 
                     Vb 
                   
                   = 
                   
                     
                       ( 
                       
                         1 
                         - 
                         
                           
                             
                               R 
                                
                               
                                   
                               
                                
                               5 
                             
                             + 
                             
                               R 
                                
                               
                                   
                               
                                
                               6 
                             
                           
                           Rt 
                         
                       
                       ) 
                     
                     × 
                     
                       ( 
                       
                         VDD 
                         - 
                         VSS 
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   14 
                   ) 
                 
               
             
           
         
       
     
         [0040]    When Expression (14) is substituted into Expression (12), the following expression is obtained. 
         [0000]    
       
         
           
             
               
                 
                   
                     Va 
                     - 
                     Vb 
                   
                   = 
                   
                     
                       Ra 
                       
                         
                           R 
                            
                           
                               
                           
                            
                           5 
                         
                         + 
                         
                           R 
                            
                           
                               
                           
                            
                           6 
                         
                         + 
                         Ra 
                       
                     
                     × 
                     
                       ( 
                       
                         VDD 
                         - 
                         VSS 
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   15 
                   ) 
                 
               
             
           
         
       
     
         [0041]    Further, Expression (15) is deformed to obtain the following expression. 
         [0000]    
       
         
           
             
               
                 
                   
                     Va 
                     - 
                     Vb 
                   
                   = 
                   
                     
                       1 
                       
                         1 
                         + 
                         
                           
                             
                               R 
                                
                               
                                   
                               
                                
                               5 
                             
                              
                             
                               R 
                                
                               
                                   
                               
                                
                               6 
                             
                           
                           Ra 
                         
                       
                     
                     × 
                     
                       ( 
                       
                         VDD 
                         - 
                         VSS 
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   16 
                   ) 
                 
               
             
           
         
       
     
         [0042]    When Expression (11) is substituted into Expression (16), the following expression is obtained. 
         [0000]    
       
         
           
             
               
                 
                   
                     Va 
                     - 
                     Vb 
                   
                   = 
                   
                     
                       1 
                       
                         1 
                         + 
                         
                           
                             ( 
                             
                               
                                 R 
                                  
                                 
                                     
                                 
                                  
                                 5 
                               
                               + 
                               
                                 R 
                                  
                                 
                                     
                                 
                                  
                                 6 
                               
                             
                             ) 
                           
                           × 
                           
                             
                               
                                 ( 
                                 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     1 
                                   
                                   + 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     2 
                                   
                                 
                                 ) 
                               
                               + 
                               
                                 ( 
                                 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     3 
                                   
                                   + 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     4 
                                   
                                 
                                 ) 
                               
                             
                             
                               
                                 ( 
                                 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     1 
                                   
                                   - 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     2 
                                   
                                 
                                 ) 
                               
                               × 
                               
                                 ( 
                                 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     3 
                                   
                                   + 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     4 
                                   
                                 
                                 ) 
                               
                             
                           
                         
                       
                     
                     × 
                     
                       ( 
                       
                         VDD 
                         - 
                         VSS 
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   17 
                   ) 
                 
               
             
           
         
       
     
         [0043]    Therefore, as the resistance values of the resistors R 5  and R 6  become larger, (Va−Vb) becomes smaller, and the temperature compensation voltage ΔVr expressed by Expression (3) or Expression (4) becomes smaller. In other words, through setting the resistance values of the resistor R 5  and the resistor R 6  to be arbitrary values, (Va−Vb) can be arbitrarily adjusted, and thus, the temperature compensation voltage ΔVr expressed by Expression (3) or Expression (4) can be arbitrarily adjusted. On the other hand, no matter what resistance values the resistor R 5  and the resistor R 6  have, the temperature compensation voltage ΔVr is zero at the temperature T 0 , and thus, the temperature compensation circuit according to this embodiment can solely and independently adjust the temperature compensation amount. 
         [0044]    Operation of the temperature compensation circuit according to the first embodiment of the present invention is described above. Through effectively utilizing the resistors having different temperature coefficients, a temperature compensation circuit that can adjust only the temperature coefficient and that can adjust the temperature compensation amount can be achieved with a relatively small circuit scale. 
         [0045]    In this description, an exemplary relationship between the resistance values of the resistors R 1  to R 4  and the temperature dependence of the resistance values is described, but the relationship among the resistors is not limited thereto insofar as the configuration is as described herein. For example, the temperature coefficient of the resistance value of the resistor R 1  may be different from that of the resistors R 2  to R 4 , or the temperature coefficient of the resistance value of the resistor R 3  may be different from that of the resistors R 1 , R 2 , and R 4 . Alternatively, the temperature coefficient of the resistance values of the resistors R 1  and R 3  may be equal to each other and the resistors R 2  and R 4  having a temperature coefficient of the resistance values that is different from that of the resistors R 1  and R 3  may be used. For the sake of description, the resistance values of the resistor R 1  and the resistor R 3  are equal to each other, the resistance values of the resistor R 2  and the resistor R 4  are equal to each other, and the ratio of the resistance values between the resistors R 2  and R 1  is represented by α, that is, α=R 2 /R 1 . From Expression (3), the temperature compensation voltage ΔVr is expressed by the following expression. 
         [0000]    
       
         
           
             
               
                 
                   
                     Δ 
                      
                     
                         
                     
                      
                     Vr 
                   
                   = 
                   
                     
                       
                         α 
                         - 
                         1 
                       
                       
                         α 
                         + 
                         1 
                       
                     
                     × 
                     
                       ( 
                       
                         Va 
                         - 
                         Vb 
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   18 
                   ) 
                 
               
             
           
         
       
     
         [0046]    The right side of Expression (18) is twice as large as the right side of Expression (4). Therefore, the temperature compensation voltage ΔVr is twice as large as that described with Expression (4). On the other hand, the temperature compensation voltage ΔVr is zero at the temperature T 0 . Therefore, the temperature compensation circuit has the characteristics of the temperature compensation circuit described above. Further, in the above description, R 1 =R 2  is a condition for the temperature compensation voltage ΔVr to be zero at the temperature T 0 , but the present invention is not limited thereto. It is enough that resistance values are selected so that the numerator in the fraction part in Expression (3) may be zero. Specifically, it is enough that the resistance values are selected so that R 2 ×R 4 =R 1 ×R 3  may be satisfied. 
       Second Embodiment 
       [0047]      FIG. 4  is a circuit diagram of a temperature compensation circuit according to a second embodiment of the present invention. The second embodiment is different from the first embodiment illustrated in  FIG. 1  in that a resistor R 7  is added. The added resistor R 7  is connected between the first voltage terminal Na and the second voltage terminal Nb. Through adding the resistor R 7 , a resistor Ra′ equivalent to the resistors R 1  to R 4  and the resistor R 7  is expressed by the following expression. 
         [0000]    
       
         
           
             
               
                 
                   
                     Ra 
                     ′ 
                   
                   = 
                   
                     
                       
                         R 
                          
                         
                             
                         
                          
                         7 
                       
                       
                         
                           R 
                            
                           
                               
                           
                            
                           7 
                         
                         + 
                         Ra 
                       
                     
                     × 
                     Ra 
                   
                 
               
               
                 
                   ( 
                   19 
                   ) 
                 
               
             
           
         
       
     
         [0048]    Here, Ra is the same as the resistor Ra equivalent to the resistors R 1  to R 4  expressed by Expression (11) in the first embodiment. Further, when a resistor equivalent to the resistors R 1  to R 7  is represented by Rt′, the equivalent resistor Rt is expressed by the following expression. 
         [0000]        Rt′=R 5+ R 6+ Ra′   (20)
 
         [0049]    Similarly to the process of deriving Expression (17) from Expression (13) according to the first embodiment, (Va−Vb) is determined as in the following expressions. 
         [0050]    Because of the circuit configuration, a current flowing through the resistor R 5  and a current flowing through the equivalent resistor Rt′ are equal to each other, and thus the following expression is established. 
         [0000]    
       
         
           
             
               
                 
                   
                     I 
                      
                     
                         
                     
                      
                     5 
                   
                   = 
                   
                     
                       VDD 
                       - 
                       VSS 
                     
                     
                       Rt 
                       ′ 
                     
                   
                 
               
               
                 
                   ( 
                   21 
                   ) 
                 
               
             
           
         
       
     
         [0051]    When Expression (21) is substituted into Expression (10), the following expression is obtained. 
         [0000]    
       
         
           
             
               
                 
                   
                     Va 
                     - 
                     Vb 
                   
                   = 
                   
                     
                       ( 
                       
                         1 
                         - 
                         
                           
                             
                               R 
                                
                               
                                   
                               
                                
                               5 
                             
                             + 
                             
                               R 
                                
                               
                                   
                               
                                
                               6 
                             
                           
                           
                             Rt 
                             ′ 
                           
                         
                       
                       ) 
                     
                     × 
                     
                       ( 
                       
                         VDD 
                         - 
                         VSS 
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   22 
                   ) 
                 
               
             
           
         
       
     
         [0052]    When Expression (20) is substituted into Expression (22), the following expression is obtained. 
         [0000]    
       
         
           
             
               
                 
                   
                     Va 
                     - 
                     Vb 
                   
                   = 
                   
                     
                       
                         Ra 
                         ′ 
                       
                       
                         
                           R 
                            
                           
                               
                           
                            
                           5 
                         
                         + 
                         
                           R 
                            
                           
                               
                           
                            
                           6 
                         
                         + 
                         
                           Ra 
                           ′ 
                         
                       
                     
                     × 
                     
                       ( 
                       
                         VDD 
                         - 
                         VSS 
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   23 
                   ) 
                 
               
             
           
         
       
     
         [0053]    Further, Expression (23) is deformed to obtain the following expression. 
         [0000]    
       
         
           
             
               
                 
                   
                     Va 
                     - 
                     Vb 
                   
                   = 
                   
                     
                       1 
                       
                         1 
                         + 
                         
                           
                             
                               R 
                                
                               
                                   
                               
                                
                               5 
                             
                             + 
                             
                               R 
                                
                               
                                   
                               
                                
                               6 
                             
                           
                           
                             Ra 
                             ′ 
                           
                         
                       
                     
                     × 
                     
                       ( 
                       
                         VDD 
                         - 
                         VSS 
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   24 
                   ) 
                 
               
             
           
         
       
     
         [0054]    When Expression (19) is substituted into Expression (24), the following expression is obtained. 
         [0000]    
       
         
           
             
               
                 
                   Va 
                   - 
                   Vb 
                   - 
                   
                     
                       1 
                       
                         1 
                         + 
                         
                           
                             
                               
                                 R 
                                  
                                 
                                     
                                 
                                  
                                 5 
                               
                               + 
                               
                                 R 
                                  
                                 
                                     
                                 
                                  
                                 6 
                               
                             
                             Ra 
                           
                           × 
                           
                             ( 
                             
                               1 
                               + 
                               
                                 Ra 
                                 
                                   R 
                                    
                                   
                                       
                                   
                                    
                                   7 
                                 
                               
                             
                             ) 
                           
                         
                       
                     
                     × 
                     
                       ( 
                       
                         VDD 
                         - 
                         VSS 
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   25 
                   ) 
                 
               
             
           
         
       
     
         [0055]    When the above expression is compared with Expression (16) determined in the first embodiment, a term (1+Ra/R 7 ) is added to the denominator. Specifically, adding the resistor R 7  reduces the value of (Va−Vb). As the resistance value of the resistor R 7  becomes smaller, (Va−Vb) becomes smaller, and the temperature compensation voltage ΔVr expressed by Expression (3) or Expression (4) becomes smaller. In other words, through setting the resistance value of the resistor R 7  to be an arbitrary value, (Va−Vb) can be arbitrarily adjusted, and thus, the temperature compensation voltage ΔVr expressed by Expression (3) or Expression (4) can be arbitrarily adjusted. On the other hand, no matter what resistance value the resistor R 7  has, the temperature compensation voltage ΔVr is zero at the temperature T 0 , and thus, the temperature compensation circuit according to this embodiment can solely and independently adjust the temperature compensation amount. Further, through setting the temperature coefficient of the resistance value of the resistor R 7  so as to be different from the temperature coefficient of the resistance value of the equivalent resistor Ra, (Va−Vb) can also be temperature dependent, and thus, the temperature compensation voltage ΔVr can be adjusted with more flexibility. 
         [0056]    Operation of the temperature compensation circuit according to the second embodiment of the present invention is described above. Through effectively utilizing the resistors having different temperature coefficients, a temperature compensation circuit that can adjust only the temperature coefficient and that can adjust the temperature compensation amount can be achieved with a relatively small circuit scale. 
       Third Embodiment 
       [0057]      FIG. 5  is a circuit diagram of a temperature compensation circuit according to a third embodiment of the present invention. The third embodiment is different from the first embodiment illustrated in  FIG. 1  in that a resistor R 8  is added. The added resistor R 8  is connected between the first output terminal Nr 1  and the second output terminal Nr 2 . A voltage Vr 1 ′ at the first output terminal Nr 1 , a voltage Vr 2 ′ at the second output terminal Nr 2 , and a temperature compensation voltage ΔVr′ in this embodiment are calculated as follows. When currents flowing through the resistors R 1  to R 4  and R 8  are represented by I 1  to I 14  and I 8 , respectively, the relationships of the respective currents are expressed by the following expressions. 
         [0000]    
       
         
           
             
               
                 
                   
                     I 
                      
                     
                         
                     
                      
                     1 
                   
                   = 
                   
                     
                       Va 
                       - 
                       
                         Vr 
                          
                         
                             
                         
                          
                         
                           1 
                           ′ 
                         
                       
                     
                     
                       R 
                        
                       
                           
                       
                        
                       1 
                     
                   
                 
               
               
                 
                   ( 
                   26 
                   ) 
                 
               
             
             
               
                 
                   
                     I 
                      
                     
                         
                     
                      
                     2 
                   
                   = 
                   
                     
                       
                         Vr 
                          
                         
                             
                         
                          
                         
                           1 
                           ′ 
                         
                       
                       - 
                       Vb 
                     
                     
                       R 
                        
                       
                           
                       
                        
                       2 
                     
                   
                 
               
               
                 
                   ( 
                   27 
                   ) 
                 
               
             
             
               
                 
                   
                     I 
                      
                     
                         
                     
                      
                     3 
                   
                   = 
                   
                     
                       
                         Vr 
                          
                         
                             
                         
                          
                         
                           2 
                           ′ 
                         
                       
                       - 
                       Vb 
                     
                     
                       R 
                        
                       
                           
                       
                        
                       3 
                     
                   
                 
               
               
                 
                   ( 
                   28 
                   ) 
                 
               
             
             
               
                 
                   
                     I 
                      
                     
                         
                     
                      
                     4 
                   
                   = 
                   
                     
                       Va 
                       - 
                       
                         Vr 
                          
                         
                             
                         
                          
                         
                           2 
                           ′ 
                         
                       
                     
                     
                       R 
                        
                       
                           
                       
                        
                       4 
                     
                   
                 
               
               
                 
                   ( 
                   29 
                   ) 
                 
               
             
             
               
                 
                   
                     I 
                      
                     
                         
                     
                      
                     8 
                   
                   = 
                   
                     
                       
                         Vr 
                          
                         
                             
                         
                          
                         
                           2 
                           ′ 
                         
                       
                       - 
                       
                         Vr 
                          
                         
                             
                         
                          
                         
                           1 
                           ′ 
                         
                       
                     
                     
                       R 
                        
                       
                           
                       
                        
                       8 
                     
                   
                 
               
               
                 
                   ( 
                   30 
                   ) 
                 
               
             
             
               
                 
                   
                     I 
                      
                     
                         
                     
                      
                     4 
                   
                   = 
                   
                     
                       I 
                        
                       
                           
                       
                        
                       3 
                     
                     + 
                     
                       I 
                        
                       
                           
                       
                        
                       8 
                     
                   
                 
               
               
                 
                   ( 
                   31 
                   ) 
                 
               
             
             
               
                 
                   
                     I 
                      
                     
                         
                     
                      
                     2 
                   
                   = 
                   
                     
                       I 
                        
                       
                           
                       
                        
                       1 
                     
                     + 
                     
                       I 
                        
                       
                           
                       
                        
                       8 
                     
                   
                 
               
               
                 
                   ( 
                   32 
                   ) 
                 
               
             
           
         
       
     
         [0058]    From Expression (26) to Expression (32), the temperature compensation voltage ΔVr′=Vr 1 ′−Vr 2 ′ is calculated as follows. 
         [0000]    
       
         
           
             
               
                 
                   
                     Δ 
                      
                     
                         
                     
                      
                     
                       Vr 
                       ′ 
                     
                   
                   - 
                   
                     
                       
                         
                           R 
                            
                           
                               
                           
                            
                           2 
                           × 
                           R 
                            
                           
                               
                           
                            
                           4 
                         
                         - 
                         
                           R 
                            
                           
                               
                           
                            
                           1 
                           × 
                           R 
                            
                           
                               
                           
                            
                           3 
                         
                       
                       
                         
                           ( 
                           
                             
                               R 
                                
                               
                                   
                               
                                
                               1 
                             
                             + 
                             
                               R 
                                
                               
                                   
                               
                                
                               2 
                             
                           
                           ) 
                         
                         × 
                         
                           ( 
                           
                             
                               R 
                                
                               
                                   
                               
                                
                               3 
                             
                             + 
                             
                               R 
                                
                               
                                   
                               
                                
                               4 
                             
                           
                           ) 
                         
                       
                     
                     × 
                     
                       ( 
                       
                         
                           
                             Va 
                           
                           
                             Vb 
                           
                         
                       
                       ) 
                     
                     × 
                     
                       1 
                       
                         1 
                         + 
                         
                           
                             1 
                             
                               R 
                                
                               
                                   
                               
                                
                               8 
                             
                           
                           × 
                           
                             ( 
                             
                               
                                 
                                   R 
                                    
                                   
                                       
                                   
                                    
                                   1 
                                   × 
                                   R 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                                 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     1 
                                   
                                   + 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     2 
                                   
                                 
                               
                               + 
                               
                                 
                                   R 
                                    
                                   
                                       
                                   
                                    
                                   3 
                                   × 
                                   R 
                                    
                                   
                                       
                                   
                                    
                                   4 
                                 
                                 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     3 
                                   
                                   + 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     4 
                                   
                                 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   33 
                   ) 
                 
               
             
           
         
       
     
         [0059]    The intermediate steps are omitted. The relationship between the temperature compensation voltage ΔVr′ according to this embodiment expressed by Expression (33) and the temperature compensation voltage ΔVr of the temperature compensation circuit according to the first embodiment expressed by Expression (3) is expressed by the following expression. 
         [0000]    
       
         
           
             
               
                 
                   
                     Δ 
                      
                     
                         
                     
                      
                     
                       Vr 
                       ′ 
                     
                   
                   = 
                   
                     Δ 
                      
                     
                         
                     
                      
                     Vr 
                     × 
                     
                       1 
                       
                         1 
                         + 
                         
                           
                             1 
                             
                               R 
                                
                               
                                   
                               
                                
                               8 
                             
                           
                           × 
                           
                             ( 
                             
                               
                                 
                                   R 
                                    
                                   
                                       
                                   
                                    
                                   1 
                                   × 
                                   R 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                                 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     1 
                                   
                                   + 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     2 
                                   
                                 
                               
                               - 
                               
                                 
                                   R 
                                    
                                   
                                       
                                   
                                    
                                   3 
                                   × 
                                   R 
                                    
                                   
                                       
                                   
                                    
                                   4 
                                 
                                 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     3 
                                   
                                   + 
                                   
                                     R 
                                      
                                     
                                         
                                     
                                      
                                     4 
                                   
                                 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   34 
                   ) 
                 
               
             
           
         
       
     
         [0060]    Specifically, addition of the resistor R 8  reduces the value of the temperature compensation voltage ΔVr′. In other words, through setting the resistance value of the resistor R 8 , the temperature compensation voltage ΔVr′ can be arbitrarily adjusted. On the other hand, no matter what resistance value the resistor R 8  has, the temperature compensation voltage ΔVr′ is zero at the temperature T 0 , and thus, the temperature compensation circuit according to this embodiment can solely and independently adjust the temperature compensation amount. Further, through setting the temperature coefficient of the resistance value of the resistor R 8  so as to be the same as the temperature coefficient of the resistance value of the at least one resistor of the resistors R 1  to R 4 , or so as to be the same as the temperature coefficient of the resistance value of a resistor other than the at least one resistor of the resistors R 1  to R 4 , and by the magnitude of the resistance value of the resistor R 8 , the temperature coefficient of the temperature compensation voltage ΔVr′ can be changed. Thus, the temperature compensation voltage ΔVr can be adjusted with more flexibility. 
         [0061]    Operation of the temperature compensation circuit according to the third embodiment of the present invention is described above. Through effectively using the resistors having different temperature coefficients, a temperature compensation circuit that can adjust only the temperature coefficient and that can adjust the temperature compensation amount can be achieved with a relatively small circuit scale. 
         [0000]    &lt;Application Example of Temperature Compensation Circuit according to the Present Invention&gt; 
         [0062]      FIG. 6  is a graph for showing temperature dependence of sensitivity of a sensor element. As an example, temperature dependence of sensitivity of a Hall element, which is an example of a magnetic sensor, is shown. The sensitivity of a Hall element is generally in proportion to the mobility, and thus, as the temperature becomes higher, the sensitivity becomes lower. When the sensitivity at the predetermined temperature T 0  is represented by k 0 , the sensitivity is lower than k 0  at a temperature higher than the predetermined temperature T 0 , and the sensitivity is higher than k 0  at a temperature lower than the predetermined temperature T 0 . Output of a sensor device having a sensor element mounted thereon is required not to change or to change only by a small amount when the temperature changes, and thus, a circuit configured to compensate for the temperature dependence of the sensor element is required for the sensor device. The temperature compensation circuit according to the present invention is suitable for such a case.  FIG. 7  and  FIG. 8  are illustrations of cases in which the temperature compensation circuit according to the present invention is applied to a sensor device. 
         [0063]      FIG. 7  is a circuit diagram of a case in which the temperature compensation circuit according to the present invention is applied to a magnetic sensor device. A signal from a Hall element  2  serving as a magneto-electric conversion element is input to a differential amplifier  4  via a switch circuit  3 . The differential amplifier  4  amplifies the input signal, and the amplified signal is input to a comparator  5  via capacitors C 1  and C 2 . The comparator  5  compares a difference between voltages respectively supplied to a terminal N 1  and a terminal N 2  and a difference between voltages respectively supplied to a terminal N 3  and a terminal N 4 , based on signals responsive to a density of an applied magnetic flux, that is, output of the Hall element  2 , and outputs whether the density of the applied magnetic flux is larger or smaller than a predetermined magnetic flux density. The switch circuit  3 , switches S 1  and S 2 , capacitors C 1  to C 4 , and a reference voltage ref° are used for the purpose of removing an error component of the Hall element  2 , the differential amplifier  4 , and the comparator  5  to obtain a highly accurate comparison result. As shown in  FIG. 6 , the sensitivity of the Hall element  2  is temperature dependent, and thus, when the difference between the voltages supplied to the terminal N 3  and the terminal N 4 , respectively, is constant when the temperature changes, the output of the comparator  5 , that is, the output of the magnetic sensor device is an output that is not constant when the temperature changes, and is temperature dependent. For the purpose of compensating for the temperature dependence of the Hall element  2 , the first output terminal Nr 1  and the second output terminal Nr 2  of the temperature compensation circuit  1  according to the present invention are connected to the terminal N 3  and the terminal N 4  via switches S 3 , S 3   x,  S 4 , and S 4   x  to supply the temperature compensation voltage ΔVr or ΔVr′, thereby enabling obtainment of output of the magnetic sensor device without temperature dependence. 
         [0064]      FIG. 8  is a circuit diagram of another case in which the temperature compensation circuit according to the present invention is applied to a magnetic sensor device. The magnetic sensor device of  FIG. 8  is different from the magnetic sensor device illustrated in  FIG. 7  in that a reference voltage circuit  6  and switches S 5 , S 5   x,  S 6 , and S 6   x  are added. An output terminal Nr 3  and an output terminal Nr 4  of the reference voltage circuit  6  are connected to the terminal N 3  and the terminal N 4  via the switches S 5 , S 5   x,  S 6 , and S 6   x  to supply a reference voltage ΔVref without temperature dependence. Therefore, the compensation amount at the predetermined temperature T 0  can be supplied by the reference voltage circuit  6  and the temperature compensation amount can be supplied by the temperature compensation circuit  1 . In other words, output of the magnetic sensor device without temperature dependence can be obtained, and at the same time, a threshold level for determining whether the density of the applied magnetic flux is larger or smaller than a predetermined magnetic flux density can be adjusted. 
         [0065]      FIG. 9  is a circuit diagram for illustrating an example of the reference voltage circuit  6  illustrated in  FIG. 8 . The reference voltage circuit  6  includes resistors Rx 1  to Rx 3  that are connected in series between the power supply terminal VDD and the ground terminal VSS. The output terminal Nr 3  is connected to a node between the resistors Rx 1  and Rx 2 . The output terminal Nr 4  is connected to a node between the resistors Rx 2  and Rx 3 . 
         [0066]    When voltages at the output terminal Nr 3  and the output terminal Nr 4  are represented by Vr 3  and Vr 4 , respectively, and the reference voltage ΔVref=Vr 3 −Vr 4 , the following expression is obtained. 
         [0000]    
       
         
           
             
               
                 
                   
                     Δ 
                      
                     
                         
                     
                      
                     Vref 
                   
                   = 
                   
                     
                       
                         R 
                         × 
                         2 
                       
                       
                         
                           R 
                           × 
                           1 
                         
                         + 
                         
                           R 
                           × 
                           2 
                         
                         + 
                         
                           R 
                           × 
                           3 
                         
                       
                     
                     × 
                     
                       ( 
                       
                         VDD 
                         - 
                         VSS 
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   35 
                   ) 
                 
               
             
           
         
       
     
         [0067]    When the resistors Rx 1  to Rx 3  are resistors having the same temperature coefficient, the reference voltage ΔVref is a voltage without temperature dependence. Further, through adjusting the ratio of the resistance values among the resistors Rx 1  to Rx 3 , ΔVref can be arbitrarily adjusted. 
         [0068]      FIG. 7  to  FIG. 9  are illustrations of the cases in which the temperature compensation circuit according to the present invention is applied to a magnetic sensor device. For the sake of description, specific cases are described herein, but the present invention is not necessarily limited to the configurations and the sensor element described herein, and is applicable to a wide range of semiconductor circuits.