Page 1 of 1

Analog To digital

Posted: Wed May 27, 2020 3:38 pm
by jollybv
Hi Guys

This is the first time I'm working with the A/D, I'm working with a 5v PSU the input voltage is connected to (A0) with a 10mv / degree input voltage. What has lost me is once you read the value then you multiply it by 500 Temp = fmul (ATD, 500) this is what I have seen in some examples. Should I not multiply it by 100 instead Temp = fmul (ATD, 100) which will display 1 degree for every 10mv. If I have got this all wrong and it has something to do with the power supply voltage then could someone please explain it to me

Re: Analog To digital

Posted: Wed May 27, 2020 5:32 pm
by medelec35
Hi jollybv,
This explains why I use *49 /10.
There is a better way than using a formula
Take a look a both posts on here
Makes life easier for you. :D

Re: Analog To digital

Posted: Thu May 28, 2020 9:47 am
by jollybv
Hi Martin

Thanks let me give the temp = temp *49 / 10 a try, as I see the remapping is for Arduino and I'm working with PIC. I did try the remapping but could not find user

Re: Analog To digital

Posted: Thu May 28, 2020 12:08 pm
by medelec35
jollybv wrote:as I see the remapping is for Arduino
No not at all.
Mapping is for all target devices including PIC.
The test file I attached is tried on PIC hardware.
jollybv wrote: I did try the remapping but could not find user
It is intended for Flowcode V8 only.
Just tried and will not work on for V7.
If your flowchart does not work with the formula, then I will take a look at it for you.

Re: Analog To digital

Posted: Sat May 30, 2020 10:07 am
by jollybv
Hi Martin

I have used the formula it works quite nicely but the accuracy is about 2 degrees off. What I have done to try to solve the problem is after temp = temp / 10 I add 2 to temp.
Also, do you perhaps know how I would go about making a temperature PID