foulab.org / Flashing Lights! Colors! (Pulse Width Modulation: A kit-building course)

Flashing Lights! Colors! (Pulse Width Modulation: A kit-building course)

By legionlabs, on 2012-03-17 00:00



Pulse Width Modulation (PWM) is an efficient way to output analog(ish) voltages and currents using a digital source. A square wave of fixed frequency, but varying duty cycle (the "on" time) can produce a close approximation to an analog voltage/current, so long as this fixed frequency is high enough.

This technique is commonly used for controlling light emitting diodes (LEDs). LEDs controlled in this manner can usually be dimmed to 256 different brightness levels. A 3-color (RGB) LED can produce 16 million unique colors this way!

In this course, we will build a 24-channel PWM controller suitable for constructing some fairly complex LED light displays. It will be controlled via serial port at 250 kBaud, so it can be easily be controlled via laptop (with usb-to-serial adapter) or microcontroller.

We will go over the firmware of the PWM controller (written in AVR assembly), although no previous knowledge of assembly is necessary. Code examples for lighting control will be provided in Python and AVR assembly, although the protocol is trivial to implement in your programming language of choice.

This course assumes you have basic ability with at least one programming language, and that you can solder a through-hole component without setting youself on fire (or can learn to do so in a few minutes).

Cost: 45$ (kit included)

Date: 2012-03-31 at 18:00-21:00