All About Circuits Forum  

Go Back   All About Circuits Forum > Electronics Forums > The Projects Forum

Notices

The Projects Forum Working on an electronics project and would like some suggestions, help or critiques? If you would like to comment or assist others with their projects, this is the place to do it.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 10-24-2011, 08:41 PM
jwilk13's Avatar
jwilk13 jwilk13 is offline
Senior Member
 
Join Date: Jun 2011
Location: California
Posts: 228
Default Load Current Sensing with PIC

Hi all,

I've recently started back up on a previous project, and I have a new feature that I would like to add. I'm trying to measure the current to the load with my PIC18F45K20; a schematic is given. The BSP762T is a high-side switch with its input coming from RC2 of the PIC (this is a PWM signal, ~100 Hz). The load is inductive, and is connected at H3. I'm trying to get the lowest cost solution, and I'm guessing this is going to be with a shunt resistor, I'm just not sure how to apply it to my particular application.

If it makes any difference, the load is connected to ground at all times, so the high side switch is necessary. I'm not sure if this means I need a high-side current measurement technique or not, and I'm hoping you guys here can help me out. Also, the load current varies from 0-2A with the PWM signal at a peak of 24VDC when varied from 0-95%.

I've done some reading on the subject, so any practical knowledge would be greatly appreciated. Thanks in advance.

Reply With Quote
  #2  
Old 10-24-2011, 10:27 PM
jwilk13's Avatar
jwilk13 jwilk13 is offline
Senior Member
 
Join Date: Jun 2011
Location: California
Posts: 228
Default

I stumbled on a neat little current monitoring device from Diodes, Inc. and wanted to get everyone's thoughts. I did some more testing, and the maximum current draw is 1A, not 2. The attached image is what I came up with. Think this will work?

Reply With Quote
  #3  
Old 10-25-2011, 01:00 AM
SgtWookie's Avatar
SgtWookie SgtWookie is offline
Expert Member
 
Join Date: Jul 2007
Location: In the vast midwest of the USA; CST
Posts: 21,994
Default

Looks like it might, but you have the upper left labeled "RC2". You actually need to put this sensor AFTER the junction of D1 and the BSP 762 pin 3 (out). That way the current flowing through the diode when the high-side switch turns off will also be measured.

You mention ~1A for the load current, but the high side switch is rated for 2A. That's sort of pushing it a bit close, don't you think? I like to have MOSFETs rated for 3x or more the current that will be flowing through them.
__________________
General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input.
Reply With Quote
  #4  
Old 10-25-2011, 02:49 PM
jwilk13's Avatar
jwilk13 jwilk13 is offline
Senior Member
 
Join Date: Jun 2011
Location: California
Posts: 228
Default

Silly mistake...I know better than that

In reality, the load current will most likely never get to 1A, more like 0.75A for short periods of time (seconds). But you're right, it is a bit close. They also list a typical nominal current of 2.4A depending on mounting conditions, and I plan on mounting it with more than adequate active heatsink area. Hopefully that's enough, but if it's not, I'll give you the chance to say "I told you so" .

I'll give the current sensor a try and see how it goes. Thanks for the input.
Reply With Quote
  #5  
Old 10-26-2011, 04:47 PM
jwilk13's Avatar
jwilk13 jwilk13 is offline
Senior Member
 
Join Date: Jun 2011
Location: California
Posts: 228
Default

Here's what I came up with. I'm wondering if someone can verify my resistor values. As stated: max current is 1A (high side of load is connected at H3), R12 and R13 are 1k, R14 is 33k, R11 is the current sense resistor and its value is 0.1 ohms. My goal is to have Vout range from 0-3.3V because that's what my A/D on the PIC is using as reference. This is my first attempt at this, so thanks for the help.

Reply With Quote
  #6  
Old 10-26-2011, 05:15 PM
SgtWookie's Avatar
SgtWookie SgtWookie is offline
Expert Member
 
Join Date: Jul 2007
Location: In the vast midwest of the USA; CST
Posts: 21,994
Default

Why don't you upload your .sch (and .brd if you have one).

You're starting to run power rails around everywhere; it would be so much cleaner if you simply used symbols (I like using the supply2.lbr symbols) to connect things to power and ground.
__________________
General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input.
Reply With Quote
  #7  
Old 10-26-2011, 06:48 PM
jwilk13's Avatar
jwilk13 jwilk13 is offline
Senior Member
 
Join Date: Jun 2011
Location: California
Posts: 228
Default

Here's something hopefully a bit cleaner. We've talked about this particular schematic before, so a couple of things I already think I know:

1. The efficiency of the voltage regulators is going to be bad and the amount of power dissipated as heat is going to be relatively high due to this inefficiency. Going with a switching regulator would be a better choice, but I don't have that luxury right now.

2. The high side current monitor uses an operational amplifier configuration, and because of this, extra care has to be taken in the PCB design to minimize EMI that could cause adverse measurements.

As far as #2 is concerned, I'm still trying to read up on that subject, but it seems like some sort of guard ring should do the trick. I'm just still not sure how to do that with the package that the device is in. Because of this, I don't have a board layout yet, but suggestions as to some things to take into consideration might be helpful . The big thing right now is making sure the circuit works as I think it should, in particular the high-side current monitor.

Reply With Quote
  #8  
Old 10-27-2011, 06:23 PM
jwilk13's Avatar
jwilk13 jwilk13 is offline
Senior Member
 
Join Date: Jun 2011
Location: California
Posts: 228
Default

As per SgtWookie's request, here's a sample board design for the above schematic. I tried to place components such that analog and digital are somewhat separated, but I'm still unsure about U5. I know I want the component leads as short as possible, but I was under the assumption that I also want the device to be some distance away from the switching device (U4). Basically, my main concerns are with EMI/EMC and noise affects, especially on U5. I'm new to this process, and reading application notes on EMI/EMC reduction is only getting me so far. Nothing seems to give relevant examples, so any help on my design would be greatly appreciated.

Also, a couple of questions:

1) Should I include a bypass capacitor for U5?
2) Would extending the top ground plane around the top power plane help? I attached a second image showing something like that. I read somewhere that this is a common practice, but I'm still unsure.
3) Everything I've read says to separate analog and digital grounds. I'm limited to one common ground. Is this going to create problems?

Thanks to all in advance.



Reply With Quote
Reply   Post New Thread

Tags
, , ,


Related Site Pages
Section Title
Worksheet Microcontroller principles
Worksheet CMOS logic gates
Worksheet Signal modulation
Worksheet Power conversion circuits
Worksheet Junction field-effect transistors
Textbook Pulse Width Modulation : Dc Motor Drives
Textbook Voltage-to-current signal conversion : Operational Amplifiers
Video Lecture Generation of Alternating Voltage - Alternating Current
Textbook PWM power controller : Analog Integrated Circuits
Textbook Biasing techniques : Bipolar Junction Transistors


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help to solve these three phase balanced load questions Ryza Homework Help 10 06-12-2011 02:46 PM
PWM Load control Smoothed current, how? Dyslexicbloke General Electronics Chat 0 06-05-2011 01:15 PM
Help! no/low load, starting current required gen sizing ryanonthebeach General Electronics Chat 0 09-10-2009 12:42 AM
quick check ihaveaquestion Homework Help 23 05-07-2009 09:00 PM
Using RDS for current sensing damianhealey The Projects Forum 19 12-09-2008 10:21 PM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:14 AM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.