4
\$\begingroup\$

I built an Arduino Uno based control panel for an altitude training machine, which connects to an oxygen sensor. The value is amplified by an instrumentation amp (INA122P) and read into the analog input of the Ardiuno, which then decides whether to open the valve or not by controlling the VLV input to the machine. The machine connects to the control panel by 3 wires; 0V, 10V and valve control (valve opens when this is 0V, closes when floating) The 10V is supplied directly to the Arduino, which supplies the rest of my circuit with 5V. The oxygen sensor (medical oxygen sensor OOM202) is a micro fuel cell which outputs a voltage between 200μV and 20mV depending on the oxygen level. Because it generates its own power, the sensor output should be the same regardless of whether or not the machine is running.

I have confirmed that the output of my amplifier is exactly what I would expect given its input, and have also tested it with a test circuit designed to simulate oxygen sensor inputs and have confirmed that it is working as intended with a gain around 200.

However, in practice, I find that an output of 10.5mV from the oxygen sensor when the compressor is powered off jumps to around 12.5mV when it is powered on, and if the wire is disconnected from the oxygen sensor, theoretically meaning the voltage should pull down to 0V, it still jumps to around 10-12mV when the machine is powered on. I should note that the output of the amplifier gives the expected result for these inputs, but the inputs are clearly wrong.

Is this electrical interference and if so, how would I go about fixing it assuming that the oxygen sensor and altitude training machine cannot be changed?

I have considered moving the machine cable terminal block to a separate breadboard, but I'd prefer to have some idea of whether or not that's going to work before attempting it, as I'm sure it's going to be very frustrating. Control panel circuit design

Here is the test circuit I constructed to test the amplifier. Amplifier test circuit simulating 0mV-20mV inputs with potentiometer

UPDATE: I troubleshooted the project as per the suggestions on this board, and I discovered that the problem was something I did not expect. The raw sensor value always jumps up when the machine starts, or when I put 5V into the amplifier circuit. I discovered that this stops happening if I remove the 20k ohm resistor (which is surprising, because the sensor's datasheet says the minimum load resistance is 10k ohm.)

I've got the circuit running pretty much as is without that resistor, although I'm now experiencing some power reliability issues when the relay clicks on. I had attempted to correct this issue by putting a 10uF capacitor on the relay output, but I'll try adding a larger capacitor across the supply voltage, which will hopefully store enough juice to keep the 7-segment display from dropping out.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Welcome to the site. " between 200μV and 20mV is" a sensitive signal, enough sensitive to pick up noise from amperes of pump operation. It will be frustrating for someone without full understanding of noise and grounding. To begin with, "isolate" the pump from the sensor and arduino. Wire the sensor + amp + arduino as close as possible. \$\endgroup\$
    – jay
    Commented Sep 1, 2021 at 3:47
  • \$\begingroup\$ I recommend disabling parts of the machine and seeing how that effects the results. If it works correctly with just the sensor, amp, and arduino then you should be able to get it to work with everything else through filtering, shielding, etc. \$\endgroup\$
    – Drew
    Commented Sep 1, 2021 at 3:57
  • \$\begingroup\$ I should point out that the actual pump has been relocated to sit outside the building (it is loud) so the supply from the pump is basically just a 0V/10V/VLV cable coming in and there is unlikely to be RF noise from inside the pump enclosure. \$\endgroup\$ Commented Sep 1, 2021 at 4:14

1 Answer 1

2
\$\begingroup\$

If this is your actual wiring, something like this would be much better. You have a differential-input instrumentation amplifier so you should use it. The way it was shown, it will measure the voltage drop in the wiring from the relay coil.

enter image description here

You can also add some RC filtering to the input of the in-amp like this:

schematic

simulate this circuit – Schematic created using CircuitLab

But it won't help if you have a DC offset.

A different point- in my experience, simple Oxygen sensors designed for use in medical applications do not read correctly at non-atmospheric pressure. We had to use a very expensive laser-based system for accurate measurements at pressures equivalent to the summit of a moderately high mountain (it was actually operating in the interior of a type of aircraft).

\$\endgroup\$
6
  • \$\begingroup\$ Thank you so much for your response. I will try it. The reading from the oxygen sensor is definitely not the problem. I am getting plausible values from the sensor when the machine is powered off. Also the device will always be operating at atmospheric pressure, so that's not an issue either. As for the wiring, I actually moved the relay to the other side of the board to see if that helped, but S- is still grounded so I will try floating it as you suggested. \$\endgroup\$ Commented Sep 1, 2021 at 4:11
  • 1
    \$\begingroup\$ I did not suggest floating it- that won't work- there needs to be a DC path for the in-amp bias currents. I suggested wiring pin 2 and pin 3 directly to the sensor inputs. Pin 2 is still grounded but there is no current flowing through the wire such that it will appear in series with the sensor mV. \$\endgroup\$ Commented Sep 1, 2021 at 4:13
  • \$\begingroup\$ I'm confused. Should I leave pin 2 connected to ground? Oh, sorry, I see now. I misread your post. \$\endgroup\$ Commented Sep 2, 2021 at 7:01
  • \$\begingroup\$ Forgive my ignorance, but aren't your changes functionally identical to what was there before? As I said, I moved the relay to the other side of the breadboard, so it is now connected directly to the ground rail. Essentially the rest of the circuit is as you showed it. I can add the noise filter, but that's not going to fix a DC offset, right? \$\endgroup\$ Commented Sep 2, 2021 at 7:08
  • 1
    \$\begingroup\$ Like, should I ground it with a 100k ohm resistor? would that reduce noise coming in from the ground rail? \$\endgroup\$ Commented Sep 2, 2021 at 7:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.