HUGE DNA Lamp REMIX by relic 3d model
3dmdb logo
Thingiverse
HUGE DNA Lamp REMIX by relic

HUGE DNA Lamp REMIX by relic

by Thingiverse
Last crawled date: 3 years ago
This is a REMIX of the award-winning DNA Lamp created by "joaoduarte". I wanted to super-size his design. Most of his original parts were printed @ 200% scale on a CR-10 printer. I used a different motor and support design. His original design used an acrylic cylinder and a motor from a microwave oven. I used a small stepper motor, UV LED's, 7805 regulator, 9V wall wart (1 amp), 2 NPN transistors and an arduino micro.
I redesigned the lamp base and created a simple support structure. The motor model is provided simply to test-fit into the printed base.
Schematic and Arduino code below ...
Code:
include
define HALFSTEP 8
define motorPin1 3 // IN1 on the ULN2003 driver 1
define motorPin2 4 // IN2 on the ULN2003 driver 1
define motorPin3 5 // IN3 on the ULN2003 driver 1
define motorPin4 6 // IN4 on the ULN2003 driver 1
define ledPin1 9 // Bottom LED Array
define ledPin2 10 // Top LED Array
AccelStepper stepper1(HALFSTEP, motorPin1, motorPin3, motorPin2, motorPin4);
unsigned long int timer = 0;
unsigned short int pwmValue = 0;
boolean pwmIncrement = true;
unsigned short int delayTime = 50;
unsigned int motorSpeed = 200;
void setup()
{
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
stepper1.setMaxSpeed(1000.0);
stepper1.setAcceleration(100.0);
stepper1.setSpeed(motorSpeed);
stepper1.moveTo(30000);
timer = millis() + delayTime;
Serial.begin(9600);
printSerial();
}
void loop()
{
//Change direction when the stepper reaches the target position
if (stepper1.distanceToGo() == 0)
{
stepper1.moveTo(-stepper1.currentPosition());
printSerial();
}
stepper1.run();
// check timer to change PWM LED values
unsigned long currentTime = millis();
if(currentTime > timer)
{
if(pwmIncrement == true)
{
pwmValue ++;
if(pwmValue == 255) // max pwm increment value
{ // if = to or above then swith direction
pwmIncrement = false; // time to decrement if = to 255
randomSeed(analogRead(0)); // at end of each sequence randomize pwm and motor speed
delayTime = random(10, 200);
motorSpeed = random(100, 1000);
}
}
if(pwmIncrement == false)
{
pwmValue --;
if(pwmValue == 0) // min pwm value
{
pwmIncrement = true; // time to increment again if = to or less than 50
randomSeed(analogRead(0)); // at end of each sequence randomize pwm and motor speed
delayTime = random(10, 200);
motorSpeed = random(100, 1000);
}
}

analogWrite(ledPin1, pwmValue); // now set LED pwm values
analogWrite(ledPin2, pwmValue);
timer = millis() + delayTime; // reset the timer !!!
}
}
void printSerial()
{
Serial.print("PWM DELAY = ");
Serial.print(delayTime);
Serial.print("\tMOTOR SPEED = ");
Serial.println(motorSpeed);
}
Schematic will follow at some point. I'll provide some basic instructions below that most people with arduino and electronics experience will be able to follow.
On a prototyping board I have a 7805 regulator for the 5 volt rail. The motor can run on 5V or 9-12 volts on the power supply. Use 1k resistors between the arduino PWM pinouts and the base of the NPN transistors. These power the 16 or so UV LED's. The PWM and motor speed are random in duration in code. General purpose NPN's can be used, however I opted for a Texas Instruments chip with 7 darlington pair inputs/outputs. It is basically 7 transistors on a chip.
Connect the stepper motor driver board to the pins listed in the arduino code. I'm running mine on the 5 volt rail. I used enameled coil wire up the support piece to power the top UV LED's. By pre-twisting the wires together, they are hardly noticable.
Hot glue was used to attach just about everything. The support structure's 3 legs may need to be trimmed evenly
There are 2 holes on the lamp base: One for a 2.5mm power input (the panel mount type) and the other for a panel mount switch. Most of these components can be found at Tayda Electronics' website.

Tags