problem on analogrRead function

Hello Guys,

i am using the arduino nano board and read the a2 pin . i am using the visigenie library .

whenever i check the voltage on pin through the hardware i was gotten the 0.180V minimum and 0.608V Maximum.

and i am trying to do is on a minimum voltage i.e. 0.180 i have fixed it the resolution steps i.e.1023/5*0.180=36.82 steps and on Maximum 1023/5*0.608=124.3steps

i am doing the if steps is less then the 50 steps on a genie display led is off and greater then 120 steps led will be on .

but they behaving inappropriately . they cant read the steps. the steps are continuously changes and i am getting the no difference on minimum voltage or maximum voltage .

How can i fix it these problem . please guide me.

Best Regards, Seggi.

0.180V minimum and 0.608V Maximum.

What is connected to A2 and how is it wired to GND and a voltage source ?

output of filter is connected to a2.

seggi: please guide me.

How can we guide you when you have not posted your program nor have you given any details of the output of the progrram.

And what on earth does "output of filter" mean.

C'mon, if you want help you need to provide useful information.


seggi: output of filter is connected to a2.

What filter would that be and how is it connected ?

Hello Guys, Below i am posted the code for this

void overrange() { overval=analogRead(A2); delay(100); genie.WriteStr(2, overval); delay(100); if (overval>=102) { genie.WriteObject(GENIE_OBJ_USER_LED, 2, 1); } else if (OverRange <= 100) { genie.WriteObject(GENIE_OBJ_USER_LED, 2, 0); } }


Please read the first post in any forum entitled how to use this forum.,148850.0.html then look down to item #7 about how to post your code. It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Did you write your code in stages, getting each stage working before starting the next?

What is "visigenie", post a link please.

Have you written some SIMPLE code that JUST READS A2 and sends the result to the Serial Monitor.

Lets first see if the problem is the input, forget about "visigenie" and everything else.

Tom..... :)

seggi: Hello Guys, Below i am posted the code for this

That is not a complete program. Problems are often in the other part - else you would have already found them.