Temperature sensor

The Smart Sense temperature sensor measures temperatures between 2°C and 100°C. It is mounted in a stainless steel tube so that it can be immersed in most types of liquid.
The sensor connects to one of the analogue sensor inputs. Once the sensor is connected the Smart Move software will display the name of the sensor and label the appropriate input ‘Temp’. The screen will also display the current temperature. Try holding the end of the sensor and watch the reading change.
Using the sensor to control an output[edit]
There may be times when you want to turn on or off one of the outputs depending on the reading from the temperature sensor. One example may be to switch on a warning buzzer if the temperature of a liquid falls below a certain level. The procedure "Warning" below will turn on output 1 when the temperature falls below 15°C.
Procedure: Warning[edit]
REPEAT IF TEMP IS LESS THAN 15 THEN SWITCH ON 1 ELSE SWITCH OFF 1 FOREVER
How it works[edit]
The second line of this procedure takes a reading from the sensor and either switches on or off output 1 depending on the current value. In order to constantly check the sensor the REPEAT...FOREVER loop repeats this statement.
Data capture[edit]
The readings from the temperature sensor can be stored on disk. The procedure "Cooling" below will store the temperature once per second for 3 minutes.
Procedure: Cooling[edit]
RESET CLOCK START CLOCK FILE 1,"Cool" REPEAT STORE 1,TEMP WAIT 1 UNTIL TIME IS GREATER THAN :3:0:0 CLOSE 1
How it works[edit]
The first two lines reset and start the clock. The next line opens the file to save the reading to. Line four is the beginning of a REPEAT...UNTIL loop. This time the loop will continue until the clock has reached 3 minutes. The lines within the loop store the temperature once per second. The last line of the procedure closes the disk file.
Controlling data capture[edit]
The procedure "Night" below gives an example of data capture controlled by another sensor. In this case the temperature is only stored when the light level drops below 50. This could be used to monitor temperature and light during the night.
Procedure: Night[edit]
FILE 1,"Samples" PRINT "Logging - Press space to stop" REPEAT IF LIGHT IS LESS THAN 50 THEN STORE 1,TEMP WAIT 60 UNTIL INKEY = 32 CLOSE 1