View previous topic :: View next topic |
Author |
Message |
latindude88wpg Trick Member
Joined: 12 Nov 2004 Location: winnipeg, mb |
0. Posted: Thu Jan 20, 2005 9:08 pm Post subject: Stepmania Lights Tutorial |
|
|
deedeeahh lights
edit: please make sure you read the whole thing, as my first post had a lot of errors
*intro
so, you want cool lights on your dee dee ahh pad, eh? cool, so did i,
so after researching for a bit, and doing some testing on my own i
have the courage to write a tutorial on this. i would like to thank
cnlohr (http://cnlohr.net) and cartoonhero_604 at ddrfreak.com for all
their help. these ideas are not mine and i couldn't have done anything without their help. thanx guys.
oh yah, and sorry for any typos or misespelling, please understand, as english is not my first language
i hope you enjoy it
anyways...
this is a very easy project which will allow you to have a set of
lights that flash to the beat of the music. yes, a la arcade.
*part list
this are the parts i used. you can always change stuff around, but
please, make sure you know what you're doing, because you could harm
your computer, yourself or even worst, your deedeeahh pad. pretty much
all the parts are available at radioshack or you can get them online
too.
4 10ma blue leds (276-9082) $5.98
1 pc dual mini board (276-148) $3.99
5 100Ω resistors (271-9019) $3.99
1 mosfet irf-510 (276-2072) $3.59
1 usb cable (261-1239) $19.99 (they are insanely overpriced, try to
get an old one somewhere)
1 solder d-sub connector (276-1547) $6.99 (an old parallel cable would do it)
2 9v battery clips (270-325) $2.99 (any other connector would do it)
soldering stuff
a project box
some wire
*the leds
we're going to start with the easy part.
i have a transparent circle in the middle of the centre panel. i call
it the crotch light, since it has no other practical use. that is
where my lights will go, but you can always put them anywhere you
want, as long as you keep the circuit in the same fashion.
basically, the circuit goes like this:
Code: |
(+) ------------+----/\/\/\-------(>|)-----+
| |
+----/\/\/\-------(>|)-----+
| |
+----/\/\/\-------(>|)-----+
| |
+----/\/\/\-------(>|)-----+
|
(-) ---------------------------------------+
/\/\/\ = 100Ω resistor
(>|) = blue led
|
make sure to solder the leds in the right position. the longer lead is
the positive and the short one is for ground or negative. now, add the
9v battery clips (or any the connector of your choice) to the positive
and negative side. important: if you do use the 9v battery clips, you
need to invert this. you know, solder the black wire to the positive
side of the leds and the red wire to the negative side.
there, you're done with the leds. easy, eh?
*the cool device.
now, this is the fun part. thanks again to cnlohr.
cut the usb cable in half. now, open it up and poof, you will find
four cables (and probably a bunch of metal shielding, you can take
that off). we will not worry about the white and green cable, so we
can trim those off. the red cable is positive and the black one...
yes, you got it! the black one's ground. put that aside for a moment.
now, cut the parallel cable and open that up. you will see twenty five
different cables. find out which ones correspond to pin 6, 20 and 25.
you can trim all the other wires if you want, or just cover them with
some electrician's tape, in case you need them later.
the circuit goes like this:
Code: |
(-) ----------------------(20)(25)(S)
R
R (D)--------(N)
R
-------------(6)(G)
(S) = source. if you have your mosfet facing up, it's the one on your right.
(D) = drain. it's the center pin
(G) = gate. it's the one of the left, if your mosfet is facing up.
(20) = to pin 20 on the parallel port
(25) = to pin 25 on the parallel port
(6) = to pin 6 on the parallel port
(-) = to black wire on the usb cable
(N) = to the negative side of the LED's
R = 100Ω resistor (between S and G)
|
now, make sure your connections are right. you don't want to fry your
parallel port, do you?
you can now solder (N) to the black wire on your 9v battery clip. then
solder the red wire from your usb cable and solder it to the red wire
on the battery clip.
after that is done, make sure your connections are right.
and that completes the hardware part.
now, before you do anything else, please make sure your connections are right.
*the software.
cnlohr is hosting the dll that you need in order to get stepmania to
light up your leds. this is the address:
http://www.cnlohr.net/SMLights/parallel_lights_io.dll
make sure to thank him for that. download that and save it in your
stepmania/programs folder.
now, go to your data folder and open the file stepmania.ini. scroll
down to the [options] header and add the following line:
LightsDriver=Parallel
make sure all your connections are right and turn off the computer
before plugging anything in there, just in case.
attach the parallel cable to the back of your computer, then plug the
usb cable to the usb port and finally, clip the two 9v battery
thingers together. turn on the machine.
if you don't see fire, you're ok (accident number 2).
the leds may not be on, but don't worry about it (yet).
open up stepmania and the lights should start blinking. choose a song
in standard mode and see how the lights flash to the beat.
yay!
... if that doesn't happen, then unclip the lights and put them
backwards. maybe you screwed up when you were soldering.
make sure all the cables are connected properly.
after checking the cables, then try one more thing: get the black wire
from the usb cable and connect it to the negative side of the leds
(thus, avoiding the whole circuit). if the leds light up, then the
power is ok. if they don't, then either the leds are backwards or the
usb port is not working.
lastly, check all your connections.[/b]
Last edited by latindude88wpg on Wed Aug 24, 2005 9:40 pm, edited 3 times in total |
|
Back to top |
|
|
1337Gaara Trick Member
Joined: 08 Dec 2004
|
1. Posted: Sat Jan 22, 2005 2:22 pm Post subject: |
|
|
do you have AIM or MSN i would like to discuss something with ya thanks! pm me or respond to here, ill check in a bit thanks |
|
Back to top |
|
|
latindude88wpg Trick Member
Joined: 12 Nov 2004 Location: winnipeg, mb |
2. Posted: Sun Jan 23, 2005 5:22 pm Post subject: |
|
|
check your pm. |
|
Back to top |
|
|
1337Gaara Trick Member
Joined: 08 Dec 2004
|
3. Posted: Sun Jan 23, 2005 10:58 pm Post subject: |
|
|
thanks for all your help over the IM, cant wait to do this myself! ill post pics in here when i finish mine |
|
Back to top |
|
|
SuRfReAk Trick Member
Joined: 19 Dec 2004
|
|
Back to top |
|
|
latindude88wpg Trick Member
Joined: 12 Nov 2004 Location: winnipeg, mb |
5. Posted: Tue Feb 08, 2005 9:06 am Post subject: |
|
|
yah, i sent it to one of the contributors already. do you guys have any comments on how to improve it?
the only one i have so far is that quite a few people have had trouble while soldering wires to the mosfet, so you may just want to use a breadboard instead. apparently mosfets are quite sensitive to temperature changes and static and a bunch of things. woosies. |
|
Back to top |
|
|
eepiccolo Trick Member
Joined: 29 Oct 2004 Location: Frederick County, MD |
6. Posted: Thu Feb 10, 2005 10:30 am Post subject: |
|
|
Questions/Issues:
1) Why do you have such large resistors in series with the LEDs? According to my rough calculations, it leaves you with ~0.01 mA to drive the LEDs, which seems way too low. The low current isn't helped by the fact that blue LEDs have such high voltage drops.
2) Why use a MOSFET? Why not a BJT? Then you wouldn't have to worry about frying the thing with static discharge.
3) Why do you have a resistor connecting the source and the gate?
Note: I've been looking at this under the assumption that your voltage coming from your USB cable is ~5V.
Oh, that remeinds me.
4) It would be better to get your power from one of the auxiliary connectors of the power supply than from the USB. It saves a USB port, and it's probably better not to screw aroung with the USB power anyway. Most cases I've seen have somewhere where you can snake a wire/cable from the inside to the outside. _________________
|
|
Back to top |
|
|
latindude88wpg Trick Member
Joined: 12 Nov 2004 Location: winnipeg, mb |
7. Posted: Thu Feb 10, 2005 11:41 am Post subject: |
|
|
hi epiccolo,
1) resistors:
i believe you're right. see, i calculated this way:
usb voltage: 5v
led voltage: 3v
that means we have to drop 2v before it reaches the led, so considering the led is 10mA, we could just go
R = V/I
2/10mA = 200 ohms... which makes no sense at all, so i just used a 100 ohms resistor.
2) why a mosfet? i dunno, it sounds really nice. and i don't know what a bjt is. i'm not that big into electronics, i just read a lot about it and put it all together. maybe you'd like to let me know how to use a bjt, cuz i honestly don't know
3) there was a discussion going on about this at ddrmaniax.net. unfortunately the server is down and i can't get the info about why there is a resistor in between. someone said something about making sure your motherboard didn't get fried or something, but i honestly don't remember. as i said, i just put together a bunch of people's ideas.
4) i tried using the power from one of the free power supply molex connectors, but honestly it looks cleaner and more professional if you just have an usb connector plugged to the front of your computer rather than having a wire coming out a random hole in your case. usb ports can be used as a source of power, and people even make
things like this.
once again, i don't know everything about this and i'm sure there are different and maybe better ways of doing all this, so i would totally appreciate if you guys get involved.
happy ddring |
|
Back to top |
|
|
eepiccolo Trick Member
Joined: 29 Oct 2004 Location: Frederick County, MD |
8. Posted: Thu Feb 10, 2005 1:01 pm Post subject: |
|
|
latindude88wpg wrote: | hi epiccolo, |
And a big hello back to you, latindude88wpg
latindude88wpg wrote: | 1) resistors:
i believe you're right. see, i calculated this way:
usb voltage: 5v
led voltage: 3v
that means we have to drop 2v before it reaches the led, so considering the led is 10mA, we could just go
R = V/I
2/10mA = 200 ohms... which makes no sense at all, so i just used a 100 ohms resistor. |
I'm not sure what you mean by 200Ω not making sense. Also, there is a difference in what you say here and what's in your first post. Here you say you're using 100Ω, but in your first post you say you're using 100KΩ
latindude88wpg wrote: |
2) why a mosfet? i dunno, it sounds really nice. and i don't know what a bjt is. i'm not that big into electronics, i just read a lot about it and put it all together. maybe you'd like to let me know how to use a bjt, cuz i honestly don't know |
MOSFET stands for Metal Oxide Semiconductor Field Effect Transistor. BJT stands for Bipolar Junction Transistor. I could get into the differences, but that would take awhile. Suffice it to say that they behave somewhat differently, but similarly enough that a BJT should work in this application. BJTs have an Emitter (E), a Collector (C), and a Base (B), which correspond to the Source, Drain, and Gate of a MOSFET, respectivly. And the npn BJT corresponds to the n-type MOSFET.
latindude88wpg wrote: | 3) ... someone said something about making sure your motherboard didn't get fried or something... |
The only possible thing I could see is that maybe people were worried about a charge build on the MOSFET gate, and the resistor would provide a means of escape for that charge, rather than just through pin 6 of the LPT. I'm just making a wild guess, though. I personally don't think something like that could happen. But maybe someone else here could explain another reason for the resistor?
latindude88wpg wrote: | 4) i tried using the power from one of the free power supply molex connectors, but honestly it looks cleaner and more professional if you just have an usb connector plugged to the front of your computer rather than having a wire coming out a random hole in your case. |
Well, you could have the power coming out of the back of the case . Oh well, to each their own.
That's just disturbing.
So anyway, what you've made is a basic switching circuit. And the most important thing I want to convey is a BJT should work just fine for this. Oh, and in case you were wondering, my BS was in Electrical Engineering, which is why I know all this crap. (And it also partly explains my screen name ) _________________
|
|
Back to top |
|
|
latindude88wpg Trick Member
Joined: 12 Nov 2004 Location: winnipeg, mb |
9. Posted: Thu Feb 10, 2005 2:05 pm Post subject: |
|
|
hi eepicolo (sorry, i didn't spell it right the first time).
whoa, thank you for letting me know that mistake with the resistors. bad, bad, very very bad, latindude88wpg. *spanks himself* i'm sorry if that caused some confusion (hopefully not).
oh! transistor! lol! well, i used one that looked like this(i think it was 2N4003) and it fried, but i'm assuming it's cuz i was using the wrong one. cnlohr says on his website that a transistor can be used as long as it's an npn, but he does not give a part number or something to use. would you know any specs that this circuit would need in order to function properly?
why would you use a bjt instead of a mosfet, if i may ask?
and yah, i didn't like the idea of having a cable coming out from anywhere on the case (or the back, or the side, or anywhere), that's why i used the usb connector, but you know, the power can be drawn from either one, as long as it's 5v and it has a common ground with your compy. |
|
Back to top |
|
|
eepiccolo Trick Member
Joined: 29 Oct 2004 Location: Frederick County, MD |
10. Posted: Thu Feb 10, 2005 4:23 pm Post subject: |
|
|
Don't worry about the name.
Anyways, the picture link seems to be broken, but it couldn't have been a 2n4003. That's a diode. Now perhaps it was a 2n4403? If so, that's still a problem, pecause that's a pnp transistor. Examples of npn transistors are the 2n4400 or the 2n4402.
And I would use a BTJ because it isn't sensitive to static discharge like MOSs, so you can handle it relativly care-free. MOSs are normally used when you need something to switch really, really fast, which isn't this application. _________________
|
|
Back to top |
|
|
latindude88wpg Trick Member
Joined: 12 Nov 2004 Location: winnipeg, mb |
11. Posted: Thu Feb 10, 2005 10:37 pm Post subject: |
|
|
i believe it was a 2n4402 then. my dad told me that would do it (he also is an electrical engineer, so i blindly trusted him, lol) i'll try to find the fried one and see if there's any numbers still visible.
so you think a bjt would be better then? would you be able to draw some schematics and post them here? i'm sure people would appreciate that.
either way, the schematics i posted do work, and it looks really really cool! |
|
Back to top |
|
|
eepiccolo Trick Member
Joined: 29 Oct 2004 Location: Frederick County, MD |
12. Posted: Fri Feb 11, 2005 6:14 am Post subject: |
|
|
It may have just been a bad transistor to start, who knows?
Oh boy, circuit schematics! I don't make those very much anymore since I graduated, because I do different engineering stuff at my job. But I'll try to put one together over the weekend, scan it in, and post it.
Actually, on a somewhat related note, does anybody know of any good, free circuit drawing software? I know good and free don't generally go together, but you never know. _________________
|
|
Back to top |
|
|
latindude88wpg Trick Member
Joined: 12 Nov 2004 Location: winnipeg, mb |
13. Posted: Fri Feb 11, 2005 1:08 pm Post subject: |
|
|
an ascii schematic would do it too. or just explain how the mosfet could be replaced by the transistor.
correct me if i'm wrong, but would it be:
edit: (as to avoid confusion)
base = gate
collector = drain
emitter = source
and then everything else would be the same?
thanx a lot for your help, eepiccolo.
Last edited by latindude88wpg on Wed Mar 09, 2005 9:03 am, edited 1 time in total |
|
Back to top |
|
|
ch Trick Member
Joined: 01 Oct 2004 Location: IN UR FORUM POSTING ON UR THRED |
14. Posted: Mon Feb 14, 2005 12:57 pm Post subject: |
|
|
theres always this schematic:
r1 is the "optional" resistor
t1 is your transistor/mosfet
r2 is a 100⦠resistor
d1 is your led/light/whatever you have
5v goes to usb or internal power
p.s. go mspaint _________________
|
|
Back to top |
|
|
eepiccolo Trick Member
Joined: 29 Oct 2004 Location: Frederick County, MD |
15. Posted: Tue Feb 15, 2005 5:15 am Post subject: |
|
|
Crud, sorry, I got busy.
latindude88wpg, you got you emitter and collector mixed up. The collector coresponds to the drain, and the emitter corresponds to the source.
cartoonhero_604, it looks like you were going by latindude88wpg's post, so you also got the collector and emitter mixed up. But it looks like you mixed up where pins 6, 20, and 25 go. Unless I'm mistaken, 6 should go the the gate/base, and 20/25 should go to the source/emitter. _________________
|
|
Back to top |
|
|
ch Trick Member
Joined: 01 Oct 2004 Location: IN UR FORUM POSTING ON UR THRED |
16. Posted: Tue Feb 15, 2005 8:10 am Post subject: |
|
|
sorry, read the txt file from clnohr wrong. maybe thats why it wasnt working for you, latindude.
i fixed the pic, you can use that now. just hit refresh. and if that doesnt work, turn the led around.
also, you can draw internal power from the computer power harness. the yellow wire is +5v, the black wire right next to it is 0v _________________
|
|
Back to top |
|
|
latindude88wpg Trick Member
Joined: 12 Nov 2004 Location: winnipeg, mb |
17. Posted: Tue Feb 15, 2005 10:07 am Post subject: |
|
|
as far as i know, the yellow wire is +12v, the red one is +5v and the black one is ground.
if you use the yellow wire (12v) for a 5v device, it's very likely it's going to burn. |
|
Back to top |
|
|
eepiccolo Trick Member
Joined: 29 Oct 2004 Location: Frederick County, MD |
18. Posted: Tue Feb 15, 2005 10:37 am Post subject: |
|
|
Your collector and emitter are still reversed, cartoonhero_604. The emitter of an npn is almost always the terminal that's grounded. _________________
|
|
Back to top |
|
|
ch Trick Member
Joined: 01 Oct 2004 Location: IN UR FORUM POSTING ON UR THRED |
19. Posted: Tue Feb 15, 2005 11:15 am Post subject: |
|
|
dang
fixed again
i was wondering why the emitter was going against the led
clnohr wrote: | ...power NPN Switching transistor...
...hook the "Gate" pin to pin 6 of your parallel port. And put the "Source" in pin 20 of your parallel port... |
_________________
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB 2 © 2001, 2002 phpBB Group
|