Announcement

Collapse
No announcement yet.

LEDs and PC controller

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #2
    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.

    Comment


    • #3
      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.

      Comment


      • #4
        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

        Comment


        • #5
          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.

          Comment


          • #6
            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

            Comment


            • #7
              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?

              Comment


              • #8
                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.

                Comment


                • #9
                  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.

                  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.

                  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.

                  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.

                  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.

                  Comment


                  • #10
                    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.

                    Comment


                    • #11
                      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.

                      Comment


                      • #12
                        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.

                        Comment


                        • #13
                          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.

                          Comment


                          • #14
                            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, more widely known as flez1966

                            Comment


                            • #15
                              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.

                              Comment

                              Working...
                              X