Detecting a voltage to sensor

Hii everyone,
I want to know the voltage of sensor I write the code its working fine on normal state of sensor but
I blocked the ir sensor the voltage is increase .5v , the board should not detect the blocked sensor voltage , So how to detected the voltage please suggest me.`
This is a code , I Used Atmega 2560

``
int value = 0;
float voltage;

void setup(){
Serial.begin(9600);
}

void loop(){
value = analogRead(A0);
voltage = value * 5.0/1023;
Serial.print("Voltage= ");
Serial.println(voltage);
delay(500);
}

Please post a link to the sensor product page or data sheet, and a wiring diagram (hand drawn is preferred, with pins and connections clearly labeled).

1 Like

I have no idea about sensor just in sensor just given a voltage of 2.8v on normal state and in blocking state the sensor given 3.2v check with multimeter and the sensor has two- 1 pin is common grounding and other for taking output from sensor

And neither do we! So is this a guessing game or do you really want some help with something Arduino related?

1 Like

If voltage > 3.0V then is blocked

If voltage < 3.0V then is NOT blocked.

Thanks for reply,
Yes i really want help
I Know some reading of sensor data


This is the reading of blocking the sensor**(the sensor is blocked**)


This reading is sensor on normal state if sensor is not blocked

Since I can't actually read what the pictures show, tell us why you know the difference and if you know the difference, where is your problem?

1 Like

So the problem is this:

When connected to the Arduino A0 pin it always reads 1.86V but when you read it with a voltmeter, it changes from 2.8V to 3.2V

Am I correct?

1 Like

yes

that should not showing the difference they were two cases:
1.In first case i worked with normal cases that the normal case we should present the default case 1.86v repeated many times then 0 will coming in normal state

2.In second case they should worked on blocking the sensor in blocking state the sensor has no default values are given send in documentation .

Sorry, that makes no sense to ma at all!

Post a schematic and picture of DUT.
A picture is worth 1000 words.

1 Like

post a schematic please, and a link to your "sensor" data sheet

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.