Temperature

By Robert Sprowson

Originally published in EUG #39

Getting a digital value into your BBC to represent the temperature of some physical object is made simplicity itself by attaching a ready made board to your Beeb. Before, the alternative approach would be to use the analogue port to read from a thermistor of similar device - but which would be hard to calibrate.

This module allows temperature data to be shifted into the BBC as a background task, while you continue to use the machine for another purpose. This could be of use in (for example) a shop, where the BBC was used for stocktaking while also monitoring (and saving) the temperature of chillers for hygiene reasons. Or monitoring the temperature of your green house while typing a letter to your aunt!

Parts

The circuit diagram shows electrically how to assemble the unit. It requires the following parts:

  1xReady built module (Maplin order code: FE33L9x ZTX300 NPN switching transistors)
9x10k pull up resistors
9x1.2k base resistors

In addition, it may be useful to have a handful of pins, a user port plug and a couple of feet of ribbon cable.

Benefits

  • Software-selectable sample rate, mode, and hi/lo point
  • Runs off a single AA battery
  • Choice of Celsius or Fahrenheit
  • Separate 'hi alarm point reached' and 'lo alarm point reached' pins

Build

  1. Join from the pre-made module to your board with a short length of 14 way ribbon cable, noting which wire is ground.
  2. Attach the resistors and transistors from the output from the BBC User Port to the control lines on the module. The REM statements at the start of the software and the hints section below tell you which is which. Note PB7 was not needed.
  3. Do the same again in the opposite manner for the data and clock inputs from the temperature module back into the BBC's interrupt lines, CB1 and CB2.
  4. Ensure that both 0v lines on the BBC and temperature module are joined together.

Hints

  • You might want to add a three small (1.5v) piezo buzzers to the alarm point pins, pin 6, 7 and 15. Otherwise, just leave them unconnected. Ground is pin 1.
  • The software can easily be modified if you made a mistake wiring up the pins though I suggest:
  •   PB0 = show lo point => module pin 13
    PB1 = show hi point => module pin 12
    PB2 = celcius/fahrenheit => module pin 14
    PB3 = sample rate select => module pin 5
    PB4 = set hours => module pin 2
    PB5 = set mins => module pin 3
    PB6 = clock/temperature => module pin 11
    CB1 = data => module pin 9
    CB2 = data load clock => module pin 10

    Robert Sprowson, EUG #39