Star Trek into Darkness: Klingon heavy disruptor [electronic help needed!]

Hrm. That first thing (the LED cluster) lists at 60ma but it is also a 12-volt thing. So you'd need a driver regardless. The transistors you list are a high-voltage NPN and a "small signal" PNP. Better choices for switching LEDs off an Arduino are N-channel MOSFETs, or Power Darlingtons. I've been using the latter -- the old standby TIP120 -- but I'm trying to wean myself from it!

You'll also have better load switching to the transistor by using a diode to the collector leg.
 
I have the following diodes. IN4148 ones. High speed it seems.

And when it comes to adding batteries; that's no problem. I can easily get 3 or 4 AA batteries and the holder that comes with it.

I feel so dumb at the moment.
 
Last edited:
I'm always stunned when folks go right to a microcontroller to do something as simple as the effect you've described. I'd use a MOSFET voltage follower to drive the LED, and a simple RC timer with diode bypass on the resistor for the input signal, to give near-instant charging and slow-fade discharging. If I wanted to get a little fancier, I'd add trigger debouncing with a one-shot circuit (either transistor-based, or using a 555 timer). Don't forget to use a heat sink on the MOSFET.

I agree...to a point.

For just the pulse, a micro is overkill. Even for pulse and a clean de-bounce. But add one more element -- maybe a blinkenlight somewhere else -- and you might as well go micro. Because an ATtiny can be had on the same 8-pin DIP as that old standby 555. And for some projects, tuning the timing with code is a lot faster than swapping components out.

But it all depends on your experience, both in code and the ability to calculate an RC tank, and what kind of parts your shelves have most of. I tend to think a full Arduino board is always overkill, but the trade is about the cost of a pizza versus not having to have ten years of electronics tinkering behind you. And, heck, sometimes that "cost of a pizza" is worth not having to sit over a piece of strip-board for an hour or two.
 
if you are just going to use the 2 aa batt pack you do not need any resistor for the blaster led it runs from 2.9 to 3.5 volts, if you are going to power everything from the batt pack you will not have enough voltage to power anything, a 4.5(3 X AA) or 6(4 AA) volt pack would be better and resistor everything from there.

Yeah and no. Typical forward drop for the blue and green on a Cree can be 3.2 volts. Practically speaking, 2 x AA will power it only when fully charged. As you said, 3 x AA is a better solution. My completely unscientific observation is about 10 minutes of full brightness before the battery droop becomes really noticeable. Which is why the lightsaber people use proper drivers. Trick of it is, though; LED's are current devices, not voltage. You can get away with attaching one directly to a button battery because the internal resistance of the battery limits the current flow.
 
Given your time constraints, go with what you have. It will work well enough.

Um...one question first. Are the TIP120's you got the TO-220 package? Or -- put this simpler -- are they small unmarked can shapes, or are they larger rectangles with a piece of metal sticking out the top? If it is the latter, you are okay. The size of the package and the metal fin sticking up will handle the heat for several minutes of operation without causing serious harm.

Here's the circuit:

Get the three-pack AA you were talking about. That puts out about 4.5 volts when fresh. I didn't scroll back up to look at the specs on your Cree but guestimating the forward voltage and current the resistor should be 4ohms and should properly be rated for 1 watt.

Since we are being simple here, use the Arduino, use the TIP120. Good practice to put a small resistor between the TIP120 and the Arduino's output -- typically 2.2K but anything from 220 ohms up to 10K will work in a pinch. Standard 1/4 watt is fine for this, there's no current to speak of. Use the diagram from this page (use the one at the bottom, with the light bulb -- you don't need the diode to run a Cree) http://bildr.org/2011/03/high-power-control-with-arduino-and-tip120/

Your trigger button, wire it to ground and to an input pin so it grounds the input when pressed. So in the code, LOW will be "on" and HIGH will be "off." Will probably work without having to enable pull-up -- if in doubt, use this line of code "pinMode(2,INPUT_PULLUP);" (substituting the pin number your button pin).

And that's it for parts. As said earlier, if you are careful to not run the Cree for more than a minute at a time it won't need a heatsink. (Word to the wise; if you are unsure about your coding ability, code with a dummy load before putting in the part that could get damaged if your code locks up. Always mount a scratch monkey!) If you get a battery holder with a built-in switch, you can turn off the batteries when not in use.

One unfortunate wrinkle left to this otherwise simple scheme, tho. The Arduino's regulated power input can't handle 4.5 volts. It's too low. So bypass the regulator. There's several pins on the board labeled "5v" and "ground." Attach your battery pack to these instead.

I'm all for simple stuff really. I just thought I needed the arduino (and I still had it laying around)
I have some TIP120 Power Darlington Transistors, are they different than the MOSFET one? 555 timer is something I've seen earlier.

So to be clear, because I'm losing track on all of this. I need to get the high power led which is mounted on a heatsink, to go full power when I press the button. Since it's a pulse button, it's supposed to be a 'wave'. The LED is supposed to go FULL on, and fade out in a few seconds.

I have the transistors mentioned above.
a cree high power led, warm white,
2 AA batteries (goal).
A LED module which acts as a kind of resistor (I can't find it anymore on the site, I'll need to get back on that)
Will get a 555 timer.
and an arduino micro. (which is apparently not necessary.)
I have also gotten these diodes(opens in PDF).

I have a variety of resistors and one capacitor. What do I need? I need it all QUICKLY. And I do not have the time to order it all from over the world. I also need to have an understandable circuit happening. All the circuits I see are for breathing/fade in and out. I just want a single blast when I press the button.

Thanks in advance! I really need it asap.
 
Last edited by a moderator:
Oh, and the code. Not tested!

#define button 8 //button is wired to this pin; see the pinoout
#define cree 9 //and this goes to the LED

int pressed = 0;
int bright = 255;


void setup()
{
pinMode(button, INPUT);
pinMode(button,INPUT_PULLUP);
analogWrite(cree, 0);
}

void loop()
{
pressed = digitalRead(button);
if(pressed == LOW)
{
bright = 255;
analogWrite(cree, bright);
delay(100); ///this arbitrary delay keeps the LED at full power for a moment
for (bright = 255; bright > 0; bright --)
{
analogWrite(cree, bright);
delayMicroseconds(50); // this value changes how quick the fade is
}
pressed = HIGH;
}
}

Incidentally, the bldr blog linked to has a very nice little bit of code using a trig function to make a better-looking fade. I'll look more into it after I've had my morning coffee!
 
I know the terminology is off and the symbols aren't right, but for me this is understandable. As I understand it, this is how it's supposed to be?
xlsUipGl.png
 
I'm pretty sure the Arduino is also going to need to have a ground connection from the battery pack and a power connection from the main switch.
I'm also not sure why you currently show 3 connections to the trigger button switch.
 
Okay, 5-minute sketch here...please double-check my work before soldering! No values were entered for any components, and for some, nearest approximation was used.

cree_schem.jpg
 
Oh that's clear to me. The three diodes/leds is rhe cree I guess?


Sent from my iPhone using Tapatalk
 
Ok little thing happened. There were no 3x AA holders so I went with a 4x AA. Good news: It powers the arduino just fine. Bad news; the reistors are probably no longer correct..
 
Okay...if you really do have this LED: CREE 61001627 HighPower LED Warmwit 1 W, 2 W 67 lm 115 ° 3.4 V 350 mA

Then according to an online calculator (http://led.linear1.org/1led.wiz) you want a 3.3 ohm resistor. For this application, 4 ohm is fine, which may be easier to find. But it really needs to be 1/2 watt or better.

With the 4.5 pack, you can use the diagram above without changes (as far as I can tell with my morning coffee still brewing, Propmaster's redraw is electrically identical to my Fritzing sketch. Use his, tho, because I may have mislabeled my emitter-base-collector and his is easier to read on that anyhow.

If you are making a run to the Rat Shack (better hurry before they close for good!) consider picking up a bundle of alligator clip jumpers. A circuit like this, you can rig up with a rat's nest of jumpers just to test that it is all going to work. Then you solder. (Breadboard is better but let's not get too ambitious!)
 
We have no Rat Shack here :lol
Plenty of rats though. (sorry that's a stupid joke, but in the north they have a problem with rats in this town)
 
Hi kialna,

I wish you luck on this project which you have under taken and bravo for all the new things you are learning along the way.

As mentioned earlier in this thread, it is highly recommended that if you have access to a "perforated electronics board"
to do your ''point to point'' wiring and soldering, it will be less likely there will be a short between the pins of the Arduino
and keeps the legs of the other components separated...

View attachment 390036


I hope thing are going well and that you will share with us the result of your work with a nice video of the entire
endeavor when it is completed. :)

propmaster2000

.
 
Last edited by a moderator:
I will, don't worry. I have a video of the prop as it is at the moment.


As for the board, I can't really wait until one gets shipped, so I'll just have to go with what I have.
 
Last edited by a moderator:
So I have everything connected, yet the code doesn't seem to work, or I fear my transistor isn't connected correctly. I followed the schemes. When I press the button nothing happens, even when I have it on. The Cree still works though.
 
Right. No sweat yet. First, let's test the board and code.

Insert this line to void setup(); pinMode(13, OUTPUT);

And insert these line to the IF...block following the button test; digitalWrite(13, HIGH); and digitalWrite(13, LOW);

What we are doing is leveraging the built-in LED on the Arduino Micro, which is wired to digital pin 13. If your button is working correctly, that LED will turn on.

To further simplify, you can start with a fresh blank code and just use;

int pressed = 0;

void setup(){
pinMode(8, INPUT);
pinMode(13, OUTPUT);
}

void loop(){
pressed = digitalRead(8);
if (pressed){
digitalWrite(13, LOW);
}
else{
digitalWrite(13, HIGH);
}
}

Assuming the button is on 8, that should turn on the built-in LED while you are holding down the button.



We're doing engineer here, and the first rule of engineer is "divide and conquer." Test the smallest pieces that still make sense. If this test passes, next we will test the transistor and Cree with something like;

void setup(){
}

void loop(){
analogWrite(9, 150);
}


(This is why the Arduino community uses the term "sketches." The code is so small and comping it so fast it is worth writing little scratch routines like this just to test parts of a larger build. And you can do this inline, too, just by commenting out all the lines you don't need to be testing at the moment -- - in the above examples, that being all the fade code.)
 
An electrical test for the switching transistor:

Take the transistor, battery, Cree, and the two resistors as shown in the wiring diagram. Disconnect the Arduino completely. Now, use a jumper to touch the end of the resistor that would go to the Arduino, to the plus side of the battery.

(You can also omit the ballast resistor, as long as you only turn it on for a moment).
 
Last edited:
I did the first one, and the built-in LED went from 'normal on' to 'brighter on'.
The other gave me an error, saying COM3 was already in use?
 
Back
Top