# Clamp a floating input

Discussion in 'General Electronics Discussion' started by Vegas2012, Sep 4, 2012.

1. ### Vegas2012

16
0
Sep 4, 2012
Hi,
I have an op amp circuit which is meant to trigger when an input signal goes above a reference voltage of 12 Vdc. The input signal (Vin) is not grounded to my op amp circuit, which makes the input floating.

Of course, the true fix to make this work would be to ground the input signal to circuit ground, however it is a bit more complicated than it sounds...

Therefore; Can I 'drag' the Vin floating input signal to my circuit ground (or close enough) using a Positive Diode Clamp as seen in the picture?

If I can clamp Vin, then my op amp circuit should work as designed.

2. ### (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,500
2,840
Jan 21, 2010
With this circuit, your output will be a square wave. (Do you see that?)

Is this homework?

3. ### Vegas2012

16
0
Sep 4, 2012
No, not homework. Just a little rusty on my clamping electronics... never actually used one before.

Output = square wave: yes, but only if the input is greater than the 12Vdc reference on the op amp. The cct isn't drawn 100% accurate as the R1 and R2 voltage divider is actually a potentiometer which allows me to vary the change of state from the op amp.

4. ### (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,500
2,840
Jan 21, 2010
No, output is close to the -ve supply if the input is less than 12V, and close to the +ve supply if the input exceeds the supply.

5. ### Vegas2012

16
0
Sep 4, 2012
Exactly, if Vin is less than 12Vdc, O/P = low, vice versa if Vin exceeds 12Vdc.

Regardless, the op amp output is not the intention of my original question. I am wondering if the positive diode clamp I have depicted will allow me to 'ground' the currently floating sinusoidal, square, triangular waveform at Vin.

I do not want to physically ground Vin by tapping its floating ground source at its location because this action does not fit within the intended parameters of the circuit I have built.
All I need to do is stabilize Vin so the comparator inputs are somewhat consistent. Right now, the comparator is essentially unstable because Vin is not a fixed input (being that it floats).

Once again:
Will a Positive Diode Clamp allow me to stabilize Vin? Essentially, bring the bottom edge of the waveform to (or close) to my circuit ground.

6. ### (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,500
2,840
Jan 21, 2010
Are you AC-coupling the input of your op-amp to the input signal?

If so, you simply need a high impedance voltage source connected to the op-amp side of the capacitor. A voltage divider made up of fairly high value resistors will suffice.

This only shifts the average of the waveform, it does not shift the "minimum" value. If the waveform was asymmetrical (say a pulse), then the average changes as the duty cycle varies.

If you need to move the input up or down a specific amount, then you coul d use a level shifter.

Possibly easier to DC couple the input signal and choose a more appropriate reference voltage in this case though.

7. ### Vegas2012

16
0
Sep 4, 2012
Since Vin is approximately 8.2Vp-p square wave, the DC coupling of the diode clamp should be sufficient. The unknown factor in this entire equation is the + or - displacement from my CCT Gnd with respect to Vin.

With my scope, it appears that Vin Gnd displacement is negligible; appearing to behave as if Vin Gnd is at, or near, my CCT ground potential. Based on the behavioral differences between bench testing (100% successful) and real-life testing (realization that Vin floats) it is apparent that I need to clamp Vin to my CCT ground.

In the environment where both circuits will be "joined", the differential ground potentials are minimal, so I am not concerned with ground loops - especially being VDC.
Bottom line is that I want to clamp Vin without tapping into Vin's ground source - tapping Vin's Gnd source will solve everything, but it isn't as easy as it sounds and doing so will exacerbate the purpose of my circuit.

Last edited: Sep 5, 2012
8. ### Harald KappModeratorModerator

11,813
2,753
Nov 17, 2011
Apart from the discussion about a clamping circuit, I see two problems:

1) You cannot measure Vin by connecting only one terminal to your circuit. A voltage is a potential difference between two points. You need to look at both points. That's why birds can sit on high voltage transmission lines without being hurt, but a tree falling into the overhead transmission lines will burn.

2) Although the input impedance of the OpAmp is very high, there is still an input current (bias). Without a path for this current to flow away to ground, the floating input will saturate to either -Vsupply or +Vsupply.

I can imagine a few remedies:
1) use a transformer to decouple the input from your circuit
2) use adifferential amplifier - but you will still need a (high resistance) resistor for the bias current.

9. ### Vegas2012

16
0
Sep 4, 2012
I understand your position on this, and therein lies the problem.
Vin measures 8.2 Vp-p square wave on my scope and approximately 8.4 VDC on my multimeter when referenced to CCT ground.
a) Because Vin is floating, the multimeter reading is irrelevant as there is no common ground to the 2 circuits. The 8.4VDC reading tells me that Vin is 'close' to CCT ground at the time of measurement, but this can change at any time depending on when the floating signal decides to wander from a reference point.
b) The 8.2 Vdc p-p square wave measurement is accurate, no matter what the reference is. The scope measures p-p value based on the peak to peak of the waveform, not the reference point.

As far as the current is concerned, there is very little current from Vin as this is NOT a power circuit, it is merely an on/off circuit (to put it mildly). Clamping the signal will simply 'drag' the floating signal to my circuit level for op amp trigger purposes. Both circuits operate from 12Vdc so I am not worried about circulating currents (just yet).

I thought about using an isolation Xfrmr to solve (decouple) this issue, but I have multiple inputs paralleled to Vin which are conveniently referenced to my my CCT ground and a Xfrmr will not work when the Vin signals are 'flat' DC voltage. It is ONLY the floating square wave signal which is giving me a headache at this point because it is not grounded to my circuit... and NO - I can not ground it from its source (hence my desire to clamp it)

Aside from all of the missing intricacies of my actual circuit (as they are irrelevant)...
Can I 'drag' Vin to my CCT ground via a Positive Diode Clamp circuit?

Last edited: Sep 5, 2012
10. ### Harald KappModeratorModerator

11,813
2,753
Nov 17, 2011
Clamping will not solve the issue wit the floating input. Clamping is a way of protecting the input from overvoltage or undervoltage.

Current: I did not refer to the current from Vin. The OpAmp has a (admittedly very) small input current.You need to provide a path to ground for this current. See this application note.

Last edited: Sep 5, 2012
11. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
Vegas2012, why don't you just tell us ALL about what you're trying to do. What does the signal come from? You've described its characteristics but not very clearly. Why is it isolated? What is the purpose of your circuit? What will you be driving with it?

With a very narrow and incomplete description of your setup, it's easy for different people to form different interpretations, and this just leads to confusion on top of uncertainty. The answer may be a lot simpler than you think. It would help everyone if you could start from scratch and explain your situation in full, from the beginning.

12. ### Vegas2012

16
0
Sep 4, 2012
Sure.

What I am trying to do is tap into my DRL (daytime running light) signal in my vehicle. The DRL signal is also the low beam signal.

When in DRL mode, the waveform to the low beam wire is 8.2Vp-p square wave. Once the headlights are turned on, the signal is 14.X VDC (battery charging voltage).
If the DRL is on, the 8.2Vp-p square wave will not change the op amp state; this is the way the circuit should operate. Once the headlights are turned on, the 14.X Vdc will now cause the op amp to change state. Perfect.

As mentioned, the circuit works 100% on my test bench with a simulated 8.2Vp-p square wave. Once I connect it to the vehicle, the DRL mode isn't enough to trip the op amp (at first)... once the headlights are turned on, the op amp changes as it should. When I turn the headlights off and go back to DRL mode, the op amp does not change. It is almost as if by switching from 14.X Vdc back to 8.2Vp-p, the 8.2Vp-p has been 'dragged' to the same potential as the 14.X Vdc signal and it doesn't want to drop the op amp output back to zero (low). If I get in there with a screwdriver to adjust the level, it takes just a light touch and the op amp will change state. On the bench, there is a large range on my adjustment pot between the 14.X and the 8.2 signals. In the vehicle, the 2 signals react as if they are at, or near the same trip level. This has caused be to believe the 8.2Vp-p signal is floating.

I did some investigating and there are several vehicles that actually use a floating ground on their DRL's, signals, taillights, etc to protect from short circuits. Because the signal is floating, it obviously explains the operation described above.

Hope this helps.

Last edited: Sep 6, 2012
13. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
OK, thanks for that description.

It sounds like you need to identify the negative reference for these voltages. The 14.x VDC voltage sounds like it is relative to the chassis, right? If so, I would expect the 8.2V p-p square wave is probably relative to chassis as well?

When you measure the 8.2V square wave, what reference do you use for the negative terminal of your multimeter or oscilloscope? It has to be SOMEthing. Is it chassis ground? Does the square wave jump between 0V and +8.2V relative to chassis ground? I would expect that it does...

What connections do the headlight assemblies have? Obviously they need chassis and battery positive, so they can power the light bulbs, right? So the signal you're measuring is just a control signal, is it? Again, I would expect it to be relative to chassis ground.

Out of interest, what frequency is the 8.2V square wave?

Do you have an oscilloscope? If so, can you connect its ground to chassis ground and look at the control signal with it? If the square wave is slow enough, you would be able to use a multimeter for this as well.

If that's the case, your op-amp just needs to use a threshold of around 10V, so in DRL mode, the voltage is always below the threshold, and when the headlights are on, the voltage is always above the threshold. Is that right?

And you're powering the op-amp from the battery voltage, right?

If the control signal is truly isolated (which I doubt), it still needs a reference rail. So, you will have two connection points, with a voltage between them as you described. It would be possible to drive an optocoupler using a simple voltage detector, so the optocoupler is activated when the voltage difference between those two connection points is, say, 10V or higher. A zener diode and a few resistors will do this. But I doubt that it's necessary, because I doubt that the control signal has a floating reference voltage, but if the signal truly does have an isolated negative reference rail, you can do it.

Does this make any sense? What do you think?

14. ### Harald KappModeratorModerator

11,813
2,753
Nov 17, 2011
I think the chassis potential should be usable as common ground.

15. ### Vegas2012

16
0
Sep 4, 2012
Correct. All measurements are with respect to chassis ground/circuit ground.

Headlight assembly connector has 3 wires: Ground, Low beam/DRL and High beam.

Frequency is 56Hz square wave.

Yes, I have redrawn the circuit. Perhaps I have overlooked something, but as mentioned, the circuit works 100% on my bench. Really frustrating and head scratching.

I just put together a positive diode clamp and I don't think this will work. It works fine for passing the square wave but won't allow straight DC through, correct?
Because Vin switches between 14Vdc and 8.2V square wave from the same source wire, I think I need to come up with another solution.

Sorry for dragging this out. I have a digital scope, but cannot 'see' if the square wave actually floats or is grounded to chassis. I have an analog scope coming in next week that should verify once and for all if the square wave floats.
I honestly can not come up with any other reason as to why this cct works on the bench but not in the vehicle.

All suggestions are welcomed...
KrisBlueNZ - possible for you to make a quick schematic of what your solution might be with an optocoupler?

16. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
That cicuit looks OK apart from the 220 uF capacitor from the op-amp output to ground. I don't know what you expect it to do, but it won't, and it's a bad idea.

I'd also change the zener to a lower voltage, say 5.6V, and increase R3 to get, say, 10 mA through it. This will make the zener reference voltage much less dependent on the actual battery voltage.

The circuit doesn't have any protection against noise on the automotive supply rail, so ignition and alternator noise could affect and/or damage it. Suitable protection consists of a varistor, resistor and zener, decoupling capacitor(s), etc. Do some googling for some ideas.
Correct. I don't think you need anything more than that design, though. If you set the threshold voltage around 10V, the square wave will always be below the threshold, and the battery voltage will always be above it.
I don't understand. A digital scope will definitely show you the DC levels of the top and bottom of the square wave relative to chassis. There's no difference with an analogue scope.

You just need to make sure the input is set to DC coupling. When the square wave is on the display, the scope will show the actual absolute voltages of the top and bottom of the square wave, relative to whatever you have connected the scope ground to.
I could, but it seems pretty clear that the control signal is relative to chassis ground, so there is no need for a differential input, or signal isolation.

I think you don't quite understand what you're measuring. Can your digital scope produce image files you can upload? I would like to see what it shows for the two possible states of the control signal, with the scope probe connected to chassis.

17. ### Vegas2012

16
0
Sep 4, 2012
Thank you for your answers/questions. Nice to know I did something right along the entire process
I am not new to electronics, but very rusty and I appreciate your input.

The 220uF cap on the comparator output is intended to 'hold' the transistor base in a conducting mode for approximately 1.5 seconds after the op amp switches back to low. I would like to retain this feature... I am open to suggestions.

Everyone who has replied so far is going to want me to line up against a wall and shoot me when I tell you what I scoped just now. See pics below.
Turns out I trusted my voltmeter and read the 8.4 Volts incorrectly, or out of context...and the square wave isn't 8.4Vp-p. It actually SCOPES at 13.8 Vdc peak. The 8.4 reading was DC average. This explains why my op amp threshold was so close to the 14.X Vdc voltage when low beams were activated. Also explains why it worked 100% on my bench when I made a 8.2Vp-p square wave simulation.

And yes, I feel like a complete idiot for not selecting the proper measurement function on the scope originally. I somehow think Occam's Razor is going to be thrown at me somewhere along the way.

I do appreciate all input given in this thread as it has led to this problem being solved... even though it opens an entirely different problem.

KrisBlueNZ - if you didn't ask me for the scope pics, I would still be banging my head against the wall. Cheers for getting me to double check!

Channel A is 14Vdc, Channel B is the square wave.Take a closer look at the second pic showing VPk (D'oh). 13.8V.

The origin of my confusion and reasoning behind this thread:
The bottom picture is similar to the original reading I took at the beginning of this thread, but I only used one channel for the original reading... The Scope was set on DC volts, not Vpeak. I apologize for not taking the time to evaluate the actual scope values - I merely looked at the 8.4V scope's numerical reading and saw the same reading on my meter and didn't give much thought to P-P, RMS, Peak, etc differences.

{ /me banging head against the wall while simultaneously ducking O's Razor which was thrown at me}

Last edited: Sep 7, 2012
18. ### Vegas2012

16
0
Sep 4, 2012
Now the question is:
How can I 'split' the 2 different signals from the same source (14.1 Vdc and the 13.9 Vpeak square wave) to make the rest of the op amp circuit work?

Since the 2 signals have relatively the same amplitude/threshold on the op amp, I have to manipulate the square wave signal to give me 2 distinct peak values for the 2 different modes of operation.
A frequency to voltage converter comes to mind, but there has to be an easier solution.

Last edited: Sep 7, 2012
19. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
OK, don't worry about making a mistake with the measurement. As long as you understand it now, everything's fine. But can you tell me, is there a third state, with the control signal steadily low? When the light is completely OFF?

The way I'm imagining the whole setup is that the light has three wires. Two connect across the 12V supply, i.e. one to battery positive, and the other to chassis. The third wire controls the light. Is that right? So there should be three states for that control signal - light off, low beam / DRL, and high beam. Would that be right? You could also confirm that the positive rail is powered all the time, though that doesn't really matter.

Edit: If this is how the system is set up, most probably the control wire will be thin (because it only carries a control signal) and the other two wires will be thick (because they carry all the current used for the light bulbs).

Now, assuming I'm right about all that, you want your relay to be closed while the signal is carrying that square wave, right? And when the signal is at +13.8V you want the relay to open after a short delay, right? What about when the signal is at 0V? In other words, do you want (a) relay closed only while squarewave present, or (b) relay closed except when signal is steadily at +V?

I will draw you up a schematic. Whichever option you want, the design is not complicated. You don't need an op-amp, and I would avoid one because a simple design using discrete transistors is more robust and that's important in an automotive environment.

Just answer those questions and I'll draw it up.

Last edited: Sep 7, 2012
20. ### Vegas2012

16
0
Sep 4, 2012
Actually, there are 3 wires that go from the headlight harness to the lights. Low/DRL, High and Gnd.

There are 3 states on the Low/DRL wire:
1) Off - no power on Low/DRL wire - when vehicle is off
2) DRL Mode - Square wave on Low/DRL wire - turns on when vehicle is running and parking brake is released.
3) Low Beam Mode - 14Vdc on Low/DRL wire - switches from DRL mode to Low mode when headlight switch is turned on.
There are 2 states on the High Beam wire:
1) Off - no power on High wire - when vehicle is off, or Low Beams are on
2) On - 14Vdc on High Beam wire - on when headlight switch is toggled from Low Beam mode.

Surprisingly, the wires that go directly into the headlights are relatively thin - approx 16-18 gauge.

When the Low/DRL wire is in DRL mode (square wave) AND in the OFF Mode - I need the relay to be de-energized and the N/O contacts do nothing. When the headlights are turned on (14Vdc on the wire) I need the relay to energize, closing the N/O contacts.

The delay I have with the 220uF capacitor is to hold the relay in the energized state for approximately 1.0 seconds. So, when switching from Low Beam Mode to High Beam Mode, the relay stays on for another 1.0 seconds. In addition to the delay, my existing circuit has a signal coming from the High Beam wire when it turns on. This allows the low beams to remain on when the high beams are also on. The signal comes through Diode D4 in the following drawing. D4 also plays into the 220uF Cap... the Cap delay is so the Low Beams will not 'flicker' when switching to and from Low Beam Mode to High Beam Mode. Once the switching is complete (relatively faster than the 1 second delay), power is maintained to the op amp circuit either through D1 (Low Beam) or D4 (High Beam)

Thanks for spending the time on this.

Last edited: Sep 7, 2012