Built-in project · Arduino Uno R3

ULN2003A solenoid from an Arduino on an Arduino Uno

Blink on pin 13 switches a 12 V, 40 ohm solenoid through a ULN2003A: 0.27 A that a pin could never give, with the COM diode catching the coil when it lets go. The whole build, an Arduino Uno and 3 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 parts retail for about $33. On Mokxi they're free.

ULN2003A solenoid from an Arduino · Arduino Uno R3live0.000 s 0.00x
Click to open it in the editor
The circuit itself, running here on the simulator. Press what can be pressed; click anything else to open it in the editor.

The code

The firmware exactly as the editor opens it. Change a line there and press Run: it compiles in the browser.

sketch.ino · Arduino Uno R3
// Blink: the smallest thing a board can do.
//
// Pin 13 has the LED soldered next to the USB socket, so LED_BUILTIN is 13.
// Wire an LED and a 220 ohm resistor from pin 13 to GND to see it on the
// breadboard too.
//
// delay() puts the chip to sleep between timer ticks rather than spinning, so
// this sketch costs the simulator almost nothing while it waits.

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(500);
  digitalWrite(LED_BUILTIN, LOW);
  delay(500);
}

Parts list

5 parts, plus the jumper wires and a bench instrument. The parts retail for about $33; on Mokxi they're free, and so are the instruments.

How it is wired

4 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.

  • Arduino Uno R3 pin 13; ULN2003A Darlington array pin 1B; Oscilloscope pin CH2
  • Ground: Arduino Uno R3 pin GND; ULN2003A Darlington array pin E; Oscilloscope pin GND
  • 12 V: ULN2003A Darlington array pin COM; Solenoid pin 1
  • ULN2003A Darlington array pin 1C; Solenoid pin 2; Oscilloscope pin CH1

Change it and keep it

Open it in the editor, change the circuit or the code, and keep your version in a free account.