Lesson plan

Interfacing and level shifting lesson plan

Make a 3.3 V board talk to 5 V logic and switch 12 V loads: logic thresholds, level shifters, transistor and MOSFET drivers, the ULN2803A, optocouplers and isolation, and a 12 V panel run from an ESP32-C3.

7 chapters, 7 lessons, about 5 hours, no board. Every lesson runs in the browser, with nothing to install.

The unit

Objectives and materials

By the end, students can

  • Thresholds, an HCT part, a divider and a clamp diode.
  • The BSS138 shifter both ways, and one-way buffers.
  • NPN, logic-level MOSFET and a high-side P-FET.
  • Eight sinks, a Darlington drop and built-in clamps.
  • LED current, CTR and the pull-up.
  • A 24 V field input, and grounds that disagree.
  • A 12 V panel with an isolated interlock.

Materials for the whole unit

  • 74HC04 hex inverter
  • 74HC125 quad tri-state buffer
  • CD4050 hex buffer
  • DC voltage source x 5
  • Diode
  • ESP32-C3-DevKitM-1
  • Filament lamp x 3
  • MOSFET x 2
  • Multimeter x 4
  • Optocoupler, 4N35
  • Oscilloscope
  • Resistor x 5
  • Slide switch x 4
  • Solenoid
  • Transistor (NPN or PNP) x 2
  • ULN2803A Darlington array

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 50 min

3.3 V meets 5 V

Thresholds, an HCT part, a divider and a clamp diode.

LessonTimeWhat students do
3.3 V meets 5 VLogic thresholds decide whether a high is a high: a 3.3 V output into 5 V CMOS, a sagging high it misses, the HCT part that accepts it, a divider for the other direction, and the clamp diode that a bare 5 V signal pushes current through.50 min
  1. Run it: is 3.3 V a high?
  2. A sagging high
  3. An HCT part
  4. Down: a divider
  5. The clamp diode takes it
  6. Limit it

Materials

  • 74HC04 hex inverter
  • DC voltage source x 5
  • Diode
  • Multimeter
  • Resistor x 3

Check for understanding

Each student finishes "3.3 V meets 5 V" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Limit it".

Chapter 2. About 45 min

Level shifters

The BSS138 shifter both ways, and one-way buffers.

LessonTimeWhat students do
Level shiftersThe BSS138 bidirectional shifter on every breakout board, worked both ways round, and the one-way buffers that do the job for push-pull signals: a 74HCT125 up, a CD4050 down.45 min
  1. Run it: both sides idle high
  2. The low side sends a 0
  3. The high side sends a 0
  4. Up with a buffer
  5. Down with a CD4050

Materials

  • 74HC125 quad tri-state buffer
  • CD4050 hex buffer
  • DC voltage source x 4
  • MOSFET
  • Multimeter x 4
  • Resistor x 2
  • Slide switch x 2

Check for understanding

Each student finishes "Level shifters" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Down with a CD4050".

Chapter 3. About 45 min

Transistor drivers

NPN, logic-level MOSFET and a high-side P-FET.

LessonTimeWhat students do
Transistor driversA 3.3 V pin switching 12 V loads: an NPN with the right base resistor, what too big a base resistor does, a MOSFET that is not logic level against one that is, and a high-side P-MOSFET switch.45 min
  1. Run it: an NPN low-side switch
  2. What the pin supplies
  3. Starve the base
  4. A MOSFET that is not logic level
  5. A high-side switch

Materials

  • DC voltage source x 2
  • Filament lamp x 2
  • MOSFET x 2
  • Multimeter
  • Resistor x 5
  • Slide switch
  • Transistor (NPN or PNP) x 2

Check for understanding

Each student finishes "Transistor drivers" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "A high-side switch".

Chapter 4. About 45 min

ULN2803A

Eight sinks, a Darlington drop and built-in clamps.

LessonTimeWhat students do
ULN2803AEight Darlington sinks with their own base resistors and flyback diodes: one input on, the Darlington's saturation drop, three channels at once, a coil clamped by the chip's COM pin, and the 1.4 V input threshold.45 min
  1. Run it: one channel
  2. The Darlington drop
  3. Three at once
  4. A coil, clamped
  5. The input threshold

Materials

  • DC voltage source x 5
  • Filament lamp x 3
  • Multimeter
  • Oscilloscope
  • Slide switch x 4
  • Solenoid
  • ULN2803A Darlington array

Check for understanding

Each student finishes "ULN2803A" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "The input threshold".

Chapter 5. About 35 min

Optocouplers

LED current, CTR and the pull-up.

LessonTimeWhat students do
OptocouplersAn LED and a phototransistor in one package: the LED current a pin supplies, the output pulled low across a gap with no wire, current transfer ratio, and the pull-up that makes it saturate.35 min
  1. Run it: light the LED
  2. Across the gap
  3. A bigger pull-up
  4. Margin for age

Materials

  • DC voltage source x 2
  • Multimeter
  • Optocoupler, 4N35
  • Resistor x 2
  • Slide switch

Check for understanding

Each student finishes "Optocouplers" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Margin for age".

Chapter 6. About 35 min

Isolation

A 24 V field input, and grounds that disagree.

LessonTimeWhat students do
IsolationA 24 V industrial input read safely by 3.3 V logic through an optocoupler: the field side's LED current, the logic side's clean low, a reverse-protection diode, and a ground difference between the two sides that changes nothing.35 min
  1. Run it: the field side
  2. The logic side sees a low
  3. Grounds that disagree
  4. Wired backward

Materials

  • DC voltage source x 3
  • Diode
  • Multimeter x 2
  • Optocoupler, 4N35
  • Resistor x 2
  • Slide switch

Check for understanding

Each student finishes "Isolation" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Wired backward".

Chapter 7. About 50 min

Boss build

A 12 V panel with an isolated interlock.

LessonTimeWhat students do
Boss: a 12 V panel from 3.3 VAn ESP32-C3 runs a 12 V control panel: a transistor, a logic-level MOSFET and a ULN2803A switch lamps and a solenoid lock, and an optocoupler brings an isolated 12 V door switch back in as an interlock. Then add a channel of your own.50 min
  1. Run it: the panel
  2. The transistor channel
  3. The MOSFET channel
  4. Unlock the door
  5. The interlock
  6. Make it yours: a third ULN channel

Materials

  • DC voltage source x 2
  • ESP32-C3-DevKitM-1
  • Filament lamp x 3
  • MOSFET
  • Optocoupler, 4N35
  • Resistor x 3
  • Slide switch
  • Solenoid
  • Transistor (NPN or PNP)
  • ULN2803A Darlington array

Check for understanding

Each student finishes "Boss: a 12 V panel from 3.3 V" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Make it yours: a third ULN channel".

Your class

Teach this unit as a class

Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.