Arduino Forum

Using Arduino => Project Guidance => Topic started by: seggi on Dec 10, 2018, 07:49 am

Title: problem on analogrRead function
Post by: seggi on Dec 10, 2018, 07:49 am
 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.
Title: Re: problem on analogrRead function
Post by: UKHeliBob on Dec 10, 2018, 09:09 am
Quote
0.180V minimum and 0.608V
Maximum.
What is connected to A2 and how is it wired to GND and a voltage source ?
Title: Re: problem on analogrRead function
Post by: seggi on Dec 10, 2018, 09:45 am
output of filter is connected to a2.
Title: Re: problem on analogrRead function
Post by: Robin2 on Dec 10, 2018, 09:50 am
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.

...R
Title: Re: problem on analogrRead function
Post by: UKHeliBob on Dec 10, 2018, 11:34 am
output of filter is connected to a2.
What filter would that be and how is it connected ?
Title: Re: problem on analogrRead function
Post by: seggi on Dec 11, 2018, 07:08 am
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);
  }
}
Title: Re: problem on analogrRead function
Post by: TomGeorge on Dec 11, 2018, 08:48 am
Hi,

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html  (http://forum.arduino.cc/index.php/topic,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..... :)
Title: Re: problem on analogrRead function
Post by: Robin2 on Dec 11, 2018, 09:11 am
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.

...R