Source: https://mokxi.com/ideas/diode-projects
Updated: 2026-11-17

Projects / Project ideas
Project ideas by part

# Projects with a diode

17 Mokxi projects use a diode (2 beginner, 13 intermediate and 2 advanced). They run on Arduino Uno, Raspberry Pi Pico and Arduino Mega boards. Here are all of them, from “Touchless soap dispenser” to “Key matrix numpad”. Each card says what the project does, the board and parts it needs and its level, and Open in the simulator runs it in your browser in one click, with no account.

First project

## How to pick your first one

- Start with “Touchless soap dispenser”, a beginner project that needs a touchless soap dispenser, a transistor, a resistor and 1 more part.
- Arduino Uno runs 11 of them, Raspberry Pi Pico 2 and Arduino Mega 1. Start on the board you have, or on an Arduino Uno if you are buying one.
- The parts used most here are the transistor (10 projects), the DC motor (7) and the LED (6). With those on hand, most of this list is open to you.
- Before you build one on a real bench, open the diode part page for its pins and what each one does.

Projects

## 17 projects ready to run

### Touchless soap dispenser

An FC-51 infrared obstacle sensor and a pump on a transistor: hold a hand under the spout and it pumps one dose, then waits for the hand to go away.

Board

Arduino Uno R3

Parts

Touchless soap dispenser, transistor, resistor, diode

Level

Beginner

Open in the simulator

### Motor pinwheel

Hold the button and an IRF520 MOSFET on pin 9 runs a DC motor from a 9 V battery, with a 1N4007 across the motor to catch its kick.

Board

Arduino Uno R3

Parts

Push button, resistor, MOSFET, diode, DC motor, +1 more

Level

Beginner

Open in the simulator

### Relay switches a motor

Pin 7 drives a transistor that pulls in a 5 V relay, with a diode across its coil, and the relay’s contacts run a DC motor.

Board

Arduino Uno R3

Parts

Resistor, transistor, diode, DPDT relay, DC motor, +1 more

Level

Intermediate

Open in the simulator

### MicroPython relay switches a motor: button on 15

MicroPython on an ESP32: each press of the button on GPIO 15 flips a relay driven through an S8050 from GPIO 13, and the relay runs a DC motor.

Board

ESP32-DevKitC V4

Parts

Resistor, push button, transistor, DPDT relay, diode, +2 more

Level

Intermediate

Open in the simulator

### Pico W relay through an S8050 switches an LED

MicroPython on a Pico W: GP15 drives an S8050 that pulls in a 5 V relay with a flyback diode, and the relay contact lights an LED, two seconds on.

Board

Raspberry Pi Pico W

Parts

DPDT relay, diode, transistor, resistor, LED

Level

Intermediate

Open in the simulator

### Electromagnet hold and drop

An Uno holds a steel plate with a 12 V P20/15 electromagnet through a MOSFET on pin 9, three seconds on and two off, with a diode across the coil.

Board

Arduino Uno R3

Parts

MOSFET, diode, holding electromagnet, bench power supply

Level

Intermediate

Open in the simulator

### Music box

A tune on an 8 ohm speaker through 100 ohms, a continuous-rotation servo turning the drum.

Board

Arduino Uno R3

Parts

Transistor, resistor, diode, vibration motor, 8 ohm speaker, +1 more

Level

Intermediate

Open in the simulator

### Mains to 17 V DC

A 230 V to 12-0-12 V mains transformer, two 1N4007s as a full-wave rectifier and 1000 uF of smoothing.

Board

No board

Parts

Signal generator, mains transformer, diode, capacitor, resistor, +2 more

Level

Intermediate

Open in the simulator

### Smart blind stick

An HC-SR04 sets a buzzer and a vibration motor pulsing faster as an obstacle gets closer, and a water sensor at the tip chirps for a puddle.

Board

Arduino Uno R3

Parts

Transistor, resistor, diode, vibration motor, buzzer, +2 more

Level

Intermediate

Open in the simulator

### Solenoid tap

An Uno taps a 12 V solenoid once a second through a MOSFET, with a diode across the coil to catch the kick when it lets go.

Board

Arduino Uno R3

Parts

MOSFET, diode, solenoid, bench power supply

Level

Intermediate

Open in the simulator

### MicroPython relay and motor on a Pico: a button toggles it

MicroPython on a Raspberry Pi Pico: each press of the button on GP15 flips a relay through a transistor on GP14, and the relay runs a DC motor.

Board

Raspberry Pi Pico

Parts

Resistor, transistor, push button, battery: AA, DPDT relay, +3 more

Level

Intermediate

Open in the simulator

### Relays reverse a motor

Two motors turned both ways by relays: one on a two-channel board wired as an H bridge, one on a bare DPDT relay switched by a transistor.

Board

Arduino Uno R3

Parts

Resistor, transistor, diode, DPDT relay, DC motor, +1 more

Level

Intermediate

Open in the simulator

### Leak detector with shutoff valve

A teaching model: a YF-S201 flow sensor and an EEPROM totalizer watch for water that never stops or a trickle nobody is using.

Board

Arduino Uno R3

Parts

Water flow sensor, solenoid, bench power supply, MOSFET, diode, +5 more

Level

Intermediate

Open in the simulator

### Relay switches a motor: button on 12, relay on 9

Each press of the button on pin 12 flips a relay, driven from pin 9 through an NPN transistor with a diode across its coil.

Board

Arduino Uno R3

Parts

Push button, resistor, transistor, DPDT relay, diode, +3 more

Level

Intermediate

Open in the simulator

### Motor on a transistor

A DC motor driven from pin 9 through a 2N2222, with a flyback diode across it. The PWM ramps up and down and the shaft follows.

Board

Arduino Uno R3

Parts

Transistor, resistor, diode, DC motor

Level

Intermediate

Open in the simulator

### Pinball table

A table you can play on a Mega: flippers, pop bumpers on a kicker solenoid, targets, a drain beam and a plunger, with a four-digit score.

Board

Arduino Mega 2560 R3

Parts

TM1637 four-digit display, WS2812 NeoPixel LEDs, pinball table, MOSFET, diode, +3 more

Level

Advanced

Open in the simulator

### Key matrix numpad

Twelve switches in a 4 x 3 matrix with a diode on every key, three layers, an encoder and per-key RGB on a Pro Micro, typed as a USB keyboard.

Board

SparkFun Pro Micro

Parts

Push button, diode, KY-040 rotary encoder, WS2812 NeoPixel LEDs

Level

Advanced

Open in the simulator

Keep going

## Wiring, libraries and more ideas

The diode part page Every project ideas list

### Library pages

- Adafruit NeoPixel library
- Servo library
- TM1637 library

### More project ideas

- Arduino Uno project ideas
- Raspberry Pi Pico project ideas
- Arduino Mega project ideas
- ESP32 project ideas
- Projects with a transistor
- Projects with a DC motor
- LED projects for Arduino, ESP32 and Pico
- Projects with a push button
- Projects with a DPDT relay
- Projects with a MOSFET
- Projects with a buzzer
