Fork me on GitHub

Project Notes

#002 Variable LED brightness with PWM

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

The Build

Notes

A simple demonstration of using pulse-width modulation to drive an LED to variable “apparent” brightness.

Construction

Designed with Fritzing: see VariableLED.fzz.

The Breadboard

The Schematic

Wired up on a breadboard:

Breadboard Build

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:

console

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

scope

Credits and References

About LEAP#2
LEDArduino

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

Project Source on GitHub Return to the LEAP Catalog
About LEAP

LEAP is my personal collection of electronics projects - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting.

Projects are often inspired by things found wild on the net, or ideas from the many great electronics podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know or send a pull-request.

NOTE: For a while I included various scale modelling projects here too, but I've now split them off into a new repository: check out LittleModelArt if you are looking for these projects.

Project Gallery view the projects as an image gallery Notebook reference materials and other notes Follow the Blog follow projects and notes as they are published in your favourite feed reader