I have set up a Picaxe 28xi to measure differential pressure, read from 2 x 0-5V output pressure transducers. I'm reading at around 10% of the range of the transducers (bought cheap), so keen to use ReadADC10 rather than muck around with op amps, the final result will be accurate enough for my purposes.
This has been causing me no end of grief. I have been wrestling with the code to find a flaw in the calculation, but after a day of frustration that does not appear to have been it. I had a simple calculation that subtracted the higher value from the lower one, but kept getting significant readings showing up for the lower transducer, when there was nothing connected to it.
I am currently simulating the higher pressure reading with a 10K potentiometer across 5V as a voltage divider.
I finally simplified my code to the following,
I still ended up getting readings back when there is absolutely nothing connected, and the multimeter shows 0V on the input. Same garbage via I2C to the LCD display. The readings for the unconnected port show about 1/3 of the one with the potentiometer. When at about 4.5V on the potentiometer going into one port, the SERTXD reading gives me about 900 - 1000 as expected (Word Variable) and the other unconnected pot, showing 0.0V on the multimeter, with nothing connected gives about 300. Roughly the same ratio accrosss the range. Same thing happens when i switch the potentiometer over to the other port. The size of the values is just too great and too consistent to be due to a spurious reading.
I suspected that the Picaxe may have been previously damaged due to overvoltage on the input (a previous embarrassing thread) but i swapped the picaxes, and had the same result on the uncooked one as the cooked one.
What is happening?
Is there a fix?
This has been causing me no end of grief. I have been wrestling with the code to find a flaw in the calculation, but after a day of frustration that does not appear to have been it. I had a simple calculation that subtracted the higher value from the lower one, but kept getting significant readings showing up for the lower transducer, when there was nothing connected to it.
I am currently simulating the higher pressure reading with a 10K potentiometer across 5V as a voltage divider.
I finally simplified my code to the following,
Code:
symbol data3 = b3
symbol dataw1 = w1 '(b2 + b3)
symbol dataw2 = w2 '(b4 + b5)
symbol dataw3 = w3 '(b6 + b7)
Main:
readadc10 0,w1 'Pressure Tank, temporary variable
pause 30
readadc10 1,w2 'Pressure Return Manifold
pause 30
sertxd (#dataw1," ",#dataw2, " ",13,10)
pause 500
goto main
I suspected that the Picaxe may have been previously damaged due to overvoltage on the input (a previous embarrassing thread) but i swapped the picaxes, and had the same result on the uncooked one as the cooked one.
What is happening?
Is there a fix?