Forgot your password?
typodupeerror
Christmas Cheer Hardware

Hack Your Holiday Decorations 48

Posted by samzenpus
from the rudolph-the-laser-nased-reindeer dept.
jfruhlinger writes "Tired of your code only executing in digital space? Why not hack your smiling snowman? OK, this crash course only shows you how to make pretty LED lights blink in a sequence of your choosing, but it serves to introduce you to Arduino, an open-source platform that uses C-like code. Really, any project that involves a soldering iron is good fun."
This discussion has been archived. No new comments can be posted.

Hack Your Holiday Decorations

Comments Filter:
  • by Miamicanes (730264) on Thursday December 22, 2011 @01:27AM (#38456702)

    Pure geekgasm, I present my Christmas tree as posted to Youtube 3 years ago (I haven't had time to do a new video since then, but the lights still entertain me and my guests; view my Youtube channel, and you can find the old version of the video and the rough draft of the next year's) -- http://www.youtube.com/watch?v=U5qR9_8KGPU [youtube.com]

    Note: the website mentioned at the beginning of the video expired last year, so don't try going there. It's probably a trojan-filled pr0n site by now.

    Technical specs: each light has an Atmel ATTiny25 with RGB LED, resistors, decoupling capacitor, and 5v linear buck regulator so I can power the string with 13.6v. The string has 3 wires: Vcc, Ground, and serial. The light modules have their own interpreted language that includes things like "fade to $color at $rate, then (stall/pause a while/pause briefly/continue)" and row-column addressing (so I can apply an opcode to every light in a row, every light in a column, a single light, or all lights on the tree). The serial bus itself is actually quite slow (~300bps), with most commands requiring 2 or 3 bytes. The complicated effects were created by writing commands into SRAM, then stepping through them globally so everything sync'ed up.

    Total cost of the string you see on the tree: about $1,200 worth of parts, plus the better part of 3 or 4 months soldering and assembling them. The circuit itself, and the onboard firmware, evolved over 3 years. The song in the video took me about 3 weeks to do, and occupied pretty much all of my free time for most of December. The controller itself is a laptop conected through a USB-serial interface to a controller box I made that bitbangs the string's actual serial protocol. The control app is written in Java.

    Just to make sure you have this straight:

    Java app running on laptop sends opcodes like "Write this value into address $x", or "fade quickly to color #7 and stall", or "set program counter to address 63 and stall", or "begin executing code at current program counter address", for module $y (or all modules in row $y, or all modules in column $y, or all modules) to controller box.

    Controller box bitbangs 9-27 bit datagram. Each "byte" is 9 bits, with MSB flagging the last byte. One byte is address (192 possible lights, 7 rows, 8 columns, one value that means "everything")

    Modules receive opcodes, and act upon them. Meanwhile, the module itself is executing opcodes already written to SRAM or stored in flash. Note that these are opcodes *I* defined, not Atmel assembly-language opcodes.

    The faceted diffusers actually came from a few sets of LED lights I bought at Lowe's, removed, and squeezed onto the (slightly filed-down) ends of the circuit board for each light, with the module itself protected by black heatshrink tubing.

    Major design lesson I learned from this project: never, ever depend upon being able to clamp a programming clip onto a SOIC IC. Put real testpoints on the board. SOIC clips suck, they're a pain to clip on, and aren't terribly reliable (about 1/3 of the chips had to be flashed multiple times before it completed writing without errors).

    If someone like Atmel were to condense my design down to a hunk of silicon with an ATtiny25 driving three RGB elements and make a "smart LED" with 3 leads (Vcc and Gnd, reversed to put it in "programming" mode, plus a third pin to use for unidirectional serial or bidirectional 1wire, programmed with a protocol like Atmel's debugwire), and each LED were 9v-tolerant with onboard regulator, a string of these lights could probably be manufactured for about 70c per light commercially.

  • by Morgaine (4316) on Thursday December 22, 2011 @03:32AM (#38457136)

    Here's the RAMPS "shield" (Arduino daughterboard) that plugs into an Arduino MEGA microcontroller board to drive the various stepper motors of the printer -- http://reprap.org/wiki/Arduino_Mega_Pololu_Shield [reprap.org] , http://reprap.org/wiki/RAMPS_1.4 [reprap.org] .

    If you look carefully, the Arduino is the blue board underneath the green RAMPS board in this picture of an assembled RepRap -- http://reprap.org/mediawiki/images/4/4a/Assembled-prusa-mendel.jpg [reprap.org] .

    There are cheaper AVR microcontroller boards that'll do the job of controlling a 3D printer, but the Arduino is by far and away the most popular.

Mathemeticians stand on each other's shoulders while computer scientists stand on each other's toes. -- Richard Hamming

Working...