University of Technology Sydney · FACULTY OF ENGINEERING

41099 Chap.6 Analog input, ADC resolution and pulse width modulation

- one subject, every graph, every model, every mark
5 Chapters3-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 6 of 8 · 41099

Analog input, ADC resolution and pulse width modulation

In this chapter

What this chapter covers

  • 01

    Two voltage levels on a digital pin against a continuous range on an analog pin

  • 02

    Resolution: 1024 codes, a range of 0 to 1023 and a step of 4.9 millivolts

  • 03

    Converting a code to a voltage and a voltage to a code

  • 04

    Reading a resistive sensor through a divider, and choosing the fixed partner

  • 05

    Producing an average rather than a voltage, and the loads that can average it

Worked example · free

Turn a changing resistance into a code, and read the useful span

Q [8 marks]. AskSia assigns eight practice points to this independent exercise; they are not a University marking scheme. A light dependent resistor sits between a 5.00 V supply and an analog pin, with a fixed 100 kilohm resistor from that pin to ground. It measures 150 kilohms in a dim room and 12 kilohms under a desk lamp. What does the board read in each case?
  • 2Identify which element of the divider the pin voltage appears across.
  • 3Apply the divider ratio for the dim case and convert to a code.
  • 3Repeat for the bright case and comment on the resulting span.
The pin reads the drop across the fixed 100 kilohm resistor, which is the lower element. In the dim room the ratio is 100 over 250, so the voltage is 2.00 V, which is code 410 after dividing by 4.8828 millivolts. Under the lamp the ratio is 100 over 112, so the voltage is 4.46 V, which is code 913. The useful range is therefore roughly 410 to 913, about half the converter's span. Changing the fixed partner moves that window: a smaller fixed resistor shifts readings down and suits brighter conditions.
Sia tip — Record the codes your own sensor produces in the bright and dark states of the room you will demonstrate in, then place the threshold between those two measured numbers rather than at a value that sounded reasonable.
Glossary

Key terms

Analog signal
An electrical signal whose voltage can take any value in a continuous range.
Resolution
The size of the smallest input change a converter can report as a different code.
Quantisation
The mapping of a continuous input onto a finite set of integer codes.
Light dependent resistor
A resistor whose resistance falls as the light falling on it increases.
Duty cycle
The fraction of each switching period for which the output is at its high level.
Average voltage
The mean level a slow load experiences from a switched output, equal to the duty fraction times the supply.
Fixed partner
The constant resistor placed with a sensor to turn its changing resistance into a changing voltage.
FAQ

Analog input, ADC resolution and pulse width modulation FAQ

Does a higher resolution mean a more accurate reading?

Not by itself. Resolution is the smallest change the converter can report, while accuracy is whether the code corresponds to the voltage you believe it does. That depends on how steady the reference supply is and on noise along the way. In practice the last code or two wander even with a still input, which is why a threshold set exactly at a measured boundary chatters.

Why does a resistive sensor need a fixed resistor beside it?

Because the input measures voltage and the sensor changes resistance. Placing the two in series across the supply turns the changing resistance into a changing voltage at their junction, which is something the converter can read. The course materials give the arrangement directly: the sensor to the supply, the junction to the analog pin and that same pin to ground through a fixed resistor.

How is the fixed partner resistance chosen?

Place it near the middle of the sensor's working range, so that the steepest part of the response sits where your readings actually live. Two groups running identical code can obtain different thresholds purely because they chose different partners, and the group that can explain the choice is the one that can also explain the difference.

Does the board really produce an intermediate voltage when fading a light?

No. Its only output levels are the supply and ground. What varies is the fraction of each cycle spent at the high level, and a slow load such as an eye or a motor winding averages that into an apparent intermediate value. Measured with a fast instrument the pin is still snapping between the two levels.

Why does a multimeter read about half the supply on a half duty output?

Because it reports a time average rather than an instantaneous level, and the average of a half duty square wave is half the supply. That is the same reading a genuine intermediate source would give, so the measurement cannot distinguish the two. An oscilloscope settles it immediately by showing the square waveform.

How do you convert a sensor reading into an output level?

Take the reading as a fraction of its own full scale of 1023, then multiply that fraction by the output full scale of 255. Scaling the raw code directly into the output value is the usual slip, because the two ranges are different and the result saturates immediately.

Study strategy

Assessment move

Do both conversions explicitly rather than by feel: code times step size gives volts, and volts divided by step size gives the code. For every sensor, measure the codes at both ends of its real working range before choosing a threshold. When something looks like an intermediate voltage, ask what is doing the averaging.

Working through Analog input, ADC resolution and pulse width modulation in 41099? Sia is AskSia’s AI Engineering tutor — ask any 41099 Analog input, ADC resolution and pulse width modulation question and get a clear, step-by-step explanation grounded in how 41099 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

Related courses

41057 · 25400

A+Everything unlocked
Unlocks this Bible + all 26 of your University of Technology Sydney subjects - and 1,000+ Bibles across every Australian university.
Sia - your UTS41099 tutor, unlimited, worked the way the exam marks it
The full 3-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
Unlock the full UTS41099 Bible + 26 University of Technology Sydney subjects
$0.99 Trial