JPS62109114A - Voltage regulator - Google Patents

Voltage regulator

Info

Publication number
JPS62109114A
JPS62109114A JP25012985A JP25012985A JPS62109114A JP S62109114 A JPS62109114 A JP S62109114A JP 25012985 A JP25012985 A JP 25012985A JP 25012985 A JP25012985 A JP 25012985A JP S62109114 A JPS62109114 A JP S62109114A
Authority
JP
Japan
Prior art keywords
voltage
control transistor
transistor
level
input
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP25012985A
Other languages
Japanese (ja)
Inventor
Akira Nakamura
晃 中村
Yasuhei Odajima
小田嶋 廉平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Instruments Inc
Original Assignee
Seiko Instruments Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Instruments Inc filed Critical Seiko Instruments Inc
Priority to JP25012985A priority Critical patent/JPS62109114A/en
Publication of JPS62109114A publication Critical patent/JPS62109114A/en
Pending legal-status Critical Current

Links

Landscapes

  • Continuous-Control Power Sources That Use Transistors (AREA)

Abstract

PURPOSE:To protect a control transistor from its breakage due to the discharging current by using a switching circuit that switches the substrate potential of the control transistor so that it is equal to the higher one of both levels of an input voltage source and the output voltage. CONSTITUTION:When Vin<Vout is satisfied between the input voltage and the output voltage, a transistor TR 53 is turned on and therefore the gate voltage of a TR 54 is approximately equal to the level of the Vout. Then the TR 54 is turned off. While the gate voltage is less than the source voltage with a TR 61 and therefore the TR 61 is turned on. Thus the substrate potential of a control TR 42 is approximately equal to the voltage Vout and therefore the P-N junction consisting of a P<+> area 23 and N<+> area 25 is adversely biased. Thus no current flows to the P-N junction part even in case a capacitor, etc. are connected between terminals 11 and 9. This prevents the breakage of the TR 42.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はC−MOSプロセスにより構成さ扛たボルテー
ジ・レギュレータに関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a voltage regulator constructed using a C-MOS process.

(発明の概要〕 本発明は、出力電圧レベルを所定の基準電圧レベルと比
較し、その比較結果に応じて制御用トランジスタの導通
度を制御するように構成さnたC−MO87’ロセスに
よるボルテージ・レギュレータにおいて、0−M2O)
ランジスタとして構成される制御用トランジスタの基板
電位全、入力電圧又は出力電圧のうちのいずれか旨い方
の電位に固定し、これにより、入力電圧が出力電圧より
も低レベルとなった場合に、制御用トランジスタ内にお
いて入力端子から出力端子に向けて電流が流れるのを防
止するようにしたものである。
(Summary of the Invention) The present invention provides a voltage control system using a C-MO87' process configured to compare an output voltage level with a predetermined reference voltage level and control the conductivity of a control transistor according to the comparison result.・In the regulator, 0-M2O)
The total substrate potential of the control transistor configured as a transistor is fixed at the better potential of the input voltage or output voltage, so that when the input voltage becomes lower than the output voltage, the control This prevents current from flowing from the input terminal to the output terminal within the transistor.

C従来の技術〉 種々の電子機器において安定化された電圧の供給が望ま
れる場合が多々あり、このような場合には、バッテリ醇
の電圧をボルテージ・レギュレータを介して所要の回路
に供給するのが一般酌である。
C. Prior Art There are many cases where it is desired to supply a stabilized voltage to various electronic devices, and in such cases, it is necessary to supply the battery voltage to the required circuits via a voltage regulator. is the general cup.

このような自重で使用される従来のC−MO8ボルテー
ジ・レギュレータの回路図が第1図に示されている。こ
のボルテージ・レギュレータ1は、電流源2とインピー
ダンス3とから成る基準電圧源4、該基準電圧源4から
の基準電圧V、が一方の入力に印加さnている差動増幅
器5、及び該差動増幅器5の出力がゲート(G)に入力
されている制御トランジスタ6を有し、制御トランジス
タ6のドレイン(D)は、抵抗器7,8を介してアース
されている。ここで、9はアース端子、10は入力電圧
を印加するための入力端子、11は安定化された電圧が
出力される出力端子である。制御用トランジスタ6のソ
ース(S)はその基板電位を等しくされると共に入力端
子10に接続されており、抵抗器8に生じる電圧が検出
電圧Vdとして差動増幅器5の他方の入力に印加される
構成となっている。
A circuit diagram of a conventional C-MO8 voltage regulator used under such dead weight conditions is shown in FIG. This voltage regulator 1 includes a reference voltage source 4 consisting of a current source 2 and an impedance 3, a differential amplifier 5 to which a reference voltage V from the reference voltage source 4 is applied to one input, and The control transistor 6 has a gate (G) to which the output of the dynamic amplifier 5 is input, and a drain (D) of the control transistor 6 is grounded via resistors 7 and 8. Here, 9 is a ground terminal, 10 is an input terminal for applying an input voltage, and 11 is an output terminal from which a stabilized voltage is output. The source (S) of the control transistor 6 has its substrate potential equalized and is connected to the input terminal 10, and the voltage generated across the resistor 8 is applied to the other input of the differential amplifier 5 as the detection voltage Vd. The structure is as follows.

この構成によると、端子11−9間の出力電圧が所定の
堰よりずれると、このずれが差動増幅器5により検出さ
れ、制御用トランジスタ6のソース。ドレイン間の抵抗
が差動増幅器5の検出結果により調節さnlその呂カー
圧のレベルが一定に保持されることにiる。
According to this configuration, when the output voltage between the terminals 11-9 deviates from a predetermined level, this deviation is detected by the differential amplifier 5 and the source of the control transistor 6 is detected. The resistance between the drains is adjusted according to the detection result of the differential amplifier 5, so that the level of the filter pressure is kept constant.

(発明が解決しようとする問題点) ところで、このボルテージ・レギュレータ1の回路は全
てC!−MOSプロセスにより一板の牛導体基板上に形
成されており、その制御トランジスタ6の構造は、第2
図に示されるようになっている。第2図に示される制御
トランジスタの構造を説明すると、サブストレート21
内に形成さnたNウェルn内に、ドレイン領域として働
くP十領域nと、ソース領域として働く別のア+領域冴
と、このア+領域ムに接するように形成されたN十領域
5とが形成されており、r十領域nは電極26によって
外部と接続され、P+領域調及びN十領域δは共通の電
極nにより同電位とさnると共にこの電極nによって外
部と接続することができるようになっている。符号列で
示さfbるCはゲート電極であり、絶縁層29を介して
両P十領域n、24の間のチャンネル領域(至)に対向
している。
(Problem to be solved by the invention) By the way, the circuit of this voltage regulator 1 is all C! - It is formed on a single conductor substrate by a MOS process, and the structure of the control transistor 6 is similar to that of the second
As shown in the figure. To explain the structure of the control transistor shown in FIG. 2, the substrate 21
In the N well n formed within the N well, there is a P region n which acts as a drain region, another A+ region n which serves as a source region, and an N region 5 formed so as to be in contact with this A+ region n. are formed, and the r region n is connected to the outside by an electrode 26, and the P+ region and the N region δ are at the same potential by a common electrode n, and are connected to the outside by this electrode n. is now possible. C, indicated by the code string fb, is a gate electrode, which faces the channel region (to) between the two P regions n, 24 with the insulating layer 29 interposed therebetween.

従って、入力端子10に接続される電極nの電位が出力
端子11に接続される電極26の電位より高い場合には
何ら問題は生じない、しかし、例えば、入力変動酸るい
は負荷変動等に対する過渡特性を改善する目的で出力端
子11とアース端子9との間に大容量のコンデンサを挿
入することがしばしば行なわれるが、このような構成を
用いた場合において何等かの理由で入力電圧が出力電圧
より低いレベルとなると、このコンデンサに充電された
電荷は、第2図に示すが領域乙とN十領域5とによって
形成されるPN接合を介して放電され、このとき、この
PN接合部に大レベルの順方向を流が流れることになる
。この結果、素子の許容損失レベルを越えた電流が流れ
ることも考えられ、制御トランジスタ6が破壊される虞
れがあった。
Therefore, if the potential of the electrode n connected to the input terminal 10 is higher than the potential of the electrode 26 connected to the output terminal 11, no problem will occur. A large capacity capacitor is often inserted between the output terminal 11 and the ground terminal 9 for the purpose of improving characteristics, but when such a configuration is used, for some reason the input voltage may be lower than the output voltage. At a lower level, the charge stored in this capacitor is discharged through the PN junction formed by region B and N0 region 5, as shown in FIG. The current will flow in the forward direction of the level. As a result, a current exceeding the allowable loss level of the element may flow, and there is a risk that the control transistor 6 may be destroyed.

本発明の目的は、従って、従来技術における上述の欠点
を除去するため、入力電圧が出力電圧より低下しても制
御トランジスタに電流が逆流することがないようにし制
御トランジスタの保護を図ることができるようにした、
ボルテージ。レギュレータを提供することにある。
Therefore, an object of the present invention is to eliminate the above-mentioned drawbacks in the prior art, and to protect the control transistor by preventing current from flowing back into the control transistor even if the input voltage drops below the output voltage. I did it like this,
voltage. The purpose is to provide regulators.

C問題点を解決するための手段〕 上記従来技術の問題点を解決するための本発明の構成は
、抵抗回路を介して入力電圧源に接続された制御用トラ
ンジスタと、該抵抗回路に生じる電圧と所定の基準気圧
とを比較しその比較結果に従って上記制御用トランジス
タの導通度を制御する回路とを含み、上記抵抗回路から
安定化出力電圧を得るよう(、−MOSプロセスにより
構成されたボルテージ。レギュレータにおいて、上記制
御トランジスタの基板電位が、上記入力電圧源のレベル
と上記出力電圧のレベルのうち、いずれか高い方のレベ
ルと同電位となるように切換え可能となっている点に特
徴を有する。
Means for Solving Problem C] The configuration of the present invention for solving the above-mentioned problems of the prior art includes a control transistor connected to an input voltage source via a resistance circuit, and a voltage generated in the resistance circuit. and a circuit that compares the voltage with a predetermined reference atmospheric pressure and controls the degree of conductivity of the control transistor according to the comparison result, and obtains a stabilized output voltage from the resistor circuit. The regulator is characterized in that the substrate potential of the control transistor can be switched to the same potential as the higher of the level of the input voltage source and the level of the output voltage. .

(作用〕 この構成によると、入力電圧源のレベルと出力電圧のレ
ベルとの間の高低に応じて、制御トランジスタの基板の
電位がいずれか高い方のレベルと同電位とされる。従っ
て、若し入力電圧のレベルが出力電圧のレベルより低く
なった場合、制御トランジスタの基板の電位は出力電圧
のレベルと同電位となるため、出力電圧端子とアースと
の間に大容量のコンデンサが挿入されていていても、出
力端子から入力端子に向けてコンデンサの放電々流が沢
れることはなく、制御トランジスタを放電々流による波
浪から護ることができる。
(Function) According to this configuration, the potential of the substrate of the control transistor is set to the same potential as the higher level depending on the level between the input voltage source level and the output voltage level. However, if the input voltage level becomes lower than the output voltage level, the potential of the control transistor's substrate becomes the same potential as the output voltage level, so a large capacitor is inserted between the output voltage terminal and ground. Even if the capacitor is open, the discharge current of the capacitor will not flow from the output terminal to the input terminal, and the control transistor can be protected from waves caused by the discharge current.

〔実施例〕〔Example〕

第3図には、本発明によるボルテージ・レギュレータの
一実旅例の回路図が示されている。本発明によるボルテ
ージ・レギュレータ41において、第1図に示さnるボ
ルテージ・レギュレータ1と同一の部分については同一
の符号を付し、その説明を省略する。
FIG. 3 shows a circuit diagram of an exemplary voltage regulator according to the present invention. In the voltage regulator 41 according to the present invention, the same parts as those in the voltage regulator 1 shown in FIG.

第1図に示されている制御トランジスタ6と同様に、ボ
ルテージ・レギュレータ41において用いられている制
御、トランジスタ42も、端子9−10間に印加される
入力電圧を抵抗器7,8から成る抵抗回路を介して受は
取っており、そのゲートには差動増幅器5を含んで成る
誤差検出回路44からの制御電圧V、が印加されている
。しかし、この制御トランジスタ42においては、その
基板は、ドレイン、ソースのいずれKも接続されない構
成となっている。
Similar to the control transistor 6 shown in FIG. A control voltage V from an error detection circuit 44 including a differential amplifier 5 is applied to the gate thereof. However, in this control transistor 42, the substrate has a structure in which neither the drain nor the source K is connected.

入力端子10の電圧レベルと出力端子11の電圧レベル
との大小関係に従って制御トランジスタ420基板(図
示せず〕の電位を入力端子10又は出力端子11のいず
れか一方の電位と同一にするため、制御トランジスタ4
2の出力側には、第1スイッチ回路51と第2スイッチ
回路61とが設けら扛ている。
Control is performed to make the potential of the control transistor 420 substrate (not shown) the same as the potential of either the input terminal 10 or the output terminal 11 according to the magnitude relationship between the voltage level of the input terminal 10 and the voltage level of the output terminal 11. transistor 4
A first switch circuit 51 and a second switch circuit 61 are provided on the output side of the switch 2.

第1スイッチ回路51は、ゲートが入力端子10に接続
され、そのソース、ドレイン回路が電泥源52を介して
出力端子11とアース端子9との間に接続されているト
ランジスタ58と、トランジスタ58のドレインにゲー
トが接続されているトランジスタ54とから成り、トラ
ンジスタ54のソースは入力端子10に接続されそのド
レインは制御トランジスタ42の基板に接続されている
The first switch circuit 51 includes a transistor 58 whose gate is connected to the input terminal 10 and whose source and drain circuits are connected between the output terminal 11 and the ground terminal 9 via the electrolyte source 52; The transistor 54 has a source connected to the input terminal 10 and a drain connected to the substrate of the control transistor 42.

一方、第2スイッチ回路61は、ゲートが入力端子10
に接続されているトランジスタ62から成す、トランジ
スタ62のソースは出力端子11に接続され、そのドレ
インは制御トランジスタ420基板に接続されている。
On the other hand, the second switch circuit 61 has a gate connected to the input terminal 10.
The source of the transistor 62 is connected to the output terminal 11 and the drain thereof is connected to the control transistor 420 substrate.

次に、この第1及び第2スイツナ回路51,61の作動
について説明する。
Next, the operation of the first and second sweetener circuits 51 and 61 will be explained.

入力端子10の入力電圧V inの値が出力端子11の
出力電圧V outより大きい場合には、トランジスタ
53はオフとなり、従ってトランジスタ54のゲート電
圧はほぼアースレベルとなるので、トランジスタ54は
オンとなる。一方、トランジスタ61のゲート電圧はそ
のソース電圧より旨いので、トランジスタ61はオフと
なる。この結果、制御トランジスタ42の基板の電位は
、入力電圧Vinと略同電位となる。これは第1図に示
した状態と同じでちり、従って、制御トランジスタ42
の破↓hの問題は何ら生じない。
When the value of the input voltage V in at the input terminal 10 is greater than the output voltage V out at the output terminal 11, the transistor 53 is turned off, and the gate voltage of the transistor 54 is approximately at the ground level, so the transistor 54 is turned on. Become. On the other hand, since the gate voltage of transistor 61 is higher than its source voltage, transistor 61 is turned off. As a result, the potential of the substrate of the control transistor 42 becomes approximately the same potential as the input voltage Vin. This is the same state as shown in FIG.
The problem of breaking ↓h does not occur at all.

V in (V owt  となると、トランジスタ5
8がオンとなるので、トランジスタ54のゲート電圧が
略出力電圧V olLtのレベルと等しくなり、トラン
ジスタ54がオフとなる。一方、トランジスタ61のゲ
ート電圧はそのソース電圧より低くなるので、トランジ
スタ61はオンとなる。この結果、制御トランジスタ4
2の基板の電位は、入力電圧V inより高いレベルの
出力電圧V owtと略同−のi2!iとなるので、第
2図に示すP十領域田とN+領域5とによって構成さ扛
るI’N接合は逆バイアス状態となり、端子11−9間
にコンデンサ等を接続しても、上述の1’N接合部には
電流が流れず、制御トランジスタ42の破壊を生じるこ
とはない。
When V in (V owt ), the transistor 5
8 is turned on, the gate voltage of the transistor 54 becomes approximately equal to the level of the output voltage V olLt, and the transistor 54 is turned off. On the other hand, since the gate voltage of transistor 61 is lower than its source voltage, transistor 61 is turned on. As a result, control transistor 4
The potential of the substrate No. 2 is i2! which is approximately the same as the output voltage V owt which is at a higher level than the input voltage V in ! Therefore, the I'N junction formed by the P region field and the N+ region 5 shown in FIG. No current flows through the 1'N junction, and the control transistor 42 will not be destroyed.

このように、制御トランジスタ42の基板電位は、入力
電圧V inと出力電圧V owtのレベルの大小に応
じて、 V in 、 V outのうちのより高い電
位と実質的に同一となるように切換えられるので、とn
により、制御トランジスタ42内に大きな順方向電流が
流れるのを有効に防止することができる。
In this way, the substrate potential of the control transistor 42 is switched to be substantially the same as the higher potential of V in and V out, depending on the level of the input voltage V in and the output voltage V out. Because it will be done, and n
Therefore, it is possible to effectively prevent a large forward current from flowing in the control transistor 42.

従って、従来のように、入出力電圧のレベルの逆転が生
じても、負荷コンデンサから制御トランジスタ42内に
電流が流入することはない。
Therefore, as in the conventional case, no current flows into the control transistor 42 from the load capacitor even if the levels of the input and output voltages are reversed.

尚、第1及び第2スイツチ回路51.61の構成は一実
施例であり、本願発明の構成はこの実施例に限定される
ことなく、例えば、他の導電型のトランジスタを用いて
同様のスイッチ回j!27を構成してもよいし、制御ト
ランジスタ42の基板の電位の切換を他の公知の手段に
より行なう構成とすることもできる。
Note that the configuration of the first and second switch circuits 51 and 61 is one example, and the configuration of the present invention is not limited to this example. For example, similar switches may be constructed using transistors of other conductivity types. Times! 27, or may be configured such that the potential of the substrate of the control transistor 42 is switched by other known means.

〔効果〕〔effect〕

本発明によれば、上述の如く、入出力電圧レベルの逆転
が生じても、負荷側から制御トランジスタに電流が逆流
することを防止し、制御トランジスタの破損を有効に防
止することができる優れた効果を奏する。
According to the present invention, as described above, even if the input/output voltage levels are reversed, current can be prevented from flowing backward from the load side to the control transistor, and damage to the control transistor can be effectively prevented. be effective.

【図面の簡単な説明】[Brief explanation of drawings]

第1図は従来のO+ Z(OSプロセスによるボルテー
ジ・レギュレータの回路図。 第2図は第1図に示す制御トランジスタの構造を示す断
面図。 第3図は0−M0E?プロセスによる本発明のポルデー
ジ、レギュレータの回路図。 41Cボルテージ・レギュレータ4 2 、 、 %i制御トランジスタ4 4C誤差検出回路 51C第1スイッチ回路 61、。第2スイッチ回路 以上
Fig. 1 is a circuit diagram of a voltage regulator using the conventional O+Z (OS process). Fig. 2 is a cross-sectional view showing the structure of the control transistor shown in Fig. 1. Fig. 3 is a circuit diagram of a voltage regulator according to the conventional O+Z (OS process). Circuit diagram of Poldage regulator. 41C voltage regulator 4 2 , %i control transistor 4 4C error detection circuit 51C first switch circuit 61 , second switch circuit and above

Claims (1)

【特許請求の範囲】[Claims] (1)、抵抗回路を介して入力電圧源に接続された制御
用トランジスタと、該抵抗回路に生じる電圧と所定の基
準電圧とを比較しその比較結果に従つて前記制御用トラ
ンジスタの導通度を制御する回路とを含み、前記抵抗回
路から安定化出力電圧を得るようC−MOSプロセスに
より構成されたボルテージ・レギュレータにおいて、前
記制御トランジスタの基板電位が、前記入力電圧源のレ
ベルと前記出力電圧のレベルのうち、いずれか高い方の
レベルと同電圧となるように切換え可能となつているこ
とを特徴とするボルテージ・レギュレータ。
(1) A control transistor connected to an input voltage source via a resistor circuit, and the voltage generated in the resistor circuit is compared with a predetermined reference voltage, and the conductivity of the control transistor is determined according to the comparison result. In the voltage regulator, the substrate potential of the control transistor is equal to the level of the input voltage source and the output voltage. A voltage regulator characterized in that it can be switched to have the same voltage as the higher of the levels.
JP25012985A 1985-11-08 1985-11-08 Voltage regulator Pending JPS62109114A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP25012985A JPS62109114A (en) 1985-11-08 1985-11-08 Voltage regulator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25012985A JPS62109114A (en) 1985-11-08 1985-11-08 Voltage regulator

Publications (1)

Publication Number Publication Date
JPS62109114A true JPS62109114A (en) 1987-05-20

Family

ID=17203256

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25012985A Pending JPS62109114A (en) 1985-11-08 1985-11-08 Voltage regulator

Country Status (1)

Country Link
JP (1) JPS62109114A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01302409A (en) * 1988-05-30 1989-12-06 Nec Ic Microcomput Syst Ltd Power source circuit
JPH04162111A (en) * 1990-10-25 1992-06-05 Nec Kansai Ltd Dc power circuit
JP2008077683A (en) * 2007-11-27 2008-04-03 Ricoh Co Ltd Reverse overcurrent preventing circuit
US9703307B2 (en) 2015-01-29 2017-07-11 Socionext Inc. Voltage dropping circuit and integrated circuit

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01302409A (en) * 1988-05-30 1989-12-06 Nec Ic Microcomput Syst Ltd Power source circuit
JPH04162111A (en) * 1990-10-25 1992-06-05 Nec Kansai Ltd Dc power circuit
JP2008077683A (en) * 2007-11-27 2008-04-03 Ricoh Co Ltd Reverse overcurrent preventing circuit
JP4671364B2 (en) * 2007-11-27 2011-04-13 株式会社リコー Reverse overcurrent protection circuit
US9703307B2 (en) 2015-01-29 2017-07-11 Socionext Inc. Voltage dropping circuit and integrated circuit

Similar Documents

Publication Publication Date Title
KR0128731B1 (en) Differential amplififr and current sensing circuit and
US4295176A (en) Semiconductor integrated circuit protection arrangement
US4670706A (en) Constant voltage generating circuit
US20030117116A1 (en) Semiconductor integrated circuit device
US5801573A (en) Protected switch having a power semiconductor device
JP2007507893A (en) Power switch structure and method
JPH10163423A (en) Static electricity protecting circuit
JPH0214792B2 (en)
US5754074A (en) Protected switch
US4791317A (en) Latch-up protection circuit for integrated circuits using complementary mos circuit technology
US3992650A (en) Apparatus to prevent overcurrent or overvoltage
US5530394A (en) CMOS circuit with increased breakdown strength
US4581551A (en) Input/output circuit for use with various voltages
US4578694A (en) Inverter circuit provided with gate protection
JPS62109114A (en) Voltage regulator
JP3311498B2 (en) Semiconductor device
US5712859A (en) Semiconductor integrated circuit
US4042843A (en) Voltage level adaption in MOSFET chips
US5493572A (en) Semiconductor integrated circuit with voltage limiter having different output ranges for normal operation and performing of aging tests
JPH02147828A (en) Temperature detection circuit
JPH0774976B2 (en) Voltage control circuit
JPH05312851A (en) Comparator circuit
JP3554353B2 (en) Protection device for field effect transistor
JPH0129071B2 (en)
JPH09138247A (en) Overcurrent detection circuit