#002 Variable LED brightness with PWM
Using a variable resistor to control the brightness of an LED with PWM.

Notes
A simple demonstration of using pulse-width modulation to drive an LED to variable “apparent” brightness.
Construction
Designed with Fritzing: see VariableLED.fzz.


Wired up on a breadboard:

The Sketch
See VariableLED.ino.
Test Results
Connecting to the serial console using screen (e.g. screen /dev/cu.wchusbserial2420 115200) I can following the readings:

Attaching an oscilloscope illustrates the PWM output wave, in this case with Sensor: 484, LED: 120:

Credits and References
- Based on the Arduino AnalogInOutSerial example
- Arduino Cookbook - 7.2 Adjusting the Brightness of an LED