G McMurry
04-04-2010, 11:37 PM
QUESTION:
Is it safe to measure a negative voltage using RCTIME?
BACKGROUND:
I found an application where RCTIME could be used to measure a voltage over 5vdc by sampling it with a 680K resistor. I was worried about the high voltage damaging the BS2 input pin but after a post here found that the current limitation of the 680k would prevent any damage. I now have that working fine. Just a couple of components and you can directly measure a 12 volt battery nicely...
It occurs to me that it would always be better to use the "RCTIME Pin, 1, variable" instruction, rather than the "RCTIME Pin, 0 variable" instruction as you get a larger range to count, therefore more accuracy. I didn't think this up, it is in the RCTIME instructions in the Basic Manual...
I did a prototype of this circuit about a week ago...
http://gregssandbox.com/pics/Improving_RCTIME.jpg
The thought is that if I have a voltage to measure ( 0 to +12vdc ) it would be better to invert it using an Op Amp to ( 0 to -10vdc ) then use the above circuit and:
High Pin
RCTIME Pin, 1, variable
instruction to read the value.
Basically, I am reading a negative voltage that ranges from 0 to -12 instead of 0 to +12.
It seems to be a much more stable way to use RCTIME as an analog to digital converter and my test has been running for several days now.
Thanks!
Greg
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
AUTOMATE EVERYTHING
http://www.trainyard.net
Is it safe to measure a negative voltage using RCTIME?
BACKGROUND:
I found an application where RCTIME could be used to measure a voltage over 5vdc by sampling it with a 680K resistor. I was worried about the high voltage damaging the BS2 input pin but after a post here found that the current limitation of the 680k would prevent any damage. I now have that working fine. Just a couple of components and you can directly measure a 12 volt battery nicely...
It occurs to me that it would always be better to use the "RCTIME Pin, 1, variable" instruction, rather than the "RCTIME Pin, 0 variable" instruction as you get a larger range to count, therefore more accuracy. I didn't think this up, it is in the RCTIME instructions in the Basic Manual...
I did a prototype of this circuit about a week ago...
http://gregssandbox.com/pics/Improving_RCTIME.jpg
The thought is that if I have a voltage to measure ( 0 to +12vdc ) it would be better to invert it using an Op Amp to ( 0 to -10vdc ) then use the above circuit and:
High Pin
RCTIME Pin, 1, variable
instruction to read the value.
Basically, I am reading a negative voltage that ranges from 0 to -12 instead of 0 to +12.
It seems to be a much more stable way to use RCTIME as an analog to digital converter and my test has been running for several days now.
Thanks!
Greg
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
AUTOMATE EVERYTHING
http://www.trainyard.net