The MP3car.com Store  

Welcome to the MP3Car.com forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Registering will also remove advertisements. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development

Reply
 
Thread Tools Display Modes
Old 09-11-2005, 09:47 AM   #1
Newbie
 
Join Date: Sep 2005
Posts: 7
My Photos: (0)
LEDs and PC controller

Just to net you know I’m a bit of a noob with most of this stuff.

This is not going to be put in my car but I might want to some day. The reason I’m posting here is that I think people could help me more than other PC mod forums I go to. So, here is what I want:
(in order of importance)
- I want to illuminate my PC in tri-color(RGB) LEDs, I currently use cold cathodes.
- I want to be able to set the color manually with 3 knobs.
- I also want to be able to set it up to do set of sequences. For example fade between colors. I could also like some thing random change with no fade ever .5 – 5 seconds.
- I would also like the option to have it determine what color and their intensities by my computer sound. Using the right, left channels and the third color by the frequencies.
- Have several “zones” like right, left then have 6 vertical zones for the sound and fading (this one is pushing it a bit)

I am thinking that I could use some sort of controller on my PC to control all of this except for the 3 knob basic color changer. Basically I just want some advice to what I should use, if it is possible and how I should go about doing this. I would really appreciate it someone could link me to what device and programming langue I should use. (I currently program in Java and PHP, thought Java probably would not work well for what I want)

I’m just looking for some guidance.
2n193r is offline   Reply With Quote
Sponsored Links
Old 09-13-2005, 12:12 AM   #2
Low Bitrate
 
widower's Avatar
 
Join Date: Jun 2005
Posts: 85
My Photos: (0)
I'm not clear if you are planning on using your pc as a controller, or designing a seperate board that is controlled by the pc.

If it's just reading the knobs on a pc that is causing you headache, I would suggest that you look at the game port of old machines. You can still buy usb to game port adaptors. The gameport uses a monostable that provides different pulse widths depending on what resistance is across one of the axes inputs. I know the old apple2 required pots that reached either 100K or 150Kohms. for the pc gameport requirements.

If it's a seperate controller that you are thinking of, then take a look at the PIC controllers from Microchip Technologies. Some of the PICs have analog inputs.
widower is offline   Reply With Quote
Old 09-13-2005, 02:09 PM   #3
Newbie
 
Join Date: Sep 2005
Posts: 7
My Photos: (0)
My idea was to use my computer to control the LEDs. Because I was thinking of using tri-color (RBG) I could use my computer to change how bright they are and then illuminate my pc in any color. (in a good way) I think I used “controller” in a bad way, I wanted to use my PC to control the LEDs. That way I could fade them any way I would like and do pretty much any thing. I could also have the audio synchronize up to the colors in any why I would like if I could use a programming langue on my computer to control it.

Basically I’m looking for some hardware what I can hook up to my PC and control several outputs.
2n193r is offline   Reply With Quote
Old 09-13-2005, 02:34 PM   #4
Newbie
 
Join Date: Sep 2005
Location: Pittsburgh
Vehicle: '03 Hyundai Elantra
Posts: 14
My Photos: (0)
From and Electrical Engineering view, you're going to need to design a circuit board that is either controlled by serial, parallel or USB. From there, you can design software to send certian signals to the board to control the various functions you are looking for. Not an easy thing to do. Maybe someone knows of some quick development hardware that could make things easy for you. Like a microcontroller interfaced to the computer that developers use to test and control new circuits.

Sound like something I would do for my EE senior project.

Good Luck!
__________________
**************************************
'03 Hyundai Elantra
Pioneer 7600 Head Unit
Dual 12" Subs w/ Rockford Amp

Carputer:
VoomPC w/ M1-ATX PSU
VIA MII 12k w/ 1GB, 40GB 2.5" HDD
Wi-Fi, BT, DVD-ROM
7" Xenarc 700TSV
WinXP Pro, Delorme SA2006
ninjatill is offline   Reply With Quote
Old 09-13-2005, 02:54 PM   #5
Maximum Bitrate
 
mushin's Avatar
 
Join Date: Aug 2004
Location: SE Michigan
Vehicle: MR2 Spyder
Posts: 750
My Photos: (0)
For the simplist solution, you should be able to use the parallel port to PWM the RGB channels to get the color you want. Since the PC is doing all the logic for the effects, and the LPT port should be fast enough to hold a color, you don't need any additional controller hardware. Take 3 data pins, one for each color, wired to transistors to switch power to your LEDs. You'll probably need to duty cycle down to 1/16 to get a good color range, and refresh them at around a kHz to eliminate flicker. After that it's all software.
mushin is offline   Reply With Quote
Old 09-13-2005, 07:42 PM   #6
Newbie
 
Join Date: Sep 2005
Posts: 7
My Photos: (0)
mushin I don’t see how I could fade with that. Thanks for the offer, but I think I will try it on my own first. Cool project by the way.

I was thinking that my computer would have to send out the intensity (if using 3 data lines). The thing that I would need the most help is with the hardware that will accept that data. I think I might be able to find out how to design the software. But some links might be useful. My knowledge on EE is very limited, but I would love to learn more. (I found some links on tutorials; I’ll have to read some.)

I know too much about making my own peripherals. Or programming them for that matter.

Ahhh, I’m so lost, I need to find my way.

EDIT: I have programming experience in Java and PHP. It would be cool if I could do it in Java then I could make it platform independent. I am also planning on starting C++ in the next few weeks. I so far did the AP CS A subset and now working on the AB exams (college board exams). I think I could find a java library for some thing like this, if anyone has any ideas what I should search for to find thins please reply.

Thanks

Last edited by 2n193r : 09-13-2005 at 07:57 PM.
2n193r is offline   Reply With Quote
Old 09-13-2005, 11:20 PM   #7
Maximum Bitrate
 
mushin's Avatar
 
Join Date: Aug 2004
Location: SE Michigan
Vehicle: MR2 Spyder
Posts: 750
My Photos: (0)
With the PWM method, fading is done via slowly changing the duty cycle.

Alternatively you could use DACs. An 8bit DAC chip can be had for a few bucks on digikey and elsewhere. The analogue output would then control the current to the LED(s) via a transistor.

My main advice though, is to start really simple and start playing with it. Do you have a multimeter? If not get one. Then get some LEDs, resistors, transistors, and a solderless breadboard. Get LEDs turning on and off with a signal, first manually then from the the computer. Then worry about how you're going to get all the fancy features you want, you'll have much better idea of what you're working with at that point.

edit: I wish this thing would stop underlining the word "via". via != VIA. "Via" is a bleedin' English word.

edit2: Shouldn't this be in Hardware Development, not Software?

Last edited by mushin : 09-13-2005 at 11:24 PM.
mushin is offline   Reply With Quote
Old 09-14-2005, 06:38 PM   #8
Newbie
 
Join Date: Sep 2005
Posts: 7
My Photos: (0)
PWM – would allow me to give power to the light then off at different on intervals. It would do that relativity fast so I don’t get it going on and off?

DAC – I don’t under stand this as much because I did not o read as much, will do this week end (have a paper I have to do tonight and a few tests/quizzes fri). It seems like it does the same thing but converts the signal to a analog one, right?

What way would you think is best for a noob like me?

Do you have a multimeter?
No, but i have one that i can use. I'm looking at getting my own, I see myself using it MANY times.
solderless breadboard – getting one when I get the test supplies, at RadioShack I saw these wires that are for them, are they good or would help?
resistors, transistors – I’ll get like an assorted pack
LEDs - I’ll first get like 5-10 so I can test every thing out, I figured I’ll burn some up.

I was looking on digikey and I found TUNS of those and I have no clue what I need. Can you give me a part number or specs that I would need. (just if any one knows what they are doing and want to help a noob learn )

I still have a bunch of sites I want to read so I can understand more. Thanks for the help so far mushin, you given exactly what I need, a push in the right direction.

Last edited by 2n193r : 09-14-2005 at 07:45 PM.
2n193r is offline   Reply With Quote
Old 09-15-2005, 01:52 PM   #9
Maximum Bitrate
 
mushin's Avatar
 
Join Date: Aug 2004
Location: SE Michigan
Vehicle: MR2 Spyder
Posts: 750
My Photos: (0)
Quote: Originally Posted by 2n193r
PWM – would allow me to give power to the light then off at different on intervals. It would do that relativity fast so I don’t get it going on and off?

Yes. Around 60hz, human eyes can no longer see flicker, and you'll just see a constant light with a brightness determined by the on/off ratio.

Quote: Originally Posted by 2n193r
DAC – I don’t under stand this as much because I did not o read as much, will do this week end (have a paper I have to do tonight and a few tests/quizzes fri). It seems like it does the same thing but converts the signal to a analog one, right?

Well, yes on the analogue aspect, but it's a very different approach from PWM. There's no on/off switching, instead each LED gets a constant current of varying amount based on the voltage.

Quote: Originally Posted by 2n193r
What way would you think is best for a noob like me?

I would recommend giving PWM at least a shot first, since it's much simpler from the hardware end. The complexity is pushed onto the software, but I take it you're not as newbiesh on that end.

Quote: Originally Posted by 2n193r
solderless breadboard – getting one when I get the test supplies, at RadioShack I saw these wires that are for them, are they good or would help?

Yeah, the hookup wire packs are very handy in making circuits on a breadboard. Definately get some.

Quote: Originally Posted by 2n193r
I was looking on digikey and I found TUNS of those and I have no clue what I need. Can you give me a part number or specs that I would need. (just if any one knows what they are doing and want to help a noob learn )

Digikey can be pretty overwhelming if you don't know exactly what you're looking for, particularly if it's common part

You can calculate the resistor value you'll need using one of the LED calculators floating around the 'net.

Get some NPN & PNP bipolar junction transistors (BJTs). You don't actually need both types, but it's good to get an understanding of how they work, since this is a point of confusion for a lot of people.

Digikey may not be the best place to get parts, since they charge handling below the $25 minimum order. Check out www.allelectronics.com or www.sparkfun.com, which incidentally have a lot less overwhelming selections You can find this stuff at the RatShack too; they're overpriced, but you do save on shipping when you just need a couple.

For LEDs, I recommend www.lsdiodes.com.
mushin is offline   Reply With Quote
Old 09-15-2005, 03:57 PM   #10
Low Bitrate
 
widower's Avatar
 
Join Date: Jun 2005
Posts: 85
My Photos: (0)
Basically I’m looking for some hardware what I can hook up to my PC and control several outputs.[/quote]

Understood. Sorry it took me so long to get back to this thread. Haven't read it all.

There are two types of tri-coloured leds that I'm aware of. Both types will work. Just your connections will change a bit and your software.

Connect the leds to the PC using the parallel port. You have 8bits of data that you can work with. There are also strobes and stuff but if you setup your bios to use a standard lpt instead of dma, then the 8bits should be fine. This signals swing from aprox. 0V to 5V. So if you are using a 2wire tri-colour led, connect one data bit to a resistor, then the resistor to the led, then the other led pin to another data bit. If the first databit (D1) is 0V and D2 is 0V, the led is off. If D1 is high and D2 is low, the led is red, if D1 is low and D2 is high the led is green and if you constantly change the led from red to green, you will see yellow (depending on how fast you switch).

For brightness, turn the led on and off continuously. If the led is on longer than off, it will be brighter. This is PWM (Pulse width modulation).

That's it. You can for software to control the lpt port. I believe the data pins are pins 2 through 9 and the strobe is pin 1 but to be sure.
widower is offline   Reply With Quote
Sponsored Links
Old 09-15-2005, 04:03 PM   #11
Low Bitrate
 
widower's Avatar
 
Join Date: Jun 2005
Posts: 85
My Photos: (0)
BTW: To calculate the resistor value:

lpt datapins are usually 0-5V
A = LED on Voltage
I = LED on current

resistorInOhms = (5-A)/I

so if A=3Volts and I=15ma

resistor = (5-3)/.015

which is 133Ohms. You can always start with a larger resistor if you aren't sure of the led specs. Say 512ohms and then reduce it until the brightness looks good. Don't exceed the LED forward biased current.
widower is offline   Reply With Quote
Old 09-15-2005, 04:18 PM   #12
Maximum Bitrate
 
mushin's Avatar
 
Join Date: Aug 2004
Location: SE Michigan
Vehicle: MR2 Spyder
Posts: 750
My Photos: (0)
Quote: Originally Posted by widower
So if you are using a 2wire tri-colour led, connect one data bit to a resistor, then the resistor to the led, then the other led pin to another data bit. If the first databit (D1) is 0V and D2 is 0V, the led is off. If D1 is high and D2 is low, the led is red, if D1 is low and D2 is high the led is green and if you constantly change the led from red to green, you will see yellow (depending on how fast you switch).

I would recommend against powering the LED directly from the data pins. IIRC, the LPT data pins can source/sink somewhere on the order of 10ma; LEDs are usually rated around 20ma (constant), not to mention if more than one LED is desired for increased luminosity.

Also, what you describe there is a bi-color LED (I guess you're counting the derivative yellow as a 3rd color?) Tri-color (RGB) LEDs, at least the one's I've seen, are all 4-pin common cathode.
mushin is offline   Reply With Quote
Old 09-15-2005, 04:31 PM   #13
Newbie
 
Join Date: Sep 2005
Posts: 7
My Photos: (0)
There will be a quite a bit of LEDs involved, I’m lighting my entire PC case + possible ground FX. I initially thought I could do it the way widower suggested but then I would not have enough power.

This is my general idea of what’s going down.

Parallel port(sends data) --> PWM(sets the on/off timing) --> transistor(giving LEDs enough power) --> resistor(setting the exact power required) --> LEDs(light up my soon to be drop dead sexy computer)
Do that 3 times, one for each color.

Is that about correct?

Mushin, thank you SO much, I probably appreciate much more later (not that I don't now). You have been a great help.
2n193r is offline   Reply With Quote
Old 09-15-2005, 04:32 PM   #14
lez
FLAC
lez's CarPC Specs
 
lez's Avatar
 
Join Date: Jan 2004
Location: UK
Vehicle: XM 2.1 TD
Posts: 1,281
My Photos: (0)
above the last post.

Not only that but you cant 'program' the lpt port to do pwm and just leave it running, no such commands exist.

You can leave a pin high or low, but not pulsing.

You would need to write a program to run in the background doing the pwm (at cost of cpu) and a program to set the levels for the background driver.

hardware. Pic chip. job done.
lez is offline   Reply With Quote
Old 09-15-2005, 05:55 PM   #15
Maximum Bitrate
 
mushin's Avatar
 
Join Date: Aug 2004
Location: SE Michigan
Vehicle: MR2 Spyder
Posts: 750
My Photos: (0)
lez, I wasn't pushing him towards a PIC because that's another can of worms for a complete beginner.

lez is right though, the software needs to be constantly refreshing the LEDs to maintain colors. Ultimately, it is more elegant to have a uC (or hell, a display controller IC) handle this duty, but I'm sure 2n193r can tackle that step if and when he feels ready.
mushin is offline   Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
New product - PC Power switch with wired remote hd54321 General Hardware Discussion 5 03-08-2006 10:48 PM
PC boot problems Davefocus General Hardware Discussion 7 07-17-2005 05:24 PM
Ultimate control over interior lighting impulsenine Hardware Development 39 06-23-2005 10:42 PM
Remote PC Power Switch Terran General Hardware Discussion 6 01-06-2005 08:13 PM
Custom Dash with car pc status leds M^ck^y General MP3Car Discussion 2 09-08-2004 12:03 PM


All times are GMT -5. The time now is 05:12 AM.


Sponsored Links
The MP3car.com Store

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Copyright © 1999 - 2008 Mp3Car.com Inc.
Ad Management by RedTyger
Message Board Statistics