PDA

View Full Version : How to measure Current with a Pic



tallen
- 16th August 2010, 19:50
I have a vairaible speed contoller that I would like to measure the current load on the unit. The load can be between 0 and 20 amps. I would like to be able to monitor the current in to the PIC. If the load get to high, I would shut the ouput down. Can anyone suggest a circuit to measure current?

Thanks,

Terry

rsocor01
- 16th August 2010, 20:14
I have a vairaible speed contoller that I would like to measure the current load on the unit. The load can be between 0 and 20 amps. I would like to be able to monitor the current in to the PIC. If the load get to high, I would shut the ouput down. Can anyone suggest a circuit to measure current?

Thanks,

Terry

You can use a shunt resistor in series with the load and measure the voltage across the resistor using ADC. Just make sure that you don't fry the PIC :).

Robert

Squibcakes
- 16th August 2010, 22:10
Allegro make some really good current sensors which look like a TO-220 style case with built in shunt. Cant think of the part number at the mo but I've used in the past and work well up to 60amps.

Tywais
- 17th August 2010, 03:29
Allegro make some really good current sensors which look like a TO-220 style case with built in shunt. Cant think of the part number at the mo but I've used in the past and work well up to 60amps.
Those are hall effect current sensors and cost around $10.00. The advantage is that it fully isolates the PIC from the current source and in the case of a motor that will be important due to back EMF. The other advantage is that there is very little power loss as opposed to using a series shunt resistor.

Acetronics2
- 17th August 2010, 13:35
Hi,

If it is only an overload protection ...

I generally use the output stage Mosfet RdsON as the shunt ...

just use a BS170 to connect the Drain to a comparator ONLY when Power mosfet gate powered. ( one 4066 gate could do it too, but ... ???)

sooooo simple ... :rolleyes:

Alain

PS ; and like that ???

tallen
- 17th August 2010, 14:52
I guess I don't fully understand this concept. If I have a load of 20 amps then with a .1 ohm series resistor that would be about 2V at 40 Watts. I guess I'm missing something simple.

The $10 part would be too expensive to add to this board. I was hoping for $3 or $4.

Thanks,

Terry

Squibcakes
- 18th August 2010, 01:32
Allegro make some really good current sensors which look like a TO-220 style case with built in shunt. Cant think of the part number at the mo but I've used in the past and work well up to 60amps.

Just following up .. here is link to what i used (although it has been replaced by newer part.. http://www.allegromicro.com/en/Products/Part_Numbers/0756/index.asp

circuitpro
- 18th August 2010, 02:15
I am working on a project in which we are using a LMP8601. This part converts the current through a shunt resistor to a voltage that can then be measured by your PIC's A/D converter, or in our case, we are feeding the output to a window comparator for a "go-no go" digital output that goes directly to a PIC i/o pin. This part is available from both Mouser and Digikey I believe. The theory is explained pretty well in the datasheet.

languer
- 18th August 2010, 08:57
The key to your request is the following (imho):

The load can be between 0 and 20 amps. I would like to be able to monitor the current in to the PIC.
If you want to monitor current from 0 to 20A (both ends inclusive), then the Allegro parts are probably best.

However, if all you need is to set a reasonable trip point (e.g.) 10A at which an overcurrent signal trips; then a sense resistor followed by some form of a comparator is probably easiest and less expensive. We have normally used something like the LT1787 with multiple parallel power-rated 0.1ohms or less sense resistors. The power rating will depend on how many sense resistors are in parallel, how much margin you deem necessary above your maximum current.

Charles Linquis
- 18th August 2010, 13:39
I'm a fan of the Allegro devices. So much simpler than dealing with low-value shunt resistors. Isolated too. Unless you have a pretty good understanding of analog, just use an Allegro. Up to 30A in an SO-8 package. The offset from zero is about 10% of the supply and the output is linear - 133mV/Amp.