Vous êtes sur la page 1sur 11

instructables

Aurora LED Lamp

by Gosse Adema

An aurora is a natural light display in the sky, mostly seen in the Arctic and Antarctic regions. They are caused by
the solar wind disturbing the magnetospere.

This Instructable is about creating your own aurora LED lamp. The effect is generated by a combination of colored
LEDs and an unequally colored rotating disc. Both, the LEDs and the motor, are driven by a single microcontroller.

Aurora LED Lamp: Page 1


Step 1: Materials

This aurora light is a mixture of a digital and an 'analog' light effect. It requires some electronic parts and colored
glass or plastic.

Electronic parts

Arduino (compatible) board


WS2812 LED ring (16 LEDs)
28YBJ-48 Stepper motor
USB charger (IKEA Koppla)
USB cable
Breadboard jumper wires
USB breakout board (optionally)
Capacitor (100 - 1,000 uF)
Resistor (470 - 1,000 Ohm)

Rotating Disc:

Transparent colored glass and/or plastic


Transparent plate
Transparent glue
Old lens / Google Cardboard (optionally)
Plastic lid (jar, about 3,5 inch)

Housing:

4" PVC tube / PVC 45 degree elbow


Paint
Wood for internal parts

Other parts:

Some small LEGO parts for the shaft.

Some caution is required when breaking glass or plastic. Place it in a cloth or plastic bag to prevent splinters from
jumping away. And wear safety goggles.

Aurora LED Lamp: Page 2


Step 2: Digital Light Effect

The first light effect uses a WS2812 LED ring with 16 LEDs. These are controlled by an Arduino.

The initial code for this part has been made on 'Circuits.io'. And you can simulate an Arduino, with this circuit,
directly from their webpage (takes some time to open).

The main loop provides 3 (Red, Green and Blue) values for the LEDs. The values differ each step by using a
different cosinus-funtion for each color. I've choosen for a cosinus funtion, in stead of a random, function to allow
for smooth color changes.

Aurora LED Lamp: Page 3


#include <Adafruit_NeoPixel.h>

#define NUM_PIXELS 16
Adafruit_NeoPixel pixels(NUM_PIXELS, 8, NEO_GRB | NEO_KHZ800);

int lednum = 0;
float R, G, B;
float Gplus = 60;
float Bplus = 90;

void setColor(int R, int G, int B)


{
R = max (min (R, 255), 0);
G = max (min (G, 255), 0);
B = max (min (B, 255), 0);

pixels.setPixelColor (lednum, R, G, B);


pixels.show();

lednum++;
lednum = lednum%NUM_PIXELS;
}

void setup()
{
pixels.begin();
pixels.show();
}

void loop()
{
for (int j = 0; j < 3599; j++)
{
R = abs(cos( j * 0.0174532925) * 255);
G = abs(cos((j + Gplus) * 0.0174532925) * 255);
B = abs(cos((j + Bplus) * 0.0174532925) * 255);
setColor (R, G, B);

Gplus++;
Bplus++; Bplus++;
if (Gplus >= 3600) {Gplus = 0;}
if (Bplus >= 3600) {Bplus = 0;}

delay (100);
}
}

The value of 0.0174532925 translates the degrees to radians.

Aurora LED Lamp: Page 4


Step 3: 'Analog' Light Effect

The second light effect is caused by a rotating disc. It (Round 2 x 2 with Axle Hole).
is made from a transparent disc combined with
transparent colored materials. Glue all parts together with transparent glue. You can
use plenty, the glue becomes a part of the light effect.
Start with a plastic lid. Carefully remove the inner Make sure the axle has an angle of 90 degree.
side. And replace this with a transparent plastic disc.
I've used a fretsaw to create a plastic circle out of a
plate of polycarbonate (4mm).
My first prototype used an upper part of a cd spindle.
Place different pieces of glass on the plastic disc.
The sides of the plastic lid make it impossible to
Irregular pieces of glass give different refractive
touch the sharp parts of the glass after assembling.
angles, and increase the aurora effect. I've also used
some parts of a lens. The centre part is a LEGO brick

Aurora LED Lamp: Page 5


Step 4: Variable Speed Motor

There are 3 types of motors which can be used: DC geared motors, servo motors and stepper motors.

I've chosen a 28YBJ-48 stepper motor with an ULN2003 Driver Board. They are easy to control. And have 2
mounting holes. Which have been placed on a different location than the connectors of the LED ring.

This project uses the standard Arduino stepper library. This library contains 3 functions:

Stepper(steps, pin1, pin2, pin3, pin4)


setSpeed(rpm)
step(steps)

The stepper function returns a new instance of the Stepper motor class. This requires the number of steps in one
revolution of your motor and the connected pins on the Arduino. The 28YBJ-48 stepper moves 11.25 degrees per
step in full step mode. Or 360/11.25 = 32 steps per single revolution of the internal motor shaft. There is an internal
gear with a reduction ratio of 1/64. Resulting in 32 x 64 =2.048 steps per revolution (0.1758 degree per step).

The setSpeed function is used to adjust the motor speed. The input value is defined as rpm (rotations per minute).
This value must be adjusted with the gear ratio, because the stepper library doesn't know the motor type. The
value of 1 x 64 gives a speed of one revolution per minute.

The following example code controls the stepper motor. The motor speed is adjusted every 100 steps (about 20
speed changes per rotation). The speed is slowly adjusted between 0,5 and 1,5 rpm (the values 32 and 96).

#include <Stepper.h>

#define STEPS_MOTOR 32
#define STEPS_OUTPUT 32 * 64

Stepper BY48stepper(STEPS_MOTOR, 8, 10, 9, 11);

int Steps = 100;


int Speed;

void setup()
{
}

void loop()
{
for (int j = 0; j < 359; j++)
{
Speed = 64 + (cos (j*0.0174532925) * 32);
BY48stepper.setSpeed (Speed);
BY48stepper.step (Steps);
}
}

Connect the stepper motor to the ULN2003 board. The Arduino pins 8-11 are used to control the stepper. Don't
forget to connect the power (5 Volt) and Ground wires. Pin 12 is used for the LED ring.

Aurora LED Lamp: Page 6


Step 5: Housing

The housing is made of a 4 inch diameter PVC drain pipe. The first idea was to use a straight tube. In the end this
has become a 45 degree linkage.
In this a circular wooden triplex plank is placed. Drill 3 holes for the motor, and 3 holes for the LED ring.

It is posible to paint the PVC:

1. Work in a well-ventilated or open space.


2. Sand the outside and inside. Use fine sandpaper (220+ grit).
3. Apply very little accetone on a cloth. And wipe over the PVC. This allows the paint to hold better.
4. Place the wooden disc before painting the housing.
5. Apply multiple coats of spray paint. Let the paint dry for 10 to 20 minutes between each layer.
6. Allow the paint to dry. This takes a few hours.

Aurora LED Lamp: Page 7


Step 6: Electronics

The electronics schema is straightforward. The USB between the power and ground (near the led ring).
breakout board provides power to the Arduino, The current draw of the LEDS can vary, and the
ULN2003 Stepper Driver and LED ring, using an capacitor acts as a temporary power source.
external power supply. The stepper motor is directly
connected to the driver board. And the driver board is
connected to pin 8-11 of the Arduino.
The Arduino can be powered by the USB breadboard
OR the Arduino USB port. Use the Arduino port only
The led ring is connected to pin 12 of the Arduino.
when updating the software.
Use a resistor between the Arduino and the LED ring
data input, to protect the data pin. Place a capacitor

Step 7: Arduino Code

The final code combines the WS2812 LEDs and the Stepper Motor examples. Both examples use a for-loop in the
main part. And I've combined these pieces of code into a single program.

Some parts of the code can be adjusted to alter the light effect:

Motor speed: Current speed is between 1 and 1.5 rpm.


Minimum LED output: Increase the 0 value in the "max (n, 0)" inside the setColor function.
Maximum LED output: Decrease the 255 value in the "min (n, 255)" inside the setColor function.
Faster color change: Decrease the Steps value.

Aurora LED Lamp: Page 8


#include <stepper.h>
#include <Adafruit_NeoPixel.h>

#define NUM_PIXELS 16
Adafruit_NeoPixel pixels(NUM_PIXELS, 12, NEO_GRB | NEO_KHZ800);

#define STEPS_MOTOR 32
#define STEPS_OUTPUT 32 * 64
Stepper BY48stepper(STEPS_MOTOR, 8, 10, 9, 11);

int lednum = 0;
float R, G, B;
float Gplus = 60;
float Bplus = 90;

int Steps = -50;


int Speed;

void setColor(int R, int G, int B)


{
R = max(min (R, 255), 0);
G = max(min (G, 255), 0);
B = max(min (B, 255), 0);

pixels.setPixelColor (lednum, R, G, B);


pixels.show();

lednum++;
lednum = lednum%NUM_PIXELS;
}

void setup()
{
pixels.begin();
pixels.show();
}

void loop()
{
for (int j = 0; j < 359; j++)
{
R = abs(cos( j * 0.0174532925) * 255);
G = abs(cos((j + Gplus) * 0.0174532925) * 255);
B = abs(cos((j + Bplus) * 0.0174532925) * 255);
setColor (R, G, B);

Gplus++;
Bplus++; Bplus++;
if (Gplus >= 3600) {Gplus = 0;}
if (Bplus >= 3600) {Bplus = 0;}

Speed = 64 + (cos (j*0.0174532925) * 32);


BY48stepper.setSpeed(Speed);
BY48stepper.step(Steps);
}
}

Upload and test the code before assembling the Aurora LED lamp.

Aurora LED Lamp: Page 9


Download (https://cdn.instructables.com/ORIG/FDS/U58F/J2QF6ELR/FDSU58FJ2QF6ELR.ino)

http://www.instructables.com/ORIG/FDS/U58F/J2QF6ELR/FDSU58FJ2QF6ELR.ino

(https://cdn.instructables.com/ORIG/FDS/U58F/J2QF6ELR/FDSU58FJ2QF6ELR.ino)

Step 8: Assembly

After painting the PVC housing, it's time to assemble the Aurora LED Lamp. Start with the stepper motor and the
SW2812 LED ring. Attach the motor to the wooden plate inside the housing. Use 3 breadboard wires to connect
the LED ring. I've drilled 3 small holes and fastened the breadboard connectors to the wooden plate.

Connect all electronics as mentioned in a previous step. You can solder the wires, use a screw terminal or use an
Arduino prototype board (only $1 on aliexpress). It is posible to power al components from the Arduino. But it's
better to bypass the Arduino for powering the LEDs and the stepper motor. This requires an altered USB cable or
an USB breakout board.

Place all electronic components inside the housing. And attach them to the wooden plate.

Connect the colored disc to the motor shaft. I've used some LEGO parts (bricklink.com):

Technic, Axle 4 (3705)


Technic, Liftarm 1 x 3 Thick (32523)
Technic, Wedge Belt Wheel (4185)
Technic, Pin with Friction Ridges (2780)

But you can also use a shaft coupler.

Although the LEDs give quite a lot of light, it's hard to make a good quality video. But the Aurora effect is best
shown in a dark environment on a light wall. Just like the real auroras, which are most clearly seen at night.

GosseAdema

Aurora LED Lamp: Page 10


https://youtu.be/QLX1cnPi1Jg

Aurora LED Lamp: Page 11

Vous aimerez peut-être aussi