Introduction: Electric Butterfly
This is a very cool multi-colored butterfly I made - requires minimal parts and programming!
Aside from the butterfly itself - it shows some very cool techniques where you can make your own PCBs on a silhouette home cutter out of regularly commercially available copper tape - which can be placed onto any type of surface!
Obviously - something like this could be easily created via a commercially made printed circuit board - but if you want to spare the expense of having one made, you want to create LED patterns over a non-standard material (like a mirror or window, rather than a fiberglass PCB) - or even something with a curved surface - this method can be used to cheaply adhere the copper PCB traces onto just about any kind of surface.
This is easily done for things like LEDs which have large lead pitches - but gets harder as you use more fine, smaller pitched parts. So this technique may be used selectively - i.e. use an off-the-shelf board (Arduino) as a computer, and the home-cut copper etches for places where you want extreme customization in placing LEDs.
I used the following to create this project:
- A Silhouette Cameo personal vinyl/paper cutter - for creating PCB
- Arduino UNO - used as an in-circuit programmer
- Laser cutter for parts (wood - acrylic - anything) (you can use something else if you have no laser)
Actual parts are:
- A $1 ATTiny75 processor
- 22 NeoPixels - (serially controlled, tri-color LEDs)
- 2x3 header
- Copper Foil
All software was done in Arduino IDE - using Adafruit NeoPixel libraries, and ATTiny libaries from Board Manager.
There are two fundamental ways to approach this:
Easy Way: I have my own board (like an Arduino) that I am going to use to control the LEDs. I am only going to create a PCB for the LEDs - and hook that to my arduino.
Harder (and cheaper) Way: I am going to do eveything 100% myself. I don't need an Arduino, and am instead going to use a $1 ATTiny85. This is harder because doing all the fine-pitched art on a Silouette or CriCut-type vinyl cutter is harder.
Step 1: Design
The LEDs are each NeoPixels. These are awesome, individually controllable, multi-level (brightens), very bright, RGB LED devices which only have 4 pins:
Vcc
Gnd
Data In
Data Out.
So the idea is that you can daisy-chain them while controlling the individual Red-Green-Blue color levels of each - all from a single pin on your CPU. Even better, the Adafruit NeoPixel library for Arduino gives you an off-the-shelf way to get running with these in seconds.
If you are forgoing designing your CPU board on this design (using an off-the-shelf Arduino) all you need is a basic footprint of the Neopixel (it is recommended that you include a bypass cap, too with each one). The enclosed footprint.svg file is basically what you need to get started. This will give you the outlines for the copper foil for the NeoPixles and the capacitors. You can open this right in Inkscape, connect all the +5v pins and all the Ground pins together - then chain all the data-in and data-out pins together.
Be sure to turn this into proper cut-paths that you can use on your vynal cutter like I've shown above - and you're done. You don't even need a "real" PCB design program to do it.
It's not really necessary for a NeoPixel, where pins are fairly large and easy to solder - but an easy Soldermask layer can be cut out of a piece of Kapton tape. This will look like a big piece of tape with some small rectangles cut-out for solder pads, to be placed over your entire copper area.
Attachments
Step 2: CPU Design
If you are more ambitious, you can create the etches for the CPU itself right in your copper foil.
This is harder to due to to the smaller pins on the ATTiny85 device, and the need to get very small copper foil etches, but it is readily doable.
This is probably best done in a "real" PCB design program (I used Eagle).
I also included a power/debug connector in my design (and a couple of bypass capacitors).
We will talk more about the difficulty in cutting the copper in geometries this small.
Step 3: Making Layers
Step 4: Assembling Circuit
Copper traces can be placed onto your design.
In my case - I used a laser-cut piece of wood (outline of the enclosed SVG file).
I used sign transfer tape to remove the copper foil from it's backing and place it onto the wood. If you chose to do a Kapton soldermask layer - it would now be transfered onto the wood above the copper.
Soldering onto copper foil is a bit difficult, because unlike a normal circuit board, the copper is only stick to the substrate (wood) by it's adhesive, which does not stick as hard has the copper of a normal circuit board. Thus, if you aren't careful (especially under the heat of a soldering iron) - the cooper can slide or shift. Using a Kapton soldermask will help hold the copper a bit into place, and make this a bit easier.
Another big thing to look out for is that NeoPixels have been reported to be somewhat intolerant of excess heat. So when soldering, use plenty of solder flux (I use a no-clean flux pen), apply most of the heat and solder to the copper trace, and remove heat quickly once the solder flows onto the NeoPixel pin. (Soldermask will also help reduce the amount of solder required, as it will not flow down the covered area of the trace).
I found it easiest to use a small dot of "Tacky Glue" to glue the NeoPixels into place before soldering. This held the parts into place, making the soldering quicker and thus requiring less heat. Tacky Glue also tacks quickly, allowing the parts to not slide-around, immediately after being placed. It dies (in small quantities) to kind of a gummy consistency, which allows parts to be removed if any kind of replacement or rework is needed.
Step 5: Adding the CPU
If you want to make your own etches for the CPU (and debug connector) this is a bit more difficult than doing the LEDs. The reason is that the geometries involve are smaller and finer, requiring more precise cuts from your vinyl cutter.
I have found that when cutting copper foil tape, the waxy paper to which the tape is stuck provides relatively little adhesion. This means that when smaller geometries are attempted, they tend to slide around on the backing.
Though I played around with a multitude of cut settings, the best solution I found was to use a substrate with a stronger adhesion. Vinyl works well, but does not easily work well with sign transfer tape to allow the copper to be removed from the vinyl (and placed onto the wood). You can leave the circuit on vinyl, but it tends to melt when soldered - so it's not impossible, but more difficult to assemble. (I have used vinyl as a substrate in a few different designs).
(Clear transparency film or sheet protectors also work - and are bit better in that they are thicker. These can be used for designs when you want free-standing circuits and do not want an adhesive backed substrate) - but again, they melt unless soldered very careful.
The best solution I found was to use Kapton tape as the substrate. Kapton tape holds up extremely well to the heat of soldering, acts as a soldermask, and is adhesive-backed. The only downside is that it is typically very thin. So much so, that I had a hard time working with it unless I doubled-it-up, to make it twice as thick and strong.
With the greater adhesive strength of the copper over the Kapton, finer details such as CPU leads can be cut. Once done, I adhered the Kapton to the back side of the wooden butterfly backing.
Step 6: Software
Software was done as an Arduino sketch, using the Adafruit NeoPixel library.
Though it may seem trivial, a lot of thought went into the patterns on the butterfly. The code was written to alternate between two modes every several seconds:
MODE ONE - Color wipe - washing down-to-up of different colors, rapidly changing colors. In selecting a "color" - I used an algorithm to wipe between color "values" - each value being sent through an HSB-to-RGB conversion function (where saturation and brightness were always maximum) - to achieve maximum brilliance of colors.
MODE TWO - Operated by:
- 6 or 8 different pre-determined segment group "patterns" were created. The code would pick one of these at random
- Each pattern required filling pre-determined segments in one of 2, 3 or 4 different colors. Each color was randomly chosen by one of these two methods:
- Picked from one of 6 maximum-level colors (red, green, blue, yellow, etc).
- Picked from a random HUE - (using same hue generator in Mode One)
- The resulting color pattern was run through a fading function, which provided a smooth fade from one pattern to the next - and held it there for a couple of seconds before continuing to the next.
The two modes would alternate every 10 or 15 seconds.
Attachments
Step 7: Programming
So now we have a brand new ATTiny85 on our PCB, and we need to program it. Since I used the Arduino SDK for this, we need to place both the program ("sketch") and the Arduino bootloader onto the device.
I used an Arduino Uno itself as the In-System-Programmer.
The attached diagram shows how I attached the Uno to my ATTiny85 circuit. I actually made provisions to do this one of two different ways:
- via a debug header I added to the board
- via a bunch of debug test-points I added to the board. These can be used by holding a bunch of spring-pins to the board via a laser-cut acrylic holder, which holds them in the exact position.
To do this:
- Attach the Arduino Uno to your computer, and open the Arduino SDK.
- Open the built-in "Ardunio as an ISP" sketch.Compile and update this sketch - now the Uno is an ISP.
- In the Arduino "Boards Manager" - install the board package for the ATTiny series.
- Close the Uno ISP sketch, and open your sketch for the Butterfly code.
- Select "Board Type" is ATTiny85 - select 8Mhz Internal Oscillator.
- For "Programmer" select "Uno as an ISP"
- Select "Uploads Bootloader" (do this only the FIRST TIME for this chip - it should be unnecessary to repeat)
- After this is done - you can now do "Upload Program with ISP" to send your sketch to the ATTiny85.
Step 8: Final Assembly
Two more sections of wood were laser-cut - an outline of the butterfly wings. They were painted with a matte black paint.
A piece of acrylic was given a "frosted" appearance by sanding it with coarse-grit sandpaper.The individual sections of the wooden area were cut out from this acrylic.
The cut acrylic sections were placed into the topmost wooden piece. They could have been glued, but the tolerances of the acrylic cuts and the paint on the wood allowed them to be retained without glue.
These sections were then glued together with small spots of Tacky Glue - which would have allowed them to be disassembled if repairs were needed.