Hello. once more Guru's.
Having a good go effectively at moisture detection utilizing TOUCH16. It is appearing a little trickier than I had hoped.
I am looking at using TOUCH16 as a way in determining from DRY thru to SATURATED media, 100% non-contact through plastic. I 'think' I have the sensing component under control, however my current issue is operating my circuit from a battery. Varying the bench supply voltage changes my sensed values as one would expect.
With an 08M2, I am currently experimenting using a 100K pullup with a 1N4148 (cathode to GND) as a very low fixed external reference and then acquiring a value from this reference by a READADC10 (C.1) command and finally deducting this reference value from the TOUCH16 (C.4) value. As I am sure you would be aware, as the supply voltage drops, the ADC and TOUCH16 values go up and vice versa as the supply voltage increases.
I need to null out this varying factor as I would like to operate this particular sensing circuit from a CR2032 button cell.
This is a background project I have been working on/off since early May 2019. The test circuit has, since May, been and continues to run 24/7 on a CR2032. By using NAP 5 in my CODE loop, I can confirm at 12-12-2019, the CR2032 is still holding up quite well at 2.927VDC measured today at V+ (pin1) and GND (pin8) of the 08M2 with a FLUKE 79III whilst in it's ongoing operational state.
I am reasonably confident I am going the wrong way about trying to compensate the varying supply voltage in my CODE as it is bluntly not working as I had hoped. It has dramatically helped, but there is still variance when varying the supply voltage. To avoid confusion of what I have mentioned above, I have one circuit running on a CR2032 and another identical circuit I am working on with the bench supply. The circuit running on the battery does not currently have the 100K pullup & 1N4148 reference.
Further to note, I do know,understand and appreciate the 100K/1N4148 is NOT a precision reference and measurements do show this reference varying with supply variation. The question is, if I was to use a precision reference such as:
Will I null out this variance? And, am I going to the right way about compensation in my CODE?
For varying (pun intended ) reasons I cannot disclose the ACTUAL program code, but here is some highly modified and extremely simplified code that expresses my dilemma.
Another issue I have identified is that the values sensed are different from having the AXE027 programming cable plugged into the circuit or not. That too is a bit of an unhelpful bummer.
I am expecting you to talk of the FVR. I haven't really got my head around using the FVR. I had a play with it but found while varying the supply voltage, the FVR value always remained the same and that didn't make sense to me. Hence the 100K/1N4148 as reference.
Regards,
Mort.
Having a good go effectively at moisture detection utilizing TOUCH16. It is appearing a little trickier than I had hoped.
I am looking at using TOUCH16 as a way in determining from DRY thru to SATURATED media, 100% non-contact through plastic. I 'think' I have the sensing component under control, however my current issue is operating my circuit from a battery. Varying the bench supply voltage changes my sensed values as one would expect.
With an 08M2, I am currently experimenting using a 100K pullup with a 1N4148 (cathode to GND) as a very low fixed external reference and then acquiring a value from this reference by a READADC10 (C.1) command and finally deducting this reference value from the TOUCH16 (C.4) value. As I am sure you would be aware, as the supply voltage drops, the ADC and TOUCH16 values go up and vice versa as the supply voltage increases.
I need to null out this varying factor as I would like to operate this particular sensing circuit from a CR2032 button cell.
This is a background project I have been working on/off since early May 2019. The test circuit has, since May, been and continues to run 24/7 on a CR2032. By using NAP 5 in my CODE loop, I can confirm at 12-12-2019, the CR2032 is still holding up quite well at 2.927VDC measured today at V+ (pin1) and GND (pin8) of the 08M2 with a FLUKE 79III whilst in it's ongoing operational state.
I am reasonably confident I am going the wrong way about trying to compensate the varying supply voltage in my CODE as it is bluntly not working as I had hoped. It has dramatically helped, but there is still variance when varying the supply voltage. To avoid confusion of what I have mentioned above, I have one circuit running on a CR2032 and another identical circuit I am working on with the bench supply. The circuit running on the battery does not currently have the 100K pullup & 1N4148 reference.
Further to note, I do know,understand and appreciate the 100K/1N4148 is NOT a precision reference and measurements do show this reference varying with supply variation. The question is, if I was to use a precision reference such as:
Will I null out this variance? And, am I going to the right way about compensation in my CODE?
For varying (pun intended ) reasons I cannot disclose the ACTUAL program code, but here is some highly modified and extremely simplified code that expresses my dilemma.
Code:
init:
disablebod
setfreq m32
symbol onthreshold=24330
symbol offthreshold=24260
main:
readadc10 c.1,w4
touch16 [%00010001],c.4,w1
let w2=w1-w4
sertxd("Ref: ",#w4,", Sense: ",#w2,cr)
if w2>onthreshold then gosub wet
nap 5
goto main
wet:
high c.2
readadc10 c.1,w4
touch16 [%00010001],c.4,w1
let w2=w1-w4
sertxd("ON - Ref: ",#w4,", Sense: ",#w2,cr)
if w2<offthreshold then low c.2 return endif
goto wet
I am expecting you to talk of the FVR. I haven't really got my head around using the FVR. I had a play with it but found while varying the supply voltage, the FVR value always remained the same and that didn't make sense to me. Hence the 100K/1N4148 as reference.
Regards,
Mort.