Monitoring voltage and current ?


Closed Thread
Results 1 to 17 of 17
  1. #1

    Default Monitoring voltage and current ?

    Hi all,
    I need your help how to monitor voltage about 150VDC and current up to 3 Amp using PIC , with protection circuits to protect pic from damage when any problem occurs such that high voltage or short circuits?

  2. #2
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    For the voltage, a simple voltage divider should work. Scale the voltage down to 5volts or less, depending on your supply to the PIC, and use an ADC input (PIC should have built-in ADC for this to work) to monitor the voltage. Since the resistors should be somewhat large, you may need to use a unity-gain buffer amplifier between the voltage divider output and the PIC-ADC input so that the ADC is not upset by the voltage divider's resistors.

    For the current, I would use something similar to the LT1787 (high-side current sense amplifier) and feed (also) into a differen ADC input for the PIC. There are several current-sense amplifiers from the likes of LTC, MAXIM, TI, etc. Or you could even use a high-precision OPAMP to do this (this may be a bit more tricky though). The key here is the sense resistor (it must be low enough so that there is very little drop, yet there is enough of a drop that can be sensed - wattage is also a consideration).

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Thanks languer for your help, but for the unity gain amplifier is't posible to built it using voltage follower of OPAMP 741 ?

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I would consider a better op-amp for this purpose. LM741 is noisy enough, and probably not good enough for really low voltage range. CMRR spec must be good, LM741 CMRR specs are poor. Check Microchip AN894, it has some nice theory in. Not sure if I agree them<all but, good enough to give you some ideas.

    http://ww1.microchip.com/downloads/e...tes/00894a.pdf
    Last edited by mister_e; - 26th March 2009 at 16:48.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    MisterE is right, a 741 is a poor choice for low voltage instrumentation work.

    I've become rather fond of the TS921.
    It's a nice low noise, low voltage (down to 2.7v) op-amp with rail to rail input and output...

    http://www.st.com/stonline/products/...re/ds/5560.pdf

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Thanks for all for your help and powerfull information.
    I built this circuit for current and voltage sensing and I want to take your notes. then after that I can build the operational amplifier stage.
    Attached Images Attached Images  

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    High likely your signals will be pulses? If you want to make it simple and use ADC, you'll need to filter them to get only a DC voltage, not pulses. Simple capacitor usually works pretty well.
    Last edited by mister_e; - 28th March 2009 at 09:42.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8


    Did you find this post helpful? Yes | No

    Default

    Hi iugmoh,

    On your voltage sensing circuit you might want to change the lower side of R3 to ground to prevent your ADC input from getting full 150V when Q1 is OFF.
    Also your R2/R3 ratio should be at list 30/1 in order to limit the voltage to ADC to maximum 5V. This might bring your output impedance low enough so you can use an ADC input directly. A filter capacitor and a Zenner diode parallel to R3 will help with the possible noise problem and make it safer.

    HTH

    Nick

  9. #9
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    I like your idea. It is simple and to the point.

    As Nicmus mentioned, R3 should go to ground, and a zener for limiting/clamping, and capacitor for filter is recommended.

    Same comments from mister_e and Nicmus apply to current measurement side. An RC into an OPAMP is recommended since you will be seeing pulses (OPAMP gain of around 8 should get you there). You may also want another limiting/clamping zener so that the pulses do not exceed the OPAMP's common-mode range. As it is, R1 will see up to 1.8W on average. The key points here, "up-to" and "average". So you may want maybe 4 parallel 0.8ohms (0.5W resistors), or perhaps 5 parallel 1ohms.

  10. #10


    Did you find this post helpful? Yes | No

    Default

    Thanks alot for all for your helping , but some notes about :
    1- the capacitor is't electryletic or ceramic and what is its capacitance and rated voltage.
    2- I know that the ratio of R2/R3 = 30/1 bur how I can choose the optimal value of R2 or R3.

  11. #11


    Did you find this post helpful? Yes | No

    Default

    Hi iugmoh,

    A quick Google search on “current sensors” will give you a lot of choices on selecting a suitable current sensor for your application. This link shows one not so expensive choice, is flexible and you can also get the schematic which will give you an idea on how to build your own if you choose this avenue.
    http://<br /> http://www.sparkfun.c..._id=8883<br />
    On the voltage side I suggest to design your R2/R3 divider aiming about 1mA current. This will keep your power dissipated on R2/R3 to a minimum. For R3 using 1% series resistors you can get a 4.99K (for simplicity let’s call it 5K) value which in turn will give you a full 5V under 1mA. Your total resistance R2+R3 should be 150K. So now all you have to do is find a 145K resistor which can be “made” from a 140K+3.01K or any other combination of the standard values from 1% resistors list.
    The values above should get you started with pretty good results. Depending on your PIC and its ADC input minor adjustments might be necessary due to the impedance added parallel to R3.
    You didn’t mention what kind of precision you want on your readings but with a 8 bit ADC you will read (5000/256)*30=600mV steps on your main voltage and it goes down to (5000/1024)*30=150mV when using 10 bit ADC.

    For the filter capacitor I suggest to start with a 0.47µF/25V ceramic cap X7R grade Digi-Key part # 445-1353-1-ND. If that is not enough you can increase the value.

    Any Zenner diode (5.1V) will do and should work fine with your maximum 1mA current.

    HTH

    Nick

  12. #12


    Did you find this post helpful? Yes | No

    Default

    thanks to all and to Nicmus for his powerfull demonstration this subject , I'm now understand it 100% and working to apply it.

  13. #13


    Did you find this post helpful? Yes | No

    Default

    after I connect the circuit, I notice that I always measure the source voltage not the motor voltage because I connect the wire from 150VDC to voltage divider then to ground, so I think I need another voltage divider after motor windings and make a difference OPAMP to mease the voltage on motor windings ( before and after motor windings) , any one have comments ?

  14. #14


    Did you find this post helpful? Yes | No

    Default

    Hi iugmoh,

    You are right that you are reading the input voltage not the voltage on the motor (maybe I missed this requirement) but here is the possible solution:
    Your IRF840 has a 0.85 Ohms ON resistence and your current sensor 0.2 Ohms (total 1.05 Ohms). Under maximum current allowed, 3 Amps, your maximum voltage drop will be 3.15V so the difference from the input voltage will be on your motor. You can compensate for that in your PIC program as one fixed voltage drop (read it under normal running conditions if such thing exists) or a variable one by using your current reading and apply it to the known fixed resistance involved (1.05 Ohms) if you want to get fancy.
    This will change with the load, input voltage or how worn the motor is.

    I’m pretty sure that we can better help you make decisions and select the best approach if you define your requirements in more detail.
    Here are just a few questions for you:

    • What will be an over voltage or over current situation? Define it.
    • How are you going to address the inrush currents at start up?
    • What is your target resolution and accuracy on voltage and current readings?
    • Do you want to continuously have and monitor/display these readings or just be able to set trigger points at max/min conditions?
    • Is your motor running under constant or variable load?
    • What is your power source and its specs?
    • Are there other requirements that you have in mind and didn’t mention yet?
    • Is your project cost sensitive?
    • Is this a one time deal or it will become a production item?
    • Is this a hobby style product or used in a sensitive application (medical field or so)?

    Please keep in mind that the answers you get from the forum are as good as your supplied information on what you trying to accomplish.

    Regards,

    Nick

  15. #15
    timmers's Avatar
    timmers Guest


    Did you find this post helpful? Yes | No

    Default

    Hi,

    All the comments are valid, but in my experience the voltage accross the motor, even with smoothing caps in the potential divider, will allways be near HT. The only way to measure the voltage ACCROSS the motor is to have two dividers, one on each terminal of the motor then motor voltage is the difference. But bear in mind the voltage accross a PWM driven motor is pretty much the supply voltage plus the back emf effects.

    I suspect you are wanting to monitor the motor drive, and to take meaningful readings I would dispense with the voltage reading and use the current monitoring. To isolate the circuit from the PIC, use an opto coupler.

    Tim.

  16. #16


    Did you find this post helpful? Yes | No

    Default

    I have to fully agree with timmers on monitoring only the current. With a little experimenting you can define your normal operating limits and take whatever action when things go wrong.

    I’m a little unclear on the idea of monitoring voltages on both sides of the motor. If I understand it correctly you will need to add one more voltage divider on the lower side of the motor. That means your resistors should be almost the same as the other divider to accommodate the full voltage when Q1 is OFF. In this case when Q1 turns ON you will only read a 1/30 portion of the voltage drop on Q1 and R1 which is even less than your voltage drop on R1 only and which will force you to use one more Op-Amp.

    I see no problem with a possible less than 1V error by approximating the voltage drop on Q1+R1 but this is one of the questions for iugmoh.

    Regards,

    Nick

  17. #17


    Did you find this post helpful? Yes | No

    Default

    oky In brief Iam working on thesis which title is "Parameters Identification of Permenant Magnet DC Motor" , in this thesis I built the mosfet driver to control the speed of motor , the motor is series wind motor but I convert it to separately excited motor by applying constant voltage to field winding , Motor specification is 110VDC , 3A , 200 watts,1500rpm , the motor aslo will be used as an educational kit which I will add all terminals to control motor and monitor voltages and currents and its speed so the student can use it with PIC or DAQ.

    In my work I will make some simulations on voltage and current of motor and it's speed I will use DAQ first for flexibility with computer then after that I will use microcontroller PIC.

Similar Threads

  1. Measuring voltage from a current transformer
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 5th May 2008, 21:19
  2. Expanded Scale Voltmeter
    By Pic_User in forum Schematics
    Replies: 6
    Last Post: - 8th February 2008, 20:32
  3. make a low voltage output from a PIC pin
    By emptyset in forum General
    Replies: 1
    Last Post: - 8th February 2008, 19:20
  4. Logarithm in PBP
    By savnik in forum mel PIC BASIC Pro
    Replies: 24
    Last Post: - 30th March 2007, 13:24
  5. 16F628A current high during sleep
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 9th October 2006, 10:21

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts