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.
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.
3.3 V meets 5 V
Thresholds, an HCT part, a divider and a clamp diode.
| Lesson | Time | What 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 |
|
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".
Level shifters
The BSS138 shifter both ways, and one-way buffers.
| Lesson | Time | What 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 |
|
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".
Transistor drivers
NPN, logic-level MOSFET and a high-side P-FET.
| Lesson | Time | What 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 |
|
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".
ULN2803A
Eight sinks, a Darlington drop and built-in clamps.
| Lesson | Time | What 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 |
|
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".
Optocouplers
LED current, CTR and the pull-up.
| Lesson | Time | What 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 |
|
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".
Isolation
A 24 V field input, and grounds that disagree.
| Lesson | Time | What 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 |
|
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".
Boss build
A 12 V panel with an isolated interlock.
| Lesson | Time | What 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 |
|
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".
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.