This is my take on MrTrick‘s Star map with a little inspiration from qazwsx755‘s RGB Arduino project and of course meawert‘s programming advice.
I thank you all for what now adornes the wall of my living room.
Step 1: Fibres and prep
This dictated the size of the xmas tree I would need, however one thing I forgot was that an xmas tree has a base and a lower stem which im my case did not have any fibres in 🙁
After selecting your tree remove the outer binding ro release the fibres. I had no intention of releasing an i’ble at the time so I did not take any photo’s of the stripping, all I will say is follow MrTrick’s advice and try not to bend the fibres.
Also, I found the a hobby knife / scapel did the trick for me, mind you they are sharp!
Keep a handy bag for the bits you are throwing away and some tissue to mop any leaks up.
I was trying to patent my “soft raising device” but it turns out that the toilet roll already has a name 🙁 (and more than one use)
These are good for supporting the board while you poke the fibres through as they don’t snap the fibre off if you catch the side of it.
Step 2: LED clusters
The first change was using a crushed velvet material, this gives a very nice finish just don’t pull it too tight! it can go a bit thin so you end up seing through it.
As my base board was 9mm MDF I found out the hard way that you need to drillALL of the holes BEFORE you put the material on.
Otherwise you end up with bigger holes than you want.
When it comes time for the acrylic rods I cut them down to 6mm lengths, use a craft knife to cut the material around the hole then simply use a hammer to belt them in. Just get them flush with the front which should leave enough of a gap behind for the LED.
For the fibre optic side of life, I chose to use a cluster of LED’s each one with their own resistor instead of using one large light source.
I used a 6 LED cluster mostly White but with just one Blue led. This was supposed to give a blue tint to the fibres but light doesnt seem to mix when you put them side by side, who would have thought?
These were then carefully taped to the ends of the fibre bundles. This is also very handy for finding the odd fibre that you may have missed.
Due to timing more than planning I ended up puting the fibres in place then mounting the unit into the frame work.
The frame is an ally door section that I had to wait until they had offcuts the right size. Simply mitre the corners then used a flat plate with self tapping screws to hold it in place. I then used another of my vices to hold the the main board in to the frame, good old expanding foam. You just gotta love it! Once this cures it is very solid.
Step 3: Star placement
I also used a standard Arduino Uno and one ULN2003A ic to amplify the outputs.
LED Clusters:
5mm White LEDs
510 Ohm resistors
Stars:
5mm LEDs
3mm LEDs
220 Ohm resistors
8 core alarm cable.
tHE 220 Ohm resistors were carefully chosen by looking in the box and seeing what I had left. If calclations are correct these should have been 100 Ohm.
Spend a little while stripping back the alarm wire, solder onto the LED legs and twist the pairs together.
I found that it helped to lay out all of the LEDs over the star locations then assemble the whole array before placing them on to the board.
when you are ready place the bread board in a spot and screw it in place, then run all of the stars out. Once they are in place drip some hot glue being careful not to get too much on the fibres.
Step 4: Arduino
I split the stars into 6 sections randomly scattered across the board.
These were controled from the Arduino via the 2003A.
If I get chance I will draw up a schem but for now all I have is the Arduino code:
int three = 3;
int five = 5;
int six = 6;
int nine = 9;
int ten = 10;
int eleven = 11;
int flickerONE = 7;
int flickerTWO = 8;
int threeNow;
int fiveNow;
int sixNow;
int nineNow;
int tenNow;
int elevenNow;
int threeNew;
int fiveNew;
int sixNew;
int nineNew;
int tenNew;
int elevenNew;
int flickertONE;
int flickertTWO;
void setup ()
{
pinMode (three, OUTPUT);
pinMode (five, OUTPUT);
pinMode (six, OUTPUT);
pinMode (nine, OUTPUT);
pinMode (ten, OUTPUT);
pinMode (eleven, OUTPUT);
pinMode (flickerONE, OUTPUT);
pinMode (flickerTWO, OUTPUT);
threeNow = random(40);
fiveNow = random(40);
sixNow = random(40);
nineNow = random(40);
tenNow = random(40);
elevenNow = random(40);
threeNew = threeNow;
fiveNew = fiveNow;
sixNew = sixNow;
nineNew = nineNow;
tenNew = tenNow;
elevenNew = elevenNow;
}
#define fade(x,y) if (x>y) x–; else if (x<y) x++;
void loop()
{
analogWrite(three, threeNow);
analogWrite(five, fiveNow);
analogWrite(six, sixNow);
analogWrite(nine, nineNow);
analogWrite(ten, tenNow);
analogWrite(eleven, elevenNow);
threeNew = random(40);
fiveNew = random(40);
sixNew = random(40);
nineNew = random(40);
tenNew = random(40);
elevenNew = random(40);
while ((threeNow != threeNew) ||
(fiveNow != fiveNew) ||
(sixNow != sixNew) ||
(nineNow != nineNew) ||
(tenNow != tenNew) ||
(elevenNow != elevenNew))
{
fade(threeNow,threeNew)
fade(fiveNow,fiveNew)
fade(sixNow,sixNew)
fade(nineNow,nineNew)
fade(tenNow,tenNew)
fade(elevenNow,elevenNew)
analogWrite(three, threeNow);
analogWrite(five, fiveNow);
analogWrite(six, sixNow);
analogWrite(nine, nineNow);
analogWrite(ten, tenNow);
analogWrite(eleven, elevenNow);
flickertONE = random(5);
digitalWrite(flickerONE,HIGH);
delay(flickertONE);
digitalWrite(flickerONE,LOW);
delay(5-flickertONE);
flickertTWO = random(1000);
digitalWrite(flickerTWO,HIGH);
delay(flickertTWO);
digitalWrite(flickerTWO,LOW);
delay(1000-flickertTWO);
}
}
This gives the overall effect of the stars fading in and out, they can sometimes go off altogether but then thats all part of the fun.
The Blue LED in the cluster gives the fibres a blue glow and because the whole thing is random you simply never know what you are going to get.
By the way, the whole thing pulls 310mA @ 12V DC.
Not bad!
Step 5: New code
I did a bit of reading up on the Arduino code and it seems that you should only have one delay command in each sketch.
I may be wrong here and feel free to correct me but I removed the flicker sections and the whole thing seems to run smooth.
Should have took notice of meawert and his first take on this sketch!
Anyways, here comes the revised version:
It uses all of the PWM pins and I have numbered them to try and make it easier to wire up.
int three = 3;
int five = 5;
int six = 6;
int nine = 9;
int ten = 10;
int eleven = 11;
int threeNow;
int fiveNow;
int sixNow;
int nineNow;
int tenNow;
int elevenNow;
int threeNew;
int fiveNew;
int sixNew;
int nineNew;
int tenNew;
int elevenNew;
void setup ()
{
pinMode (three, OUTPUT);
pinMode (five, OUTPUT);
pinMode (six, OUTPUT);
pinMode (nine, OUTPUT);
pinMode (ten, OUTPUT);
pinMode (eleven, OUTPUT);
threeNow = random(255);
fiveNow = random(255);
sixNow = random(255);
nineNow = random(255);
tenNow = random(255);
elevenNow = random(255);
threeNew = threeNow;
fiveNew = fiveNow;
sixNew = sixNow;
nineNew = nineNow;
tenNew = tenNow;
elevenNew = elevenNow;
}
#define fade(x,y) if (x>y) x–; else if (x<y) x++;
void loop()
{
analogWrite(three, threeNow);
analogWrite(five, fiveNow);
analogWrite(six, sixNow);
analogWrite(nine, nineNow);
analogWrite(ten, tenNow);
analogWrite(eleven, elevenNow);
threeNew = random(255);
fiveNew = random(255);
sixNew = random(255);
nineNew = random(255);
tenNew = random(255);
elevenNew = random(255);
while ((threeNow != threeNew) ||
(fiveNow != fiveNew) ||
(sixNow != sixNew) ||
(nineNow != nineNew) ||
(tenNow != tenNew) ||
(elevenNow != elevenNew))
{
fade(threeNow,threeNew)
fade(fiveNow,fiveNew)
fade(sixNow,sixNew)
fade(nineNow,nineNew)
fade(tenNow,tenNew)
fade(elevenNow,elevenNew)
analogWrite(three, threeNow);
analogWrite(five, fiveNow);
analogWrite(six, sixNow);
analogWrite(nine, nineNow);
analogWrite(ten, tenNow);
analogWrite(eleven, elevenNow);
delay(30);
}
}
Leave a Reply
You must be logged in to post a comment.