# The Digital Thermometer

## How do we measure temperature electronically?

### Learn It

• A thermistor is a thermal resistor - a resistor that changes its resistance with temperature. Technically, all resistors are thermistors - their resistance changes slightly with temperature - but the change is usually very very small and difficult to measure. Thermistors are made so that the resistance changes drastically with temperature so that it can be 100 ohms or more of change per degree!

### Learn It

• Digital signals are binary in nature.
• There are many ways to describe the signal - `On/Off`, `High/Low`, `1/0`.
• Analogue signals vary over a range of values.

### Try It

• Let's build a simple circuit to try and get a GENIE chip to detect an analogue signal.
• Use CircuitWizard to build the circuit shown below
• When opening circuit wizard, you need to choose the 'Circuit with GENIE Flowchart' option.
• You will find the Thermistor under 'sensors' in the drop down menu (temperature sensors a bit lower down in the menu).
• You will find the Genie 08 under 'microcontrollers' in the drop down menu.
• This circuit has an thermistor connected to the analogue input of the GENIE chip.
• A thermal resistor (thermistor) is a resistor that responds to changes in temperature.
• When the temperature is high, the resistance is low.
• When the temperature low, the resistance is high.
• This is known as a NTC (negative temperature coefficient) thermistor, which is indicated with the -t in the symbol.
• A PTC (positive temperature coefficient) thermistor will increase resistance with temperature and visa-versa.
• In theory we should be able to use the GENIE chip to detect temperature levels.
• So that we can simulate the circuit, we need to give the GENIE chip a program.
• Use this loop.
• Micro-controllers can't detect resistances, they only read voltages. Let's have a look at the voltage drop between the input pin and ground for out circuit.
• Recreate this circuit in Circuit Wizard and have a look at the voltage differences that are generated when the temperature levels reaching the thermistor are altered.
• You will be able to view the analogue value changing when you change the light level by clicking on the 'View several monitor panes at once', this is on the right, highlighted in blue.
• The voltmeter (V) can be found under 'Test Instruments' right at the bottom of the gallery.

• As you can see, altering the temperature levels at the thermistor has a minimal to no effect on the voltage at the pin. While we could use a setup like this, we'd have a very insensitive detector.

### Learn It

• There's a way to provide a larger voltage differential at the pin, by adding a single resistor to the circuit.
• We're going to create something called a potential divider.
• The visualisation below shows a standard set up for a potential divider. You can use the slider to alter the resistance of the thermistor, and type in values for the resistor beneath it. Look at what happens to the voltage readings for Vout_.

• Now you know how to set up an analogue sensor on the GENIE chip, use Circuit Wizard to create a temperature monitoring circuit.
• We'll also need a switch connected to a digital input. You've done this before when you made the digital die. Have a look at this resource if you need reminding about digital inputs.
• Once you've completed the inputs for the circuit, take a screenshot.

## 2 Setting up visual outputs

### Try It

• We're going to need a couple of LEDs (one red and one green) attached to the digital outputs of the GENIE chip.
• Don't forget that LEDs are sensitive to large currents can can 'pop' if the current is too high. A couple of 330 Ω resistors should be sufficient to protect them