My Blog: projects, sketches, works in progress, thoughts, and inspiration.

Tagged: led

In my last post I explained how to control the brightness of multiple light emitting diodes connected to an Arduino with an interface scripted in Processing. The script which I created was great because it just took a series of values sent via USB and lit the LED’s appropriately. This is convenient because it is not specific to any input which might be needed to control the lights. The script to send a value serially along with an indicator character can be added to any Processing script. Naturally one of the first things I had to do with it was create an audio visualizer. With the Arduino programmed as it was all I had to do was use a sound library to break an audio input into frequency bands and send the values down.

arduino led audio visualizer

The circuit is pretty straight forward. Six LED’s are connected through resistors to the six pins which support PWM (3, 6, 5, 9, 10, 11) and to a ground pin. I have everything crammed onto a tiny breadboard on my proto-sheild cause it’s cute and self contained. That’s just my style. PWM stands for Pulse Width Modulation and is the a way to control the brightness of LED’s as well as some other components. It is a digital output and produces the effect by switching on and off very quickly. The result can be visualized as a square wave. When you send a higher value to a PWM pin it will spend more time on than off. This blinking is faster than we can see so the LED appears to be changing brightness according to the amount of time it spends in the on position.

pulse width modulation graph

Read On »

Read On (Post Continues) »

As I started working with my shiny new Arduino board I quickly learned how to build basic circuits and program the micro controller to respond to various stimuli, but what really interested me in the technology was the ability to send information between the board and a computer. I’ve done a fair amount of programming in Processing and was excited to bring some of my work off screen. There is a nice script on the Arduino site on sending data from the board to a computer to control elements within a processing sketch. Unfortunately, the reverse is not as well documented.

I needed a script to send multiple variables from Processing to an Arduino to control a few components. After a bit of research, and more trial and error, I put together a script which controls the brightness of three LED’s through a virtual interface on a monitor. Here are my scripts and the circuit I came up with. It seems simple enough to me but if anyone has suggestions I’d love to hear them.

physical LED pixel on arduio board controlled with processing

Here three color LED’s are connected to pins 9, 10, and 11 which can use Pulse Width Modulation (PWM) to control the brightness of each LED. They are connected to their respective pins through appropriate resistors and also connected to a grounded row in the bread board. In the image I am using the prototyping shield from Adafruit which makes it easy to build small circuits.

Read On »

Read On (Post Continues) »

arduino led display

My processing work in my blog as slowed to a trickle recently. This is due to a couple of large projects which I can’t wait to reveal. One is a fun web project and the other a flash application. I’ve also been playing with my fancy new toy here and am beginning to make some progress. Along with the Arduino board I’m also using a prototyping shield from Adafruit. It creates a nice little workspace with a breadboard and some extra power sources and grounds. It also contains two led’s, one of which I wired to digital pin 0 on the underside of the board. This just keeps the light on (as long as I’m not using the pin for something else) when the board has power, and makes it blink when data is being transmitted. The shield covers up the power and transmission led’s on the Arduino itself.

In the photo above I have an led display I took out of something else and, for the sake of learning, programmed. Turning the potentiometer controls the display. Nothing thrilling, but it’s good practice. I’ve also been trying to understand serial communication so I can build devices which send and receive complex data.

Anyway, there’s a quick update, and here is my Arduino code in case it might be useful to someone. It’s not put together very well. In particular there should be a 2d array containing all the numerals and their corresponding led’s. But nonetheless.

Read On »

Read On (Post Continues) »