Source: https://mokxi.com/teachers/plans/interfacing-and-level-shifting
Updated: 2026-11-19

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.

Start a class from this course

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.

Lesson | Time | What students do

3.3 V meets 5 V Logic 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

- Run it: is 3.3 V a high?
- A sagging high
- An HCT part
- Down: a divider
- The clamp diode takes it
- 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.

Lesson | Time | What students do

Level shifters The 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

- Run it: both sides idle high
- The low side sends a 0
- The high side sends a 0
- Up with a buffer
- 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.

Lesson | Time | What students do

Transistor drivers A 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

- Run it: an NPN low-side switch
- What the pin supplies
- Starve the base
- A MOSFET that is not logic level
- 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.

Lesson | Time | What students do

ULN2803A Eight 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

- Run it: one channel
- The Darlington drop
- Three at once
- A coil, clamped
- 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.

Lesson | Time | What students do

Optocouplers An 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

- Run it: light the LED
- Across the gap
- A bigger pull-up
- 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.

Lesson | Time | What students do

Isolation A 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

- Run it: the field side
- The logic side sees a low
- Grounds that disagree
- 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.

Lesson | Time | What students do

Boss: a 12 V panel from 3.3 V An 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

- Run it: the panel
- The transistor channel
- The MOSFET channel
- Unlock the door
- The interlock
- 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.

Start a class from this course See the demo class

More units

## Other lesson plans

Electronics basics 20 lessons, about 10 h. Embedded on the Arduino Uno 16 lessons, about 12 h. Embedded on the ESP32-C3 13 lessons, about 11 h. Embedded on the Raspberry Pi Pico 7 lessons, about 6 h. Build your own fight stick 5 lessons, about 4 h. Embedded on the STM32F411 6 lessons, about 6 h. C++ on a board 13 lessons, about 10 h. Digital logic and memory 4 lessons, about 4 h. Interactive devices on the Uno 9 lessons, about 8 h. From gates to a computer 23 lessons, about 16 h. Build a claw machine 8 lessons, about 6 h. Every unit All the courses as ready-made units, on the teachers page.
