Week 12 : Input devices


Input devices

Assignment

Group assignment:

Probe an input device’s analog levels and digital signals.

As a demonstration, we tried to probe signals from two differents temperature sensors :

Analog sensor

This is a simple NTC resistor, on a module with pull-up resitor. NTC stands for “Negative Temperature Coefficient” wich means that when temperature increases, the resitor value is decreasing.

The NTC resistor reference is NTC-MF52 3950 from Electronic Alliance.

First, we tested the sensor with the Arduino example code “AnalogReadSerial”. The signal pin is wired to A0.

Wiring picture

Then we disconnected signal from the Arduino an wired it to a multimeter set as voltmeter :

Voltmeter signal picture Voltmeter signal picture

At room temperature (26°C), the voltmeter is measuring 2.44v. When heated with a hot-air gun, we get 0.33v. This is what we should expect from a NTC resistor.

Digital sensor

The DS18B20 is a digital temperature sensor that uses 1-wire interface, so it requires only one port pin for communication.

The sensor is wired to an Arduino Uno. The code is from the matmunk’s DS18B20 library documentation.

Here is the connection to the oscilloscope :

Wiring picture

On the first picture, we see the signal with the sensor connected to a 5v supply but not connected to the Arduino.

On the second picture, the sensor’s signal output is connected to the Arduino pin 2.

Oscilloscope signal picture Oscilloscope signal picture

We can assume that the DS18B20 is not working as stand-alone but it needs a trigger from a microcontroller to operate.

When we add a 200ms delay to the code, we can see that transmission stops during that delay. Also, we can measure the packet transmission time wich is around 750ms.

Wiring picture