University of Melbourne · FACULTY OF ENGINEERING

ENGR10006 Chap.7 Signals, Sensors and Analog-to-Digital Conversion

- one subject, every graph, every model, every mark
8 Chapters5-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 7 of 13 · ENGR10006

Signals, Sensors and Analog-to-Digital Conversion

The robot reads the world through two QTI infrared line sensors and a PING ultrasonic distance sensor, and every reading passes through analog-to-digital conversion before Stateflow can use it. This chapter explains analog versus digital signals and why binary dominates, converts between binary and decimal, and models a sensor as an affine map f(x) = ax + b with sensitivity and bias that calibration must find.

It covers sampling and quantisation, bits per sample as the ceiling of log base 2 of the number of levels, and bit rate as sample rate times bits per sample, with the robot's 10-bit IR values from 0 to 1023. It closes with the ultrasonic sensor's 40 kHz chirp, its echo-time output and the situations in which it cannot be trusted.

Worked examples calibrate an IR threshold and size the storage for a logged run, with practice in base conversion and sensor limits.

In this chapter

What this chapter covers

  • 01

    Analog and digital signals

  • 02

    Binary and decimal conversion

  • 03

    Affine sensor maps and inversion

  • 04

    IR line sensors and calibration

  • 05

    Sampling and quantisation

  • 06

    Bit rate and storage

  • 07

    Ultrasonic distance sensing

  • 08

    Noise sources in sensor readings

Worked example · free

Inverting an affine sensor map to recover distance

Q [3 marks]. A distance sensor follows the affine map f(x) = 0.05x + 0.20, giving volts for a distance x in centimetres, so its sensitivity is 0.05 V per cm and its bias 0.20 V. Find the distance for readings of 1.45 V and 0.95 V, and the reading you would expect at 40 cm. Marks are AskSia practice weightings, not a University scheme.
The blue line is an illustrative sensor with sensitivity 0.05 V per cm and bias 0.20 V; the dashed orange path reads a 1.45 V output back to a distance of 25 cmThe blue line is an illustrative sensor with sensitivity 0.05 V per cm and bias 0.20 V; the dashed orange path reads a 1.45 V output back to a distance of 25 cm on the horizontal axis.1.45 V0.20 V25 cmf(x) = 0.05x + 0.20distance x in cmvoltage
The blue line is an illustrative sensor with sensitivity 0.05 V per cm and bias 0.20 V; the dashed orange path reads a 1.45 V output back to a distance of 25 cm on the horizontal axis.
  • +1Invert the map: x = (f(x) - b) / a. For 1.45 V, x = (1.45 - 0.20) / 0.05 = 25 cm.
  • +1For 0.95 V, x = (0.95 - 0.20) / 0.05 = 15 cm.
  • +1Forward map at 40 cm: f = 0.05 × 40 + 0.20 = 2.20 V. Check by inverting: (2.20 - 0.20) / 0.05 = 40 cm.
25 cm and 15 cm; 40 cm gives 2.20 V.
Sia tip — Subtract the bias before dividing by the sensitivity; dividing first is the most common slip.
Glossary

Key terms

Analog signal
A signal carried by a continuous variable that can take infinitely many values.
Digital signal
A signal limited to a small set of distinct values, most often two.
Sensitivity
The slope a of an affine sensor map, the change in output per unit of the measured quantity.
Bias
The offset b of an affine sensor map, the output when the measured quantity is zero.
Sampling
Taking values of a signal at regular times, faster than the signal varies.
Bit rate
The number of bits produced per second, equal to sample rate times bits per sample.
Ultrasonic
Sound above 20 kHz, beyond the range of human hearing.
QTI sensor
The infrared reflectance sensor the robot uses to locate the tape line.
FAQ

Signals, Sensors and Analog-to-Digital Conversion FAQ

Why does the tape give a smaller IR reading than the board?

The Workshop 5 hint states that the sensor value is inversely proportional to the reflected light reading. The light tape reflects more infrared than the dark surface, so the sensor over the tape returns the lower number, and thresholds must be set with that direction in mind.

How do I find the number of bits per sample?

Find the smallest whole number of bits that can label every quantisation level: the ceiling of log base 2 of the number of levels. 256 levels need 8 bits and 1024 levels need 10 bits, which is why the robot's IR readings run from 0 to 1023.

When is the ultrasonic sensor unreliable?

The slides list objects more than 3 m away, reflective surfaces at a shallow angle that send sound elsewhere, objects too small to reflect enough sound, and floor echoes when the sensor is mounted low. Design object detection with those cases in mind.

Does bright room light affect line following?

Bright light adds a roughly fixed amount to both IR readings. The steering error uses their difference, so it is largely unaffected, but detecting T-intersections can be. Workshop 9 suggests initialisation states that sample light and dark surfaces, with defaults if sampling fails.

Study strategy

Assessment move

Make the conversions automatic first. Practise binary to decimal by adding powers of 2 and decimal to binary by repeated division, checking each answer by converting back. Then rehearse the A/D chain with your own numbers: levels to bits, bits and sample rate to bit rate, bit rate and duration to storage in bytes.

For sensors, write the affine model, then invert it to recover distance, and remember that some sensors need a curve rather than a line. Calibrate your robot's IR sensors on the real track, recording at least three positions for each sensor, and derive thresholds from the measured values rather than copying another team's.

For the ultrasonic sensor, test the distance threshold with real objects at the angles they will appear on the track. Record these tests with dates and lighting conditions, because the report asks for evidence of robust testing. Before the robot quiz, rework each conversion type once with new numbers and check every answer in the opposite direction.

Note the lighting in the room beside every calibration so you can explain any drift later.

A+Everything unlocked
Unlocks this Bible + all 181 of your University of Melbourne subjects - and 1,000+ Bibles across every Australian university.
Sia - your ENGR10006 tutor, unlimited, worked the way the exam marks it
The full 5-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works