I've been working on a circuit which converts a bi-polar signal with a range of -0.177 to +0.177 to the range of the Arduino ADC 0 - 5V. I have managed to configure the gain and offset to achieve this. I am getting the correct output from the Op amp which I've confirmed with a multimeter. Thinking it was plain sailing from here I connected the output from the op amp to the A0 on my Arduino UNO, and then the GND on the UNO to the ground of the Op Amp circuit.
The readings vary greatly compared to the steady voltage reading I am getting from my multimeter. The voltage on the Arduino swings in both directions. It is completely off the reading I am getting from my Multimeter.
The Op amp requires both negative and positive power. I created a split power supply using an 9AC transformer, diodes, voltage regulators and some capacitors to smooth out the high frequency noise. Transforming mains AC in to a + 12 and -12 rail. I have tested the output of the power supply rails and they are giving a steady DC voltage.
I do not have an oscilloscope at hand but will be testing the output of the op amp tomorrow when I go in to university. Electronics is not my main subject of study but I thought I would have a go for my current project which is more computer science than electronics.
I'll get a diagram up here to make it easier if it's needed, I just wondered if there was anything obvious I was missing?
Yes, a drawing would be useful. While it sounds like you have done everything correctly, I can only think that you are not taking the signal off from the correct part of the op-amp circuit. Again a drawing is worth a thousand words. An arduino analog input pin wants to see a source driving impedenance of 10K ohms or lower, otherwise drift and or noise can enter the picture. Most op-amp output stages can meet that spec, but?
IMHO, you are getting AC signal from the output. Better to verify with oscilloscope, or meanwhile you can switch DMM to AC, and connect via cap (1 - 10 uF) to output of the OPA, see if there is anything. Probably mains 50/60 Hz, if not filtered properly from power supply. Other way to check how "clean" signal, try this DIY oscilloscope: http://oscilloscopeexpress.blogspot.com/
Oops, yes I forgot to draw the connection on the diagram. Diagram now updated
Well it's reassuring that it looks fine. I think I'll pull the curcuit apart and build it from scratch.
updated
Ok so I have tested the rails from the power supply using the same 10uF capacitor method to check for AC signal. The rails output 3mV when the DDM is switched to AC mode, could this small amount be causing the problem? When switched to DC no voltage is coming through as expected.
Ahh! thanks!, I will supply both -v and +v with 12V. The split supply is still required for the negative bias voltage. I'll just put things togeather and hopefully it will all be good.
If I'm not mistaken, you can't supply more than +-8V (V+ - V- < 16)
Ok so should I split the +V 12 rail with a voltage divider then supply to the +V and -V inputs with output of the divider? So there is +6V on both opamp input puts?
Better way is to replace TS7812/TS7912 chips with lower voltage rated TS7805/TS7905 in power supply. edit:
And change polarity on the caps on negative rail.
Hope polarity on negative supply caps is a typo ... Gnd is more positive than the negative supply rail; You may have already decomposed the caps by installing in reverse ... might be unsafe to use them now, especially without fuses ... protect your transformer!!! I've seen electrolytics outgas and blow the red-hot foil coil out onto the floor!
sudokodo:
Hope polarity on negative supply caps is a typo ... Gnd is more positive than the negative supply rail; You may have already decomposed the caps by installing in reverse ... might be unsafe to use them now, especially without fuses ... protect your transformer!!! I've seen electrolytics outgas and blow the red-hot foil coil out onto the floor!
It was a typo, thankfully
Just testing the circuit again now. Looks like the AC singal is being introduced by the pH probe source connected to the non inverting input of the opamp.
Update
Success! I kept the orginal circuit and managed to stablise the signal with software; getting a reading in spite of the AC interference.
I took 200 readings keeping track of the highest and lowest values read. Then found the mean, the mean is actually the DC output from the opamp! AC interference is modulating around the DC.
Part of the problem you are seeing is that fact that most raw Ph probes are very very high impedeance and external common mode noise to the first op-amp input has to be dealt with. It's almost universal to utilize a differential input instrumentation op-amp to process the raw Ph signal. These kinds of op-amps have very high CMRR (common mode rejection ratio) that allow cancelation of common mode ac noise. If you google around about Ph probe circuits I'm sure you find many examples of proberly designed op-amp circuits used to read Ph probes.
retrolefty:
Part of the problem you are seeing is that fact that most raw Ph probes are very very high impedeance and external common mode noise to the first op-amp input has to be dealt with. It's almost universal to utilize a differential input instrumentation op-amp to process the raw Ph signal. These kinds of op-amps have very high CMRR (common mode rejection ratio) that allow cancelation of common mode ac noise. If you google around about Ph probe circuits I'm sure you find many examples of proberly designed op-amp circuits used to read Ph probes.
Lefty
Interesting stuff, I've just been reading about this problem. I looks like lowering the voltage will help reduce common mode noise. The op amp I am using was reccomened for a pH meter on another site.
I had no idea about impedance when I first started this project, the pH probe I am using has an input resistance of of 250M I could not get a reading until I changed to this opamp which has an imput inpedance of 10 Terra Ohms. Overkill?
The data sheet says CMRR:
0V ? VCM ? 12.0V: 75 dB
V = 15V: 72 dB
It's more to write up about for my project document. I may just leave it now as I can clean and configure it in software.
While the LMCs are great little amps they need some extra steps to get them suitable for our needs when reading instruments such as a pH probe. In our various experiments we found placing an LMC 6042 into an instrumentation amplifier configuration worked quite well, but we also found the simple amp (such as the common basic pH circuit with the tl0xx series circuit out there) to work quite well too actually, especially when paired with a 3.3v adc config for a bit more resolution and some stability and noise filtering added.
There is also the OPA-129 which ircc is a differential amp IC, but requires special layout considerations and can be quite pricey. I still need to update our pH probe tutorial to reflect some of this info as we have been testing a few designs out in the field to see how they perform. And have quite a bit of info to add to it. The ST TL072 basic design is plenty accurate enough to keep fish and plants alive for instance, but isn’t the best choice for chemistry or detailed lab experiments.