Abstract:
A voltage measuring device includes at least two voltage dividing circuits, an analog to digital converter, and a processor. Each voltage dividing circuit is configured for dividing a voltage output by a direct current power supply. The analog to digital converter is configured for converting the divided voltage to a digital signal. The processor is configured for processing the digital signal and selecting one of the at least two voltage dividing circuits, to divide the voltage according to the processed digital signal.

Description:
BACKGROUND OF THE INVENTION 
       [0001]    1. Field of the Invention 
         [0002]    The present invention relates to a voltage measuring device, and particularly to a voltage measuring device for measuring the value of a voltage output by a direct current (DC) power supply. 
         [0003]    2. Description of related art 
         [0004]    DC power supplies provide DC voltages for electronic devices such as integrated circuits. When a DC voltage output to an integrated circuit fails to meet the requirement of the integrated circuit, the performance of the integrated circuit can suffer. Therefore, a voltage measuring device is needed to measure the value of the DC voltage. 
         [0005]    Referring to  FIG. 3 , a conventional voltage measuring device includes a voltage dividing circuit  200 , an analog to digital converter (ADC)  300 , a voltage reference  400 , and a processor  500 . The voltage dividing circuit  200  converts a DC voltage  100  under test to a smaller voltage. The ADC  300  converts the smaller voltage to a binary digital signal. The processor  500  converts the binary digital signal to a decimal signal. A display unit (not shown) displays the decimal signal and reflects the value of the DC voltage  100 . However, the conventional voltage measuring device provides fixed precision in identifying the value of the DC voltage. A smaller DC voltage often needs to be measured with greater precision than a larger DC voltage. 
         [0006]    What is needed, therefore, is a voltage measuring device with adjustable precision in identifying a value of a voltage based on the value of the voltage. 
       SUMMARY OF THE INVENTION 
       [0007]    A voltage measuring device with adjustable precision settings for identifying a value of a voltage based on the value of the voltage is provided. In a preferred embodiment, the voltage measuring device includes a voltage adjusting circuit for reducing a voltage output by a direct current power supply, an analog to digital converter, and a processor. The voltage adjusting circuit includes two electronic switches and a first resistor, the electronic switches having first poles connected to a first terminal of the first resistor respectively via a second resistor and a third resistor, and second poles connected to ground, a second terminal of the first resistor being connected to the direct current power supply. The analog to digital converter is connected to the first terminal of the first resistor, for converting reduced voltages to digital signals. The processor is connected to the analog to digital converter and a third pole of each electronic switch, the processor capable of processing the digital signals, and selecting one of the two electronic switches to turn on based on the initial one of the processed digital signals such that the voltage adjusting circuit is capable of outputting a rerouted reduced voltage to the analog to digital converter which outputs a rerouted digital signal to the processor for further processing. 
         [0008]    Other advantages and novel features will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings, in which: 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0009]      FIG. 1  is a block diagram of a voltage measuring device in accordance with a preferred embodiment of the present invention; 
           [0010]      FIG. 2  is a circuit diagram of a direct current power supply, a voltage adjusting circuit, and a protecting circuit of the voltage measuring device of  FIG. 1 ; and 
           [0011]      FIG. 3  is a schematic diagram of a conventional voltage measuring device. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0012]    Referring to  FIG. 1 , a voltage measuring device in accordance with an embodiment of the present invention includes a voltage adjusting circuit  20 , a protecting circuit  30 , a 10-bit analog to digital converter (ADC)  40 , a voltage reference  50 , and a processor  60 . A direct current (DC) power supply  10  outputs an under test voltage Vt to the voltage adjusting circuit  20 . 
         [0013]    Referring also to  FIG. 2 , the voltage adjusting circuit  20  includes MOSFETs Q 1 , Q 2 , Q 3 , Q 4 , and resistors R 1 , R 2 , R 3 , R 4 , R 5 . The MOSFETs Q 1 , Q 2 , Q 3 , Q 4  have first poles, namely the drains, connected to a first terminal N 1  of the resistor R 1  respectively via the resistors R 2 , R 3 , R 4 , R 5 , and second poles, namely the sources, connected to ground. A second terminal N 2  of the resistor R 1  is connected to the DC power supply  10 . 
         [0014]    The protecting circuit  30  includes an amplifier A 1 . The amplifier A 1  has a non-inverting input connected to the first terminal N 1  of the resistor R 1 , an output connected to the ADC  40 , and an inverting input connected to the output of the amplifier A 1 . The voltage reference  50  provides a working voltage for the amplifier A 1  and the ADC  40 . When a voltage VI input to the non-inverting input is equal to or less than the voltage reference  50 , a voltage V 2  output by the amplifier A 1  equals the voltage V 1 . When the voltage V 1  is more than the voltage reference  50 , the voltage V 2  output by the amplifier A 1  equals the voltage reference  50 . Therefore, the voltage V 2  received by the ADC  40  is not more than the working voltage of the ADC 40 . The ADC  40  is thus protected. The processor  60  includes an I 2 C port connected to an output of the ADC  40 , and input/output ports GPIO 1 , GPIO 2 , GPIO 3 , GPIO 4  respectively connected to third poles, namely the gates of the MOSFETs Q 1 , Q 2 , Q 3 , Q 4 . 
         [0015]    The voltage Vt output by the DC power supply  10  is within a range of 0 to 60 volts. The voltage reference  50  is 4.096 volts, and the voltage at the first terminal N 1  remains fixed at 4.096 volts as well if the following conditions are met. When the voltage Vt is 60 volts, the MOSFET Q 1  is turned on, and the MOSFETs Q 2 , Q 3 , Q 4  are turned off, the first terminal N 1  of the resistor R 1  has a voltage of 4.096 volts because of the resistance of the resistors R 1 , R 2  satisfying the following formula: R 2 /(R 1 +R 2 )=4.096/60. When the voltage Vt is 45 volts, the MOSFET Q 2  is turned on, and the MOSFETs Q 1 , Q 3 , Q 4  are turned off, the first terminal N 1  still has a voltage of 4.096 volts because of the resistance of the resistors R 1 , R 3  satisfying the following formula: R 3 /(R 1 +R 3 )=4.096/45. When the voltage Vt is 30 volts, the MOSFET Q 3  is turned on, and the MOSFETs Q 1 , Q 2 , Q 4  are turned off, the first terminal N 1  still has a voltage of 4.096 volts because of the resistance of the resistors R 1 , R 4  satisfying the following formula: R 4 /(R 1 +R 4 )=4.096/30. When the voltage Vt is 15 volts, the MOSFET Q 4  is turned on, and the MOSFETs Q 1 , Q 2 , Q 3  are turned off, the first terminal N 1  still has a voltage of 4.096 volts because of the resistance of the resistors R 1 , R 5  satisfying the following formula: R 5 /(R 1 +R 5 )=4.096/15. 
         [0016]    Initially, the input/output port GPIO 1  provides a high level signal for the MOSFET Q 1 , and the input/output ports GPIO 2 , GPIO 3 , GPIO 4  provide low level signals for the MOSFETs Q 2 , Q 3 , Q 4 . The MOSFET Q 1  is turned on. The MOSFETs Q 2 , Q 3 , Q 4  is turned off. For example, if the DC power supply  10  outputs the voltage Vt at about 23.3 volts, the voltage Vt is divided by a first voltage dividing circuit made up of the resistors R 1 , R 2 . The initial divided voltage is delivered by the protecting circuit  30 , and converted to an initial digital signal by the ADC  40 . The processor  60  processes the initial digital signal, and determines the voltage Vt is within a range of 15 to 30 volts. Then the input/output port GPIO 3  provides a high level signal for the MOSFET Q 3 , and the input/output ports GPIO 1 , GPIO 2 , GPIO 4  provide low level signals for the MOSFETs Q 1 , Q 2 , Q 4 . The MOSFET Q 3  is turned on. The MOSFETs Q 1 , Q 2 , Q 4  are turned off. The voltage Vt is divided by a second voltage dividing circuit made up of the resistors R 1 , R 4 . A rerouted divided voltage is delivered by the protecting circuit  30 , and then converted to a rerouted digital signal by the ADC  40 . The processor  60  converts the rerouted digital signal (binary signal) to a decimal signal. A display unit (not shown) displays the decimal signal and reflects the value of the voltage Vt. 
         [0017]    If the voltage Vt is measured according to the first digital signal, the precision in identifying the value of the voltage Vt is found using the following expression:60/2 10 . If the voltage Vt is measured according to the second digital signal, the precision in identifying the value of the voltage Vt is thus found using the follow expression: 30/2 10 . Therefore, greater precision in identifying the value of the voltage Vt is selected by the processor  60  based on the value of the voltage Vt. Different ranges of voltages corresponding to desired precision can be programmed into the processor as required. 
         [0018]    Likewise, when the voltage output by the DC power supply  10  is within a range of 30-45 volts, a third voltage dividing circuit made up of the resistors R 1 , R 3  can be selected to reach an precision of 45/2 10 . When the voltage output by the DC power supply  10  is within a range of 0-15 volts, a fourth voltage dividing circuit made up of the resistors R 1 , R 5  can be selected to reach an precision of 15/2 10 . 
         [0019]    The MOSFETs can be other electronic switches, e.g. bipolar junction transistors (BJTs). A collector, an emitter, and a base of a BJT respectively serve as the first, second, and the third poles. 
         [0020]    The embodiments were chosen and described in order to explain the principles of the invention and their practical application so as to enable others skilled in the art to utilize the invention and various embodiments and with various modifications as are suited to the particular use contemplated. Alternative embodiments will become apparent to those skilled in the art to which the present invention pertains without departing from its spirit and scope. Accordingly, the scope of the present invention is defined by the appended claims rather than the foregoing description and the exemplary embodiments described therein.