5 February 2016

The Objective

We’re switching up from our previous adrenaline-packed project and taking this one nice and slow.  And by ‘slow’ we mean the speed at which electromagnetic waves transmit signals through wiring, something on the order of 95% the speed of light.  So yeah, hella slow...

Our goal with this project is to replace a simple household ceiling light with an awesome cloud lamp that contains 150 dynamically controlled LEDs.  There are a few important features this needs in order to be better than the same-old lame-old lamps found in your neighborhood IKEA.

  1. Bluetooth enabled - Don’t you hate getting out of bed right before you go to sleep just to turn out a light somewhere?  Since we all pretty much sleep with our phones within arm’s reach, let’s make the cloud controllable via bluetooth.
  2. Multiple lighting modes - To say that lights should “just light the room up” would reinforce an age-old concession that their sole purpose is to be unbearably boring.  Our cloud should have different color modes and patterns for days... or rather for nights.
  3. Brightness control - Most bulbs have only two brightness levels: on or off.  But what if you want a bright light for when you’re working and a soft ambient light for when you’re relaxing?  This is a must for the cloud.

If you want to see the outcome of this project before reading on, here ya go:

Obligatory Safety Disclaimer:  This project involves running up to 9 amps of current through a bunch of LEDs inside paper lanterns covered in polyester on the ceiling.  The risk of fire is inherent and partially depends on your soldering ability and electrical wiring quality.  Although we were able to do it, we’re not necessarily saying that you should do it.  But if you’re determined to, at least be sure to check the current rating on whatever power adapter you buy.  And unless you really want to Disco Inferno your residence, it’s a good idea to have a fire extinguisher somewhere on your property... for many reasons... but especially for this.

Cloud Lamp Materials List

As the old adage goes, behind every good project there’s a good Amazon Prime account.  We bought most of the peripheral components there, but the LEDs which are the star attraction come from Adafruit.  Check out this awesome BOM we made!  (BOM means Bill of Materials, although it leaves itself open to plenty of puns.  Like ‘this BOM is tōts bomb.’)  The item names are links so go ahead and clicky clicky to go directly to their respective order pages.  Also please note that our price calculation does not take into account tax, shipping, inflation, market instability, and so on.

Item Price QTY Total Cost
NeoPixel RGB Strips $16.95 5 $84.75
Arduino Uno $21.95 1 $21.95
Bluetooth Module $7.99 1 $7.99
AC/DC Converter $12.99 1 $12.99
Prototype Board $5.90 1 $5.90
1000 μF Capacitor $3.90 (pack of 5) 1 $3.90
470Ω Resistor $4.02 (pack of 25) 1 $4.02
JST Connectors $7.11 (10 pairs) 1 $7.11
Hook-Up Wire $17.30 1 $17.30
Heat Shrink $3.82 (1 meter) 1 $3.82
10" Paper Lantern Pack $7.12 (pack of 10) 1 $7.12
Polyester Batting $19.97 1 $19.97
Spray Adhesive $10.09 1 $10.09
Fishing Line $1.56 1 $1.56
Screw Hooks $4.19 (pack of 36) 1 $4.19
Total $212.66

The Build

Because this is more of a craft DIY than a mechanism design project, we won’t be posting a separate how-to video.  As such, the disjointed ramblings of our speech-to-text software will have to suffix. surface. suffice.  Damn speech-to-text software...

 

The Lights

We’re using 10 paper lanterns in a 2 row by 5 column configuration.  We have 5 LED strips, so each strip runs down each column and through both rows.  It’s important to note that if you buy the NeoPixel strips in large quantities, Adafruit ships each 5 strips as a single strand.  For example, we ordered 6 strips of 30 LEDs (180 LEDs total) and we received a single strand of 150 LEDs plus another strand of 30 LEDs.  This can be a bit of a nuisance if you want multiple strips because you’ll have to cut them and solder connectors on yourself.  The best approach might be to contact their customer service and make a specific request, or just put on your soldering trousers and grind through it like a champ.

 

The Electronics

The circuitry is the brains behind this whole operation; it does all the bluetoothing and pattern processing and signal transmitting.  Fortunately we live in a world where microcontrollers are a dime a dozen and programming is taught as early as primary school.  We’re using an Arduino for this project because it comes with its own library for the NeoPixels that handles all the precisely timed transmissions to the LED driver chips.  We might do a project later where we delve into bit-bashing with a PIC or some such, but this will do for now.
The rest of the electronics are all passives (resistors and capacitors).  The diagram below shows the components and values we used, but as long as you follow the guidelines laid out in the NeoPixel Überguide (page 17) you’ll be fine.  Be warned ye!  If you really want to make sure the electronics are well connected then there’s no substitute for soldering.  We soldered everything together onto a circuit board, but if you’re not digging the whole “permanent commitment” thing you could always stick the components into a breadboard.  Most breadboards aren’t rated above 24V / 2A so take precautions to not bake your bread... heh.

 

Cloud Lamp Electronics

The last bit is the wiring that goes from the circuit board to each LED strip.  We soldered the hook-up wire to the JST connectors to make pigtails which we could plug into the strips.  We really stress using the connectors instead of soldering directly to the stips because the ability to unplug everything was invaluable during the assembly process.  Quick lean manufacturing lesson!  Use a consistent standard for the connector genders so it’s impossible to accidentally switch your power and signal lines.  If you run any appreciable current through the signal line you will straight up murder your LED driver chips and the strip won’t work good no more.  See the below image for an explanation.  This is what they call “fool proofing,” or poka-yoke (ポカヨケ) in Toyota Land.

poka-yoke
Fool Proofing at its Finest

The Lanterns

Once you’ve opened the pack of lanterns the first thing to do is take all the metal frames and tie fishing line across them to look like rungs on a ladder.  We also glued the very ends of the fishing line to the metal frame to prevent our (disgustingly pitiful) knots from sliding every which way.  These rungs provide additional structure for securing the LED strips so they sit nicely in the middle of the paper lantern instead of crashing down under their own weight due to the expectations of their overly strict parents... er gravity.  Once you loop the LEDs through and tie both ends to the metal frame, you can insert the whole thing into a paper lantern!  Rinse and repeat until all your lanterns are populated with little LED denizens, then grab the fishing line and a mechanical pen.  Stick the fishing line into the very tip of the pen and click it so the point comes out and snags the fishing line in place.  Then drop the pen through the paper lanterns so the fishing line runs in one end and out the other.  Finally make a big ol’ loop of the fishing line and tie it off.  This creates a hanger for each set of lanterns so you can suspend them from a ceiling or mezzanine or the insanely high bar of achievement set for you by your relentless parents.

 

The Batting

Once all the paper lanterns have their fishing line hangers, string them up next to each other so you have uninhibited access to all sides of the lanterns.  We strung ours along the handle of a mop, but if you’re feeling fancy you can also use a broomstick.  Honestly PVC pipe or a wooden dowel would be ideal but work with what you got.  Now it’s batter up!  Or time to go batting?  We swear our puns are usually batter than this.  At any rate, take your spray-on adhesive and go to town.  We found the best way was to take a handful of batting and loosen it up some, then spray an un-batted part of a lantern and immediately stick the batting to it.  Once you have a base layer on the lanterns you can easily work more batting onto it without any adhesive.  Oh and remember to pull the LED wire connectors out before covering up the paper lantern holes!

 

The Install

Take the screw hooks and screw them into your ceiling wherever you dare.  We’re renting so as a general principle we don’t mind putting eleventy billion holes in the ceiling.  But if you own the place try to be sure about your placement before you dig into the paint.  Screw hooks usually have their weight rating on the package, but a single hook should be able to support the entire cloud’s weight... unless you’re using special ultra-dense lead batting.  We needed 3 hooks, not due to the weight, but rather due to the impressive volume of our cloud.  If the cloud is this large and you don’t use enough hooks you’ll be taking a rather abrupt trip to sag city.

 

The Code

We won’t go into great detail here because you can dl the code and splash around with it yourself.  Find any old Bluetooth Terminal app for your phone and use it to connect to the bluetooth module.  Once you’re paired you can issue any of the following commands:

 

b makes the cloud brighter

d makes the cloud darker

+ makes the colors change more quickly

- makes the colors change more slowly

h makes the color changes run horizontally

v makes the color changes run vertically

o off

w standard white light

r rainbow

s sunset

a aurora borealis

l lightning

Lessons Learned

 

This project was smooth sailing for the most part and the build process required almost no pre-planning, forethought, or self-reflection of any form.  That being said, there were a few broad design changes we would make if given the opportunity.

 

  1. Light diffusion in lanterns - this was our only real problem.  We were initially hoping to have single-LED resolution but because the LED strips are so bright color differences across one strip just blend together when viewed from outside the lanterns.  A possible solution might be to encapsulate each LED in a miniature paper cocoon, but really now... ain’t nobody got time for that.
  2. Cloud shape - We basically made a giant Cheeto with our cloud because we wanted to implement a mode that displays national flags, i.e. broad and flat.  But if you aren’t constrained by that and any other societal hangups it would be cool to make a more natural cloud shape.
  3. Code complexity - Some of these modes are pretty involved and take up a fair amount of RAM on the Arduino.  While it would have been nice to have all the modes in a single sketch, flag mode finally put us over our memory usage and we had to split it into several sketches.  A great workaround for this would be to use an extremely light sketch that reads a string of color commands from the serial pins; this would allow all the intense processing to be done on your phone or laptop.  Perhaps another time...