PCB Heaven

General Category => Digital discussion => Topic started by: jerano on August 16, 2008, 17:13:13 PM

Title: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: jerano on August 16, 2008, 17:13:13 PM
Hello forum

Please i need your help. I want to make a check engine for the lamps of my motorcycle. This will be a PIC micro, that will open instantly all the lamps of the motorcycle (one after the other of course) and will check in each lamp what if there is a current flowing. if not, this means that the lamp is broken and must be replaced.

Now my problem. I use a PIC that has an ADC. This will convert 5 volts to a 12bit digital. But i do not want to measure voltage. I want to measure current.  The lamps are of range from 5 to 35Watts at 12 volts.

Please can you help me?
I wil apreciate any help. Thank you
Title: Re: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: jerano on September 02, 2008, 18:09:53 PM
I have seen some transformers used in electric installations that makes a reduction for example 1/100.
They have a coil and the wire passes through this coil. You do not need to cut the wire, just to cross it from the center of the transformer.
The outputs are the amperes of the wire divided.

Can i use one of this? Are there any with less division? Like 1/10 or even less?
Title: Re: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: spic0m on September 02, 2008, 18:52:32 PM
In electric industry you won't find one that suits you, to big and with big reductions cause there ment to measure hundreds of amperes, in electronics i don't know if something like that exists in the sizes you want.
Maybe check in automotive parts, older cars had ampmeters but you have to put them in series.
Title: Re: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: kam on September 02, 2008, 20:54:36 PM
I have seen some transformers used in electric installations that makes a reduction for example 1/100.
They have a coil and the wire passes through this coil. You do not need to cut the wire, just to cross it from the center of the transformer.
The outputs are the amperes of the wire divided.

Can i use one of this? Are there any with less division? Like 1/10 or even less?


No you cannot. Minimum may you find 1/50, and refers to AC. You need DC, and i suppose just a couple of amperes, maybe 3Amps. You will put a resistor, 1ohm or maybe less, 0.5ohms is good, 5 watts. Across the resistor you will measure the voltage drop. Use the ohms law calculator (http://pcbheaven.com/handbook/calculus/index.php?calc=ohm) to calculate the current from the voltage drop...
Title: Re: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: Mercury on September 02, 2008, 22:34:58 PM
I have seen some transformers used in electric installations that makes a reduction for example 1/100.
They have a coil and the wire passes through this coil. You do not need to cut the wire, just to cross it from the center of the transformer.
The outputs are the amperes of the wire divided.

Can i use one of this? Are there any with less division? Like 1/10 or even less?


No you cannot. Minimum may you find 1/50, and refers to AC. You need DC, and i suppose just a couple of amperes, maybe 3Amps. You will put a resistor, 1ohm or maybe less, 0.5ohms is good, 5 watts. Across the resistor you will measure the voltage drop. Use the ohms law calculator (http://pcbheaven.com/handbook/calculus/index.php?calc=ohm) to calculate the current from the voltage drop...
Won't this resistor reduce also the current through the lamp?
Title: Re: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: jerano on September 03, 2008, 22:40:47 PM
I have seen some transformers used in electric installations that makes a reduction for example 1/100.
They have a coil and the wire passes through this coil. You do not need to cut the wire, just to cross it from the center of the transformer.
The outputs are the amperes of the wire divided.

Can i use one of this? Are there any with less division? Like 1/10 or even less?


No you cannot. Minimum may you find 1/50, and refers to AC. You need DC, and i suppose just a couple of amperes, maybe 3Amps. You will put a resistor, 1ohm or maybe less, 0.5ohms is good, 5 watts. Across the resistor you will measure the voltage drop. Use the ohms law calculator (http://pcbheaven.com/handbook/calculus/index.php?calc=ohm) to calculate the current from the voltage drop...

Please one schematic tounderstand
Title: Re: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: kammenos on September 07, 2008, 10:31:38 AM
Here you are. The schematic you want is attached.
Title: Re: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: kam on September 07, 2008, 17:11:46 PM
kammenos the schematic is ok.

Mercury, a 0.1 ohm resistor may reduce a 12volt battery down to......120 amperes... That will be no problem i suppose ;D
Title: Re: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: Mercury on September 10, 2008, 00:21:26 AM
kammenos the schematic is ok.

Mercury, a 0.1 ohm resistor may reduce a 12volt battery down to......120 amperes... That will be no problem i suppose ;D

 ;D of course  ;D
Title: Re: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: jerano on September 10, 2008, 07:58:13 AM
Kammenos, the output to PIC will measure voltage? And what is the analogy? Because this is a complicated schematic.
Title: Re: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: kammenos on September 15, 2008, 21:26:13 PM
Kammenos, the output to PIC will measure voltage? And what is the analogy? Because this is a complicated schematic.


you are measurig the voltage drop on the resistor. Using the ohms law:

R = U / I => I = U / R

You know the resistanse (R) that is 0.1 ohm, you also know the voltage drop (that you measure with the PIC A/D U). So you can calculate the current if you divide those two. And it happens that the current in a series circuit (like the attached i gave you) is the same for all the circuit.

Title: Re: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: jerano on September 15, 2008, 22:31:20 PM
And how about the R2 and D1? What the use of them? And do i need to add them into calculation?
Title: Re: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: jerano on October 07, 2008, 22:39:35 PM
And how about the R2 and D1? What the use of them? And do i need to add them into calculation?
Title: Re: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: kam on October 11, 2008, 14:49:33 PM
R2 is to limit the current in case of short circuit the load to keep PIC and zener safe.
D1 is to limit the voltage to 5volts as PIC will be in great danger if more voltage is applied to it.

You do not really need to calculate R2 and D1 as what you realy measure with pic is the voltage drop across R1.

The max current to flow within the circuit will be P=U x I => I=P/U => I = 50/12 => I = 4.1Amps through the 50W load. I do not add the 0.1 ohms resistor to calculation because ... you know why...

This current will also flow within R2 causing a voltage drop of UR2 = I * RR2 => UR2 = 4.1 x 0.1 => UR2 = 0.4 volts. This is what you will measure to your PIC. So choose an appropriate comparator voltage.
Title: Re: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: Supernova on October 14, 2008, 23:29:40 PM
Kam there will be a small voltage drop due to grounding the PIC.

This is very small voltage drop. It will slightly change your readings. If you use it only to check if the load is working (current flows) then you have no problem. If you use it for measuring the current, you should make some checks with a good amp meter first as there will be a very slight change between calculated value and measured value. Also, the 5% or 10% of the value of the resistor will change this value.

In any case, make tests first
Title: Re: PLEASE HELP PLEASE, PIC to measure ampere current
Post by: kam on October 19, 2008, 10:06:14 AM
Yes of course there will be things like you mentioned but when first designing a project i usually suppose that we live in a happy perfect world... :D

Then i adjust my components according to the readings just to discover that this world is not happy and not at all perfect  :P