Guided lab · ECE 1
Microcontroller: drive a transistor and LED, read a sensor divider
A Raspberry Pi Pico runs real MicroPython on the circuit bench: its ADC reads a voltage divider on the breadboard and a GPIO pin switches an LED through an NPN transistor
- Time
- 45 min
- Bench
- Circuit bench
Free. The lab opens after Google sign-in, which also keeps your progress.

What you do in this lab
You will connect a microcontroller to real circuit nodes. A 10 kΩ resistor and a potentiometer (a rotary position sensor) form a voltage divider; the Pico's 12-bit ADC reads it. When the voltage is below 1.20 V the program sets GP15 high, and a 2N3904 transistor switches a 13.5 mA LED that a 3.3 V pin could not drive by itself. Every voltage and current comes from ngspice, and the program is real MicroPython on an emulated RP2040.
Objectives
- Calculate the output of a voltage divider and the ADC code it gives: $code = V/V_{ref} \cdot (2^{12}-1)$.
- Explain why a GPIO pin drives a transistor instead of the LED directly (pin current, supply voltage).
- Design the base resistor of a saturated NPN switch and check $V_{CE(sat)}$, $I_B$ and $I_C$.
- Follow a closed loop: sensor → ADC → program → GPIO → transistor → LED.
Inside the lab
Step-by-step instructions with wiring checks, the readings you should get, questions with model answers and a short quiz. Sign in to open it.
Related labs

Transistor and op-amp: switch, common-emitter amplifier, inverting amplifier
Use a BJT and a MOSFET as switches, bias a 2N3904 as an amplifier with a gain near 200, then get an exact gain of −10 from an LM741
60 minCircuit bench

BEDO Comm (1) Set 4: Hartley oscillators and the op-amp Colpitts
BJT Hartley, shunt-fed Hartley, op-amp Hartley and Colpitts with a feedback trimmer
55 minEmona kit bench

Diodes on the breadboard: rectifier, Zener, regulators
Turn AC into DC step by step: rectify it, smooth it, then hold it steady with a Zener diode, a 7805 and an LM317
55 minCircuit bench

BEDO Comm (1) Set 5: second-order Butterworth filters
Sallen-Key low-pass and high-pass with A_F = 1.574, two cut-off positions each
45 minEmona kit bench
Unofficial, free student project. Not affiliated with Emona Instruments or with any university. Emona and ETT-101 are trademarks of their owner.