Wiring Your LED for PWM with Arduino | Task 2

Wiring Your LED for PWM

To make your LED fade using PWM , we need to connect it to a special pin on the Arduino Uno. These are called PWM pins and have a tilde (~) next to their number, like ~3, ~5, ~6, ~9, ~10, and ~11.



You’ll Need:

Steps to Build the Circuit

  1. Insert the LED into the breadboard. The longer leg is the positive side (anode).
  2. Connect the 220Ω resistor to the same row as the long leg of the LED.
  3. Connect the other end of the resistor to any PWM pin on the Arduino.
  4. Connect the short leg of the LED to a GND pin using a jumper wire.
  5. Connect the Arduino to your computer using a USB cable.

fritzing diagram showing an LED connected to PWM pin 9 with a 220Ω resistor