unexplained uC voltage reading question

Discussion in 'The Projects Forum' started by russpatterson, Nov 14, 2011.

  1. russpatterson

    Thread Starter Member

    Feb 1, 2010
    351
    16
    Hello, I'm having an issue with this circuit. When I have the load disconnected and read the voltage with the uC, everything checks out fine. The uC gets the same voltage reading as my meter. However, when I start up the pwm (around 90%) to turn on the load (in this case a 12V halogen lamp that draws about 2.9A) then I get a significantly lower voltage reading on the uC than what I see on my meter.

    E.g. when load is off my meter reads 12.3V and the uC gets 12.2V. I'm not totally comfortable with that discrepancy but it's close.

    When the load is connected (well connected 90% of the time via the uC's pwm) then I get voltage readings of 12.2V on my meter but 11.4V on the uC.

    I really don't have an explanation. There is some voltage fluctuation going on at the battery when the MOSFET switches. I've seen this before and I average out the readings on the uC so the voltage spikes should get averaged out. (see the attached scope pic).

    I even stored the last 16 ADC register values and saw the low voltage reading consistently. So that rules out the voltage spikes.

    I should add that R10 is not installed and just jumpered. Also BATT_V_BOARD is the node between R10 and C3 (connected to the 7805, 5V regulator input)

    Any ideas as to why I might be seeing the readings on the uC that don't jive with my meter?

    Schematic and scope pic attached.
     
    Last edited: Nov 15, 2011
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Russ,
    Please Edit your post, and remove the links to the embedded images; they are simply much too large. Just add a note that the attachments are large.

    They are so big that it makes reading the text difficult.

    Your schematic is very neat, but it is so chopped up that it's difficult to determine where a signal might come in, and where it might go out. It's a bunch of little pieces of individually labelled wire, and one would have to read the text on everything and connect them together in order to try to figure it out.

    I have no idea where you are reading the voltage from with either the uC or your meter.
     
    Last edited: Nov 15, 2011
  3. russpatterson

    Thread Starter Member

    Feb 1, 2010
    351
    16
    Thanks for the reply and good points on the schematic. It would be nice to have some schematic software that let you click on a block and zoom in on the actual schematic for just that block. That way you could show all the blocks connected. I'm sure there are professional packages out there that allow that.

    I think your point on the location of the measurements is on the money. I am measuring the battery voltage with the meter right on the battery terminals. I am reading the voltage with the uC via the block labeled 'Battery Voltage Sensor'.

    I connect the battery to the controller (the circuit in the schematic) with a 6' length 16 guage wire. I connect the load (12V, 2.9A halogen bulb) via 6' of 22 guage wire.

    So I must be seeing a voltage drop with the 2.9 Amps moving across some resistance. The 16 guage wire should be fine. I think it's on my board. I have a narrow trace (0.03") instead of the intended (0.085") from the fuse to the terminals. An oversight on this version. That must be why the uC is reading that voltage only when the load is connected.

    Does that sound right?
     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    6' of AWG-16 copper wire will have ~0.0241 Ohms resistance; with 2.9A current, there will be a ~70mV drop across the wire.

    6' of AWG-22 copper wire will have ~0.0969 Ohms resistance; with 2.9A current, there will be a 177.3mV drop across that wire.

    That's about 247.4mV you didn't account for previously.

    If there is any distance between two points and a current flowing between the two points, there WILL be a difference in the voltage; even if it's a small difference.

    Since you didn't mention the length of the trace nor the oz of the copper on the board, resistance of the trace won't be possible to calculate.

    Note also that HOW you connected your wires to the board will also figure in to the total resistance. 63/37 solder has roughly 5 times the resistance as copper. Solid has roughly 21 times the resistance of copper. This is why you want your wires and leads to be in contact with the traces when you solder them.
     
    russpatterson likes this.
  5. russpatterson

    Thread Starter Member

    Feb 1, 2010
    351
    16
    The skinny trace in question is 1oz. copper and about 3/4" long. I'll try putting some wire in parallel with it and see if the issue gets resolved.

    To connect the wires to the board I have pads (like a giant via, that goes through the board) and solder 6" lengths of 16 guage wire to them. Then I wire nut those 6" wires to the 6' transmission wires.
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    A 30 mil trace 0.75" long of 1oz copper will be around 12m Ohms (0.012 Ohms) at room temp (23°C) giving a 34.8mV drop @ 2.9A. If the temp goes up 30°C to 53°C, resistance will be ~13.5m Ohms giving a 39.15mV drop.
     
  7. russpatterson

    Thread Starter Member

    Feb 1, 2010
    351
    16
    That still doesn't account for the ~700mV drop I'm seeing. 70 mV for the 16 guage wire and 35mV for the trace. It must be some other flaky connection or solder joint that is resistive.
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    If you are using PWM or cycling the MOSFET on and off, you may be seeing a loss due to reactance in the wiring. 12 feet of straight wire 50 mils in diameter would be ~6.3uH. If there were bends in the wire, the inductance would be much higher.
     
  9. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,912
    2,178
    A lot of digital meters read peak or rms peaked voltages on DC signals with pwm modulation. The ADC in the controller is reading the average voltage.
     
    russpatterson likes this.
  10. russpatterson

    Thread Starter Member

    Feb 1, 2010
    351
    16
    @Sgt, would the reactance in the wire account for 500mV?

    @nsa, From the scope pic the battery peak voltage is over 15V. I'm reading 12.2V on the meter.
     
  11. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,912
    2,178
    Is it a true RMS meter? If so the meter is correct if it's internal sampling function/filter can handle the PWM frequency.

     
  12. russpatterson

    Thread Starter Member

    Feb 1, 2010
    351
    16
    It's an inexpensive meter I got at Radio Shack for about $60.

    However I located the issue by testing voltages at different points. I'm going to chalk this one up to the Heisenberg effect. The big voltage drop was over my other cheap meter I used to measure current. Probably more due to the probe quality than the meter itself.

    Thanks for the help everyone. I was really stumped with this one. I am going to get some decent meters and probes that I don't use outdoors.
     
  13. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,912
    2,178
    Now you see why people say invest in a good fluke meter for electronic measurements. You can get a used 87 III with a expired but recent cal-cert for $60.
     
  14. Adjuster

    Well-Known Member

    Dec 26, 2010
    2,147
    300
    Note however that even with good instruments, burden voltages can still be significant: a few hundred mV on a DMM at full scale is not out of court. See Page 38 of this manual for a Fluke 87:
    http://assets.fluke.com/manuals/87______umeng0800.pdf

    This gives 0.03V per A burden on its 10A continuous / 20A brief range, i.e. 0.3V / 0.6V maximum burden.

    Particularly at higher currents, the voltage drops in meter leads and contact resistances can also be significant.

    If you have to measure high currents in a low voltage circuit with minimal disturbance to its operation, it may be preferable to monitor voltage across an accurate four-terminal resistance.
     
Loading...