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)
... 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?
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
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.
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 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.
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.
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.
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..