analogreference...

hi,

i'm using analogReference(INTERNAL1V1) on my arduino mega, can you tell me why analog read on a0 value is equal to 1023 instead of 0 when there is no input connected ? thanks for your help.

here is the file.

lambda2.ino (1.51 KB)

hello ronron84

ronron84: hi,

i'm using analogReference(INTERNAL1V1) on my arduino mega, can you tell me why analog read on a0 value is equal to 1023 instead of 0 when there is no input connected ? thanks for your help.

When nothing is connected to an analog input, the result is unpredictable, due to the impedance of the input.

Regards, bidouilleelec

thanks for your answer, i've test my lambda O2 Sensor with a voltmetre and sensor work ok, but when i use the sketch the value i have are completely wrong it's stated at 1.1v instead of 0, when it get hot the value is going down to zero and stay at zero.

Regards, Ronron

ronron84: ..., but when i use the sketch the value i have are completely wrong it's stated at 1.1v instead of 0, when it get hot the value is going down to zero and stay at zero.

Regards, Ronron

You should post the characteristics and reference of your sensor and a schematic of your circuit.

Regards, bidouilleelec

The oxygen sensor produces a very non linear ( logarthmic) out dependant on the difference in oxygen at the probe verses outside atmosphere. When the sensor is cold , its impedance is very high and you won’t get a sensible reading. If it’s not in a running car you would expect the output to fall to 0v when it’s hot . The maximum output is around 1.1volts with “ zero” Oxygen on one side.

Having said all that check your AO with a voltage source to check your codes is working correctly

thanks for your help :) :) :) , the réf of the sensor is : https://fr.aliexpress.com/item/4-fil-Universel-O2-Capteur-D-oxyg-ne-Pour-Citroen-Pour-Ford-pour-Hyundai-Renault-pour/32959794512.html?spm=a2g0s.9042311.0.0.40696c37z49dp2

I've tested this morning with a voltmeter, and i 've seen that the signal is inverted... black is ground and grey is signal.

with a blow lamp i made it works ! when it's hot it's starting at 0.2mv and stop at 1 v. :) now, I'm going to put a presure sensor for the carburator and a flow meter, to estimate my fuel consomption.

I've to find those sensors now...