Trouble with Sensors.
Hello all,
I have a bit of a problem and need some assistance. I am trying to
make a simple temp sensor using a thermistor. There is a sample
application on doing this in the manual. Anyway i am having some
trouble working out how to do the same thing with a bs2. The command
"Pot (Pin)(scale)(Variable) " is replaced with "RCtime
(Pin)(State)(Variable)" What does the the scale and state do? In
particular what is the difference between Scale and State? Also has
anyone done this project before with the bs2? If so could u please
tell me what changes i need to make to get it to work.
Secondly I also tried to make the temp and humidity sensor project
that is also in the manual (App. 10) and never got it to work. Can
anyone please tell me what exactly i need to change to get it to work
on a bs2.
Thanks very much for your help.
-regards
Pointybeard
__________________________________________________________________
Get your free Australian email account at http://www.start.com.au
I have a bit of a problem and need some assistance. I am trying to
make a simple temp sensor using a thermistor. There is a sample
application on doing this in the manual. Anyway i am having some
trouble working out how to do the same thing with a bs2. The command
"Pot (Pin)(scale)(Variable) " is replaced with "RCtime
(Pin)(State)(Variable)" What does the the scale and state do? In
particular what is the difference between Scale and State? Also has
anyone done this project before with the bs2? If so could u please
tell me what changes i need to make to get it to work.
Secondly I also tried to make the temp and humidity sensor project
that is also in the manual (App. 10) and never got it to work. Can
anyone please tell me what exactly i need to change to get it to work
on a bs2.
Thanks very much for your help.
-regards
Pointybeard
__________________________________________________________________
Get your free Australian email account at http://www.start.com.au
Comments
>I have a bit of a problem and need some assistance. I am trying to
>make a simple temp sensor using a thermistor. There is a sample
>application on doing this in the manual. Anyway i am having some
>trouble working out how to do the same thing with a bs2. The command
>"Pot (Pin)(scale)(Variable) " is replaced with "RCtime
>(Pin)(State)(Variable)" What does the the scale and state do? In
>particular what is the difference between Scale and State? Also has
>anyone done this project before with the bs2? If so could u please
>tell me what changes i need to make to get it to work.
The differences between POT and RCtime are explained in appendix C of the
stamp manual. If you downloaded the manual, I think the appendix is a
separate file. In short, RCtime is more powerful than POT. You need to
pick a capacitor so that the time constant R*C is on the order of 1 or 10
milliseconds. Then with the capacitor and the thermistor connected in
parallel from P0 to common, you should be able to see a response to
temperature from the following loop:
x var word
high 0
loop:
RCtime 0,1,x
high 0
debug ? x
pause 200
goto loop
The "state" parameter specifies the starting state for discharging the
capacitor. In this example state=1=high=+5 volts, and during execution of
the RCtime command the Stamp pin turns into an input, and the capacitor
discharges through the thermistor until the voltage at P0 falls down to the
stamp switching threshold of 1.3 volts. The time for that to happen is
stuffed into the variable x.
The "scale" parameter in the BS1 has no relation to the "state" parameter
for the BS2. The "scale" factor is a byte value that makes the maximum
measured time fit into one byte.
With the BS2, you still have to do the math to convert the measured
time-->resistance-->temperature.
>Secondly I also tried to make the temp and humidity sensor project
>that is also in the manual (App. 10) and never got it to work. Can
>anyone please tell me what exactly i need to change to get it to work
>on a bs2.
The program in the app-note needs the following changes.
You have to change the debug statement to,
debug ? temp,? RH
Also, leave out all the "let" keywords, and change the "symbol" definitions
to:
temp var word
RH var word
Start with the value of
temp=2500
instead of 500. The pulsout operation in the BS2 is 5 times faster than
the BS1. Also, with the BS2 the pulsin command is 5x faster, with a
resolution of 2 microseconds instead of 10 microseconds. You can dispense
with the CD4024 counter in the circuit and just use the pulsin command to
measure the pulse width from the humidity sensor directly.
On the BS2, the temperature could alternatively be read using RCtime. See
http://www.stampsinclass.com/downloads/em3.pdf
That talks about the AD590, which, like the LM335, transduces temperature
to an electrical current.
I think Matt Parnell uses the Fascinating temp/RH sensor in his
weatherstamp. You might find more programming info on his site at:
http://www.weatherstamp.com/
-- Tracy Allen
Electronically Monitored Ecosystems
http://www.emesystems.com