An LED on the 5 V pin, on an Arduino Uno
No code at all: the Uno’s 5 V pin, a 220 ohm resistor and an LED to ground. Give the resistor 1k or 10k and watch the same LED dim. The whole build, an Arduino Uno and 2 more parts, runs here in your browser on the firmware below; open it in the editor to change the wiring or the code and run it again.
Teaching? Assign it to your class in one click.
Beginner Runs in your browser. Free, and no account needed.
The code
The firmware exactly as the editor opens it. Change a line there and press Run: it compiles in the browser.
// An LED on the 5 V pin: a circuit with no code in it.
//
// 5V -> 220 ohm resistor -> the LED's long leg (anode)
// the LED's short leg (cathode) -> GND
//
// The Uno is only a power supply here. Its 5 V pin pushes current through the
// resistor and the LED, and the resistor decides how much: with 220 ohm about
// 14 mA flows and the LED is bright. Click the resistor and give it 1000 or
// 10000 ohm, and the same LED gets about 3 mA or 0.3 mA and dims to a glow.
//
// Never leave the resistor out. With nothing to limit it, an LED across 5 V
// takes as much current as the supply can give and burns out.
//
// The sketch below does nothing but say so: the circuit works without it.
void setup() {
Serial.begin(9600);
Serial.println("Mokxi Uno: an LED on the 5 V pin, no code needed");
Serial.println("Try 1k or 10k in place of the 220 ohm resistor");
}
void loop() {
}
Parts list
4 parts, plus the jumper wires. Every one is in the editor's parts bin.
- 1 × Arduino Uno R3
- 1 × Half breadboard
- 1 × Resistor, 220 Ω
- 1 × LED, red
How it is wired
3 connections, pin by pin, read from the circuit itself. Each line is one set of pins joined together, by a jumper wire or a breadboard strip.
- Ground: Arduino Uno R3 pin GND; LED, red pin C
- Arduino Uno R3 pin 5V; Resistor, 220 Ω pin 1
- Resistor, 220 Ω pin 2; LED, red pin A
Change it and keep it
Open it in the editor, change the circuit or the code, and keep your version in a free account.