measuring floating voltage

Does anyone have any suggestions for measuring floating voltage?

I am trying to measure the voltage at the TEC. I can't simply hookup the +, it will always read 12v. I've thought about using the negative side as a kind of reverse voltage (i.e. it reads 8 and I know my voltage is 4), but I'm not sure that will work the way I think..... Plus it would be more complicated than a simple voltage divider.

Would using a simple voltage divider with high impedance work with the above circuit? Say a 10MΩ and a 2MΩ resistors?(sorry for the paint drawing)

Take the output of that and tie it to an analog pin?

when i look at your second illustration it does not look like a voltage divider.

a voltage divider requires to get the input signal at the top of resistor one.

you will get the output signal between resistor1 and resistor2 (R2 connected to ground).

... That's a voltage divider. Whether I can read the output on the Arduino without referencing it's ground or not is another story, and what my question was.

But I don't see how you can say that isn't a voltage divider?

The output voltage on the Analog out on my drawing would be roughly 2v with a 10MΩ and a 2MΩ resistor and 12 volts across the TEC.

sorry,

i was not looking closely enough. just forget my comment.

What are you measuring the voltage with?

I'm trying to measure the voltage from the TEC back at an analog pin on the Arduino .

My problem is the NPN's that I have down below. My TEC voltage is floating from ground when they are off. So if I measure from ground to TEC + I always read 12v. If I read from TEC - to TEC + I see the correct voltage. That's why I was wondering if I could take that voltage on a divider and have the arduino 'see' the correct voltage at the TEC.

I'm not sure that it will work since the Arduino is referencing ground to compare it, but I'm not sure it won't, so figured I'd ask smarter people than I :slight_smile:

I'm hoping that since I'm using the TEC - and + for the voltage divider that there will be a differential voltage that can be measured. Otherwise I'll just be reading the 12v constantly and it will never see it move. This could have all been avoided if I would have built the circuit switching positive instead of negative.... Oops. Live and learn, the circuit is built now and I really really don't want to have redo those boards.....

Worst case scenario I can get a powered DC display and read directly from the TEC, but it won't be on my touchscreen and I was trying to keep the displays condensed to just one.

A voltage is a potential differance, therefore by defination it is impossible to measure a difference between only one point.

Thanks Grumpy_Mike!

That's where my question is at. I understand the potential difference. What I was wondering, by reading the output of the voltage divider, since it is getting its sum from the TEC + and -, which floats, will the Arduino be able to 'see' 6v (1v at the analog pin) if I am at a 50% duty cycle? Or will it just see 12v (2v at the analog pin) 50% of the time with that divider since it is using the NPN drain(ground) as a reference?
(The voltage isn't a linear progression, it's more logarithmic, that was just an example for simplicity's sake)

To be safe, put a 15k resistor in series with the analog input, the voltage read will depend on where the sample is taken in the PWM cycle, you may need to take a lot of samples (say 20 - 30) and average them.

The only way the arduino can read the voltage is to measure across a resistor. This requires a connection to the gnd of the arduino.

If the arduino is floating (separate power supply) with no connection to the test circuit ground, it should be able to be read.

Think of it as a multimeter with the meter floating independent of the circuit under test.

Weedpharma

The arduino isn't floating. The grounds are all tied together. I am using one PSU to power everything, the arduino is on the 5v rail and the TEC is powered from the 12v rail. If I put the Arduino on a separate power supply the PWM won't work anymore unless I tied the grounds together, the driver and MOSFET have to have the ground reference.

I think that if I apply the Arduino ground to the TEC that I'll end up bypassing the MOSFET and the Arduino will suddenly (and briefly) see the full 20amps :o

I could use a second Arduino, but at that point I might as well just get a powered DC display, which might be where I'm heading. The more I look at it, the more I'm not sure it's possible to measure the voltage at the TEC without building another circuit with transformers, rectifiers ect.

You could have continued your original post.

http://forum.arduino.cc/index.php?topic=321252.0

Did you try the top detector?
Leo..

@ other posters.

I suggested this:

When the FET turns off, the drain is briefly ~12.4volt (the snubber diode dumps the flyback pulse on the 12volt rail).

During this flyback pulse, the peltier/C2 is "lifted" above the 12volt supply.
How high: 12.4volt plus the voltage on the peltier/C2.

That could be "harvested" with a top detector, and stored in a cap.
The Arduino could read that voltage, and subtract 12.4volt from it.

How well it could work will depend on the quality (hash) on the caps (C1. C2).

All theoretical, but it should work.

I hope OP has access to a scope. Without that I wouldn't even think of starting this project.
Leo..

You could invert to supply to use P type MOSFET. That way you can have an earth reference.

Weedpharma

The arduino isn't floating. The grounds are all tied together.

That rather contradicts the title of this thread.

You could connect the analogue input to the -ve input of the TEC through a potential divider. When the TEC is on you would measure 0V and when it is off you would measure 5V. Just invert this logic in software.

Hey Wawa, thanks for chiming in!

I would have continued the other post, but it had drifted pretty far afield from the initial question, it was cleaner and easier for everyone to start a fresh topic and try to keep it on track.

I did look at the top detector as you mentioned, but I don't get the peltier voltage + 12.4 anywhere (which is a good thing.... that would blow up my peltiers) unless I was just putting the scope in the wrong spot.

@Weedpharma Yeah, that is what I should have done to begin with, but at this point it's not feasible without hours and hours of work. The boards are already built to the above schematic so I am trying to get it to work this way. Hopefully I can figure something out....

@Grumpy_Mike It doesn't contradict the title at all. I am trying to measure the voltage at the TEC, where I can't reference it's ground or it bypasses the FET. The TEC - is tied to circuit ground through a MOSFET, but it still floats when in the off state. That is voltage that I want to read.
I've considered trying to measure the - TEC and compare that to circuit ground for a reading, wouldn't that pulse though? It's definitely worth looking into though as we've both come up with the same idea. Not sure how to write code that would only take the high readings and average those, but should be able to figure something out.

I'll see if I can't build a bread board of the current boards and run some tests.

Edit:
I was reading through the other thread and read a post by MikeT. Not sure if I just completely missed it last time or what.... seems to be a pretty good idea, I'll try this also once I build a test circuit.
Given the output is flying, you need a differential measurement - either a fast opamp
in differential mode, or perhaps easier you'd RC low-pass filter the two terminals of the
peltier and send them each to an ADC input (suitably scaled) and take the difference
in software.
A resistive divider with a capacitor across the lower resistor will low-pass filter and
divide at the same time. perhaps 15k upper, 10k and 100nF for the lower will
have a cut-off freq of 250Hz which will defeat the 31kHz switching frequency nicely.

lmarklar:
I did look at the top detector as you mentioned, but I don't get the peltier voltage + 12.4 anywhere (which is a good thing.... that would blow up my peltiers) unless I was just putting the scope in the wrong spot.

I think you don't understand what I mean.
Try to understand this:

The mosfet can have two states. On or off.
When the mosfet is "on", the drain is ~0volt, ground level.
When the mosfet is "off", the stored energy in L1 will try to raise the drain voltage as high as possible.
But it can't go any higher than 12.4volt, because then D1 will start to conduct.

So if you put a scope on the drain, you see a square wave of ~12.4volt top/top. 0-12.4volt.

C2 is like an elevator. The lower negative pin of C2/-peltier goes up and down, but so does the positive pin.

So if there would be a constant 8volts across the peltier, the positive pin would have a square wave between 8 and 20.4volt.
Leo..

I had a chance to do some testing this evening. I followed some suggestions from Grumpy_Mike and MikeT and I'm happy to say that I will be able to read voltage.

It will take two voltage divider circuits instead of just one, and I'm going to have to learn some more programming to get it all working, but the testing with a o-scope this evening showed that it will work great. My TEC - reacts exactly the way it should, if I have 4 volts across the TEC, I read 8 volts between circuit ground and TEC -.

I'll read the voltage from each side of the peltier and then have the arduino display the difference between the two. This will give the actual voltage since there is a slight drop on the PSU with full amperage and I can't just use a static number for the positive if I want an accurate measurement.

The low pass filter was required to smooth the voltage, there is a slight ripple on the line, but it will be easy enough to average out.

Here is the updated schematic.

Not trying to be negative, but I think this won't work.

Analogue 3 is the avarage of the PWM/switching signal, and is not really related to the peltier voltage.
It is basically Arduino's PWM signal, amplified to 12.4volt.

Analogue 4 has a square wave of "0volt to (12.4volt + peltier positive)".
That signal is all you need, but only the peak of it, not the avarage.

Post an oscilloscope picture of the signal on the peltier+ pin.
Leo..

Another way is to use an opamp to bring the differential voltage down to 0-5volt.
Leo..