Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: LED control idea  (Read 7153 times)

0 Members and 1 Guest are viewing this topic.

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
LED control idea
« on: February 13, 2005, 12:42:20 am »
After seeing all the posibilities of LED lighting, I thought of something.  This may have already been done, but it resembles the idea of DDR.  I want to drill a small hole in my control panel, under the overlay, and put some LEDs in there right by the joysticks.  Around the joystick, there are arrows.  These arrows will light up during gameplay.  What I wanted to do is make a switch where you have three options: On, Game and Off.  On will light all the LEDs at all times.  Off will turn them off.  Game will make it so if you push up on the joystick, the UP arrow will light.

What do you guys think?  I will also be putting a rope-light and lighted 1 + 2 player START buttons on too.

fastredpacman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:February 19, 2018, 02:12:36 am
  • What?
Re: LED control idea
« Reply #1 on: February 13, 2005, 12:59:59 am »
Sounds pretty cool!! ;D

ShinAce

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 152
  • Last login:January 16, 2007, 07:38:14 pm
  • Building the unbuildable since 2001
Re: LED control idea
« Reply #2 on: February 13, 2005, 09:05:26 am »
Nothing crazy about it. You could do it using just about any type of 2-input digital gate.
I'd go with NAND gates myself. What you do is short the first input of each gate together, and that's your control. 0 volts on that line will cause all lights to light up. 5 volts will light them when the button is pressed. To turn them all off permanently though, would require some extra steps. A multiplexer, or something along those lines. It doesn't seem worth it to me.

What you need to do is choose which 2 setups you want. Because all 3 will take some serious man hours to implement.
An ounce of image is worth a pound of performance.

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: LED control idea
« Reply #3 on: February 13, 2005, 10:31:30 am »
Well getting all those components is much more expensive than my origional plan, which I already have worked out.  It doesnt require any gates, just common knowledge and switches, oh and quite a bit of wire.

ShinAce

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 152
  • Last login:January 16, 2007, 07:38:14 pm
  • Building the unbuildable since 2001
Re: LED control idea
« Reply #4 on: February 13, 2005, 11:11:01 am »
Exactly, switches. How many switches are you going to use?

I'd have 1 switch, and about 2 IC's. Which means I can do it for under 5$.

There's always dip switches, but that's not my style.
An ounce of image is worth a pound of performance.

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: LED control idea
« Reply #5 on: February 13, 2005, 07:24:28 pm »
How exactly would you do that?  My idea was just to use one switch with 2-3 selections.  Mine would just be simple wiring, and one switch.

Is there any way you could perhaps make a schematic or something simple?

ShinAce

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 152
  • Last login:January 16, 2007, 07:38:14 pm
  • Building the unbuildable since 2001
Re: LED control idea
« Reply #6 on: February 13, 2005, 10:07:18 pm »
How are you going to wire up the led's for the 'game' function?
An ounce of image is worth a pound of performance.

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: LED control idea
« Reply #7 on: February 13, 2005, 10:27:16 pm »
I was going to connect them directly to the mircoswitches.  For a switch to activate, you press the button right?  So I will wire them to the button so when it's pressed, a circuit is complete, therefore, a LED will be lit.

Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • Last login:February 12, 2015, 02:51:45 pm
  • I'm a llama!
Re: LED control idea
« Reply #8 on: February 13, 2005, 10:39:11 pm »
I was going to connect them directly to the mircoswitches.  For a switch to activate, you press the button right?  So I will wire them to the button so when it's pressed, a circuit is complete, therefore, a LED will be lit.

I could be wrong, but I don't think microswitches draw enough juice to power an LED (20 milliamps or so are needed) You're planning on wiring an LED in parallel with the microswitch, right?

Seems like the "flash" would be too brief to see very well. But if you try it, please post the results.

I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: LED control idea
« Reply #9 on: February 14, 2005, 07:26:04 am »
Well I can't really try right now because Im in the planning stage, but using transistors or something, Ill draw the actual power from a 12v computer connector.  When a signal is passed through the microswitch, it will allow the 12v to pass to the LED.  Gonna be one hell of a circuit!  Either way, cant try now because 1) Im still planning 2) I dont have parts until I plan and get cash 3) I dont have a job because im still in highschool :)

tetsujin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 222
  • Last login:April 10, 2007, 05:51:25 pm
  • My controls will have programmable button labels.
    • My Homepage
Re: LED control idea
« Reply #10 on: February 14, 2005, 01:34:55 pm »
I was going to connect them directly to the mircoswitches.  For a switch to activate, you press the button right?  So I will wire them to the button so when it's pressed, a circuit is complete, therefore, a LED will be lit.

That's not really a good way to think about how your encoder works, though.  It doesn't detect a "closed circuit" so much as it detects a change in voltage level.  Typically, the inputs will be on pull-up resistors that keep them at +5V, and that voltage will connect to the switch which leads to ground.  When the circuit is closed, current will flow from +5V, through the pullup resistor, through the switch, to ground, and the current going through that resistor will be great enough that the voltage on the input pin will drop to zero.

If you put an LED in series with your switch, here's what will happen:  When the switch closes, current will flow through the LED and resistor.  This means that both the resistor and LED will have a voltage drop.  So the voltage at the input will reflect the voltage across the LED.  If it's only a volt or two that might be OK, depending on the circuit reading the input.  If it's three, that might be enough for the encoder to think the input is still "high".

A better way would be to have another circuit which reads the same voltage as the input.  One way to do this would be to wire the LED from the input, through a resistor to +5V.  Then the LED will turn on when the voltage at the input goes low.

High School Physics classes sometimes have a good introduction to electrical circuits.  Soak it up if you can.

And microswitches will have no problem passing a couple hundred mA.  Typically they're rated for at least 1 amp.
---GEC

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: LED control idea
« Reply #11 on: February 14, 2005, 03:21:32 pm »
Heres what I came up with over the last few days, and I only understood half of what tetsujin said because, well, im an idiot in electronics.
« Last Edit: February 14, 2005, 03:59:26 pm by cholin »

Kremmit

  • - AHOTW -
  • Wiki Contributor
  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3165
  • Last login:June 17, 2025, 04:07:55 pm
  • Who the heck is that?
Re: LED control idea
« Reply #12 on: February 14, 2005, 04:10:00 pm »
I'm a long way from being a transistors 'n diodes guru, but.. a microswitch has 3 terminals- NO, NC, and GND.  If the I-Pac is connected to NO, then you ought to be able to build a circuit that will send power to the  LED whenever the NC terminal opens.  That way you don't have to worry about messing up your I-Pac inputs with your LED stuff.  Won't work for leafswitches, though.

If I've got my head up Myanus (21st moon of the planet Uranus), feel free to tell me.

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: LED control idea
« Reply #13 on: February 14, 2005, 04:12:31 pm »
What Im going to do, is connect the switches normally, there will be NO change to them at all.  When you press the switch (NO I think) it will close.  When a switch closes is when it will send the signal.  Dont worry, I dont need advice on this becausse I drew up a circuit in Geography today and it should work, I just need to know how much power goes where and stuff like that.

ShinAce

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 152
  • Last login:January 16, 2007, 07:38:14 pm
  • Building the unbuildable since 2001
Re: LED control idea
« Reply #14 on: February 14, 2005, 04:30:55 pm »
Kremmit, if the COM tab is connected to ground, that will work.

Ok, so now you've actually thought up a circuit. How are you going to switch between ALL ON and GAME?

You should just learn some digital electronics. www.allaboutcircuits.com . That way, you could use my initial suggestions of logic gates.
An ounce of image is worth a pound of performance.

Trimoor

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 596
  • Last login:November 18, 2006, 09:01:46 pm
  • I like shooting out of helicopters.
    • Trimoor
Re: LED control idea
« Reply #15 on: February 14, 2005, 04:36:41 pm »
I have done this before.  It works quite nicely, and you don't need any transistors of ICs.
Just a diode, resistor, and LED.

tetsujin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 222
  • Last login:April 10, 2007, 05:51:25 pm
  • My controls will have programmable button labels.
    • My Homepage
Re: LED control idea
« Reply #16 on: February 14, 2005, 04:52:56 pm »
Kremmit raises an excellent point: most microswitch controls have a normally-closed terminal in addition to the normally-open one.  Connect the "common" terminal to ground, (as you probably will with most encoders) and "N.O." to the encoder input, and then you can use the third, "Normally Closed" terminal to create your LED circuit.

You can make the LED circuit completely passive - no gates or transistors or anything.  Just connect the cathode side of each LED to ground, and to the NC terminal connect the anode side of the LED and also a resistor going to +5V.  This is what will happen:

When the switch is not pressed, the "NC" terminal will be connected to ground.  The pull-up resistor on that line will pass current straight to ground.  Because both sides of the LED will be at zero volts, it will not light.

When the switch is pressed, the "NC" terminal will no longer have a direct connection to ground, so the current flowing from +5V through the pull-up resistor will flow through the LED, lighting it.

Of course, the +5V source may have to come from your encoder board for this to work...  The +5V has to be +5V relative to the ground node, and since you're connecting the switch's common terminal to the encoder's ground line...  well, there you go.

You needn't wait to have a physics class to learn this stuff - you probably have access to teachers and textbooks which can help you with this.  You can also look for basic electronics tutorials on-line - though I'm a bit wary of that approach because there's so much bad information out there.


Here are some basics.

First of all, you can think of the entire circuit as a collection of "nodes".  Any part of a device that has a lead sticking out, that's a circuit node.  When two nodes are connected together with a wire, they're basically the same node.  (Certainly for our purposes that's a fine assumption.)  At any given time, a particular node will have a particular voltage level relative to the circuit's "ground" node.

Voltages are always measured relatively between two nodes.  It's meaningless to say that a node has a particular voltage without making some kind of statement about what the measurement is taken relative to.  Commonly it'll be taken relative to ground, but it's also helpful sometimes to measure two nodes relative to each other.  This is useful when you're talking about two nodes on the same device: for instance, the voltage across the two nodes of a resistor can tell you how much current is passing through the resistor.  (The greater the voltage difference, the greater the current...)

Current represents the flow-rate of electrons in the circuit.  Current flows through wires, and between terminals of multi-terminal devices.  The basic rule of current is called Kirchoff's Current Law, which states that the amount of current flowing into a node must equal the amount of current flowing out of a node.

Building simple circuits is sometimes a matter of balancing simple math problems, making sure the amount of current flowing through devices is great enough to operate them (when desired) but not so great that they burn out.  Different devices have different relationships that determine how much current will pass based on how much voltage is across them.  Resistors and light bulbs and such are generally linear, meaning that if you double the voltage drop, you roughly double the current.  LEDs are different, however.  They have a particular voltage operating range.  If you exceed that, the current increases greatly.  Double an LED's voltage and you'll likely burn it out rather quickly.

IMO understanding the basics of nodes, voltages, and currents is critically important in building circuits and understanding how they work.  You can muddle through without it, lots of people do, but you'll fare better if you know the mechanics of the devices you're using.


I'm doing similar work for my cabinet, and this thread has raised some good points for me, too.  In particular, the need for the LED driver's ground to match the game encoder's ground in order for the LED driver and game encoder to monitor the same signal from the controls was something I hadn't thought of.  (If I have two USB devices doing the two jobs, the two grounds should be the same...  probably both being connected to the shielding and, eventually, indirectly, to the computer's casing and the AC line ground...  So maybe my design is OK...  But what happens if I want to drive some stuff from a separate AC-DC adaptor?  I figure it's best to give that one some extra thought.)
---GEC

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: LED control idea
« Reply #17 on: February 14, 2005, 05:34:01 pm »
See the problem with me is that I got an idea, but I dont have the knowledge of currents or how they are divided or any components!  I forget what it's called but I think its called a transistor.  Anyways, I saw one of these transistors in a circuit and I learned basically what it does.  I figured, since my iPac will have an output for Keyboard lights, which is +5v, and a ground (-5v), I could just connect a simple circuit consisting of nothing more than some of these transistors and terminal strips.  I know I may come off stupid trying to use the same idea, but just look at this and tell me whether or not it will work.  Thanks to Kremmit for telling me how to post a picture!  By the way, this was designed with a MOLEX in mind, so just pretend that isnt there.  The gray circles are transistors that draw 5 volts if some is passed to it's base.  Please keep in mind Im trying to keep this cheap, not blow any LEDs and well, yah.  This would be alot easier if I knew that the iPac gave out so many volts at each connection...does anyone know?  For example, how many volts does it put out on PLAYER 1 UP?

Trimoor

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 596
  • Last login:November 18, 2006, 09:01:46 pm
  • I like shooting out of helicopters.
    • Trimoor
Re: LED control idea
« Reply #18 on: February 14, 2005, 06:23:15 pm »
What about my idea?  No transistors, and it doesn't even need a SPDT switch.
Plus, I currently use it.  It works.

It can even use independend power sources.  I'm using a 3v battery pack with a keyboard encoder.  Just tie the grounds together.  The diode takes care of the rest.

Kremmit

  • - AHOTW -
  • Wiki Contributor
  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3165
  • Last login:June 17, 2025, 04:07:55 pm
  • Who the heck is that?
Re: LED control idea
« Reply #19 on: February 14, 2005, 06:46:23 pm »
Kremmit, if the COM tab is connected to ground, that will work.

Ok, so now you've actually thought up a circuit. How are you going to switch between ALL ON and GAME?

"All On" is not exactly a toughie.  Anybody that can't figure out how to turn on all of the LEDs at the same time needs to give up right here.  You feed them power and hook it up to a switch, duh.  Yes, there's a little more to it than that, but it's hardly the engineering challenge here. 

Quote
You should just learn some digital electronics. www.allaboutcircuits.com . That way, you could use my initial suggestions of logic gates.

Hey, I'm not the one trying to do this project.  I don't care if it ends up using logic gates, or little tiny gnomes that flip a lightswitch every time the joystick moves.  ;D 

Like I said, I'm not the guru here- logic gates may be the best way to implement the circuit, no matter whether you connect to the NO or the NC tab.   I was just trying to help anybody building this by pointing out they don't need to muck about with using the same part of their microswitch that's connected to their I-Pac.  Sending 12v to your I-Pac by mistake would be, well, a mistake.  :'(

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: LED control idea
« Reply #20 on: February 14, 2005, 07:24:09 pm »
Okay, well I also know little about diodes, so you would need to explain how they work and which ones to get.  And Trimoor, you use it?  Meaning you have the same idea as me?  Could you take a few photos PLEASE for me?  Is it nice in the end?

Trimoor

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 596
  • Last login:November 18, 2006, 09:01:46 pm
  • I like shooting out of helicopters.
    • Trimoor
Re: LED control idea
« Reply #21 on: February 14, 2005, 09:05:31 pm »
I used the LED to indicate when the admin switch is pressed.  I did not wire up a whole CP, but it would certainly work to do so.  I sold the CP to a friend, so I can't get pictures right now, but it was covered in shrinktube anyway.

Diodes are pretty simple: they allow electricity to pass through only in one direction.  The direction is indicated by a colored band near one end.
Diode tutorial
Any old diode will work for this application.  I used a pack of cheapies from radio shaft.  They're called 'switching diodes', but anything will work for this.
radio shaft diodes
Any competent employee will know what you want if you ask for a 'pack of cheap switching diodes', so you might have trouble at radio shaft.

I can modify the circuit to include an all-on switch if you want.  All-off is easy--just disconnect the LED power supply.

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: LED control idea
« Reply #22 on: February 14, 2005, 09:09:36 pm »
The power shouldnt be too hard, neither should the off, BUT I dont see how making electricity flow one way only would help...so what?  How would that do anything?

Trimoor

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 596
  • Last login:November 18, 2006, 09:01:46 pm
  • I like shooting out of helicopters.
    • Trimoor
Re: LED control idea
« Reply #23 on: February 14, 2005, 09:20:07 pm »
It prevents it from flowing in the wrong direction.  It keeps it from interfering with the encoder.  Inside the encoder is a pullup resistor, which makes the LED light improperly.  It can keep it lit even when the button is not pressed.
If nothing else, it will help protect the encoder from damage if you wire it up wrong.

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: LED control idea
« Reply #24 on: February 14, 2005, 09:23:12 pm »
Exactly, it keeps it from flowing in the wrong direction, but how exactly does that replace the transistors?  All this does is use a power supply, make sure it goes one way.  I need to use a small voltage to allow a larger voltage...right?

Trimoor

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 596
  • Last login:November 18, 2006, 09:01:46 pm
  • I like shooting out of helicopters.
    • Trimoor
Re: LED control idea
« Reply #25 on: February 14, 2005, 10:01:26 pm »
You don't need transistors.  The diode lets you use the same switch for both the encoder and the light.

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: LED control idea
« Reply #26 on: February 14, 2005, 10:16:59 pm »
Oh okay, I get it, so basically I just use one diode per switch and it powers the light and the switch?  Could you perhaps draw a crappy diagram for me as to where in the circuit I would place the diode, and not to mention, where I would place resistors?

Just so I dont look stupid, if you see, I dont even need diodes!  The only problem I was having with that is the fact that I didnt know how much the iPac gives out!  For example, if the iPac sends 1 volt out and the switch has 1 volt going through it to ground when its pressed, that 1 volt will be what is hooked up to the light, and frankly, thats not enough.  My only concern was that it would not supply enough power.  Could someone verify the power outages from an iPac PLEASE

Trimoor

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 596
  • Last login:November 18, 2006, 09:01:46 pm
  • I like shooting out of helicopters.
    • Trimoor
Re: LED control idea
« Reply #27 on: February 14, 2005, 10:26:41 pm »
Oh okay, I get it, so basically I just use one diode per switch and it powers the light and the switch?
Yes.

The voltage of the ipac is irrelevent.  The diode keeps the ipac and LED seperate.  The LED is powered through a seperate power supply, which can be obtained from the PC, or from the USB cable.  Powering the LED off the ipac switch readers is not a good idea.

Once again, here is the circuit.  Hopefully you can understand it with labels.

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: LED control idea
« Reply #28 on: February 14, 2005, 10:30:30 pm »
*Colin downloads the picture*

Thanks alot, I get it!  Basically, the switch works as normal, and the diode allows them to use a common ground!  You're a genious!  May I ask, how do you know all this?

Wienerdog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 569
  • Last login:December 08, 2020, 06:28:51 am
  • If it's worth doing, it's worth overdoing
Re: LED control idea
« Reply #29 on: February 14, 2005, 11:11:06 pm »
GENIUS!!!

Looking at Kelseys picture of the pacman panel, it would be cool to make the red up, down, left, right triangles around the pacman stick out of a red plastic lit up from below by an LED using this method.
« Last Edit: February 15, 2005, 11:43:30 am by Wienerdog »
This opinion was created from 100% post consumed information.

Trimoor

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 596
  • Last login:November 18, 2006, 09:01:46 pm
  • I like shooting out of helicopters.
    • Trimoor
Re: LED control idea
« Reply #30 on: February 14, 2005, 11:28:25 pm »
You're a genious! May I ask, how do you know all this?
I know everything.  It's just easier that way.
(By the way, you misspelled genius.) ;D

An idea I had for my original cabinet was to light up the arrows and buttons as Weinerdog says, but have them controlled by the frontend.  When you highlight Galaga in the frontend, only the left and right arrows and one button light up.  When you highlight Defender, the up/down arrows illuminate, as well as five buttons.

This would be relatively easy to control with the parallel port, but no one has this coded yet.  If they did, it would probably only be for windows.  (Insert long rambling hatred of microsoft here)


If anyone needs electronic or circuit help, just ask me.  (bribes will help me work faster)

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: LED control idea
« Reply #31 on: February 15, 2005, 07:21:25 am »
Wienerdog, thats exactly what I was going to do :D Thanks alot for the help.  Is there any specific diode I need or anything like that?

tetsujin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 222
  • Last login:April 10, 2007, 05:51:25 pm
  • My controls will have programmable button labels.
    • My Homepage
Re: LED control idea
« Reply #32 on: February 15, 2005, 10:02:04 am »
You're a genius! May I ask, how do you know all this?
An idea I had for my original cabinet was to light up the arrows and buttons as Weinerdog says, but have them controlled by the frontend.  When you highlight Galaga in the frontend, only the left and right arrows and one button light up.  When you highlight Defender, the up/down arrows illuminate, as well as five buttons.

This would be relatively easy to control with the parallel port, but no one has this coded yet.  If they did, it would probably only be for windows.  (Insert long rambling hatred of microsoft here)

My plan is similar: when a game is loaded, the available controls will light up (including the diagonals on the stick, if it's an 8-way).  But then I'll have them light brighter when the control is actually activated.  (But not light at all if they're not active for the game.)  And when a diagonal direction is pushed for an 8-way game, rather than lighting up the "up" and "right" buttons for instance, I'd light a diagonal "up+left" direction light.  And then if a diagonal direction is pressed in a 4-way game, nothing will light.  Processing diagonals could be done with logic gates, of course, but I'll most likely use a cheap microcontroller for it for simplicity's sake.

Programming simple circuits on the parallel port isn't too hard on Linux or most anywhere else for that matter - you send bits to the port, and those bits go high on the parallel port.  The only real trick for this application is activating the right buttons' lights, because that requires information about the game.  Controls.dat doesn't do the job, IMO, since it works according to button numbers as they're understood by the game.  For that reason I plan to take my data on what controls should be lit from the Mame control configuration for the game.

I'm planning to control my lights with USB.  To save I/O lines on my USB microcontroller I'm going to use the microcontroller to drive a shift register, and that'll be what actually controls the LEDs.  You might want something similar when using the parallel port, to get around the limited number of I/O lines there.

For some reason I was thinking that I would have LEDs creating light points around the joystick...  I really like Weinerdog's suggestion of making the light illuminate an entire direction triangle around the joystick.  That would take some extra work (either routing out space in the CP for a lightable plastic triangle, or else using EL strip for the triangle) but I think it'd be a whole lot better.  (EL Strip is a very tempting option for this application...  Infinitely easier to install than an LED-lit triangle.  I'm not sure what I'd need to use to switch that 100VAC from the inverter, though...  Relays?  I sure hope not.  And for getting low- and high-intensity lighting depending on what controls are being actuated?  No idea...)
---GEC

Trimoor

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 596
  • Last login:November 18, 2006, 09:01:46 pm
  • I like shooting out of helicopters.
    • Trimoor
Re: LED control idea
« Reply #33 on: February 15, 2005, 01:43:21 pm »
I would find blinking lights during a game far too distracting, but I would love not having to explain the controls to everyone who uses it for EVERY single game.  USB might be difficult.  What would you register the device as?  You would probably have to write your own drivers, which means we'd be stuck with windows again.  I think the serial port is a better option.  It's easy enough to access in software, and every microcontroller knows how to read serial data.  Good luck on the MAME end of it...

I don't think lighting a triangle with an LED would be hard at all.  Route out a shape larger than the triangle, and the black border of the vinyl will do the rest.  If that doesn't work, cut a triangle mask out of aluminum foil and glue it to the bottom of the overlay.

For the EL idea, a triac should be used.  It's a solid state device very similar to a transistor, except it can handle high AC voltages and even large currents.

tetsujin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 222
  • Last login:April 10, 2007, 05:51:25 pm
  • My controls will have programmable button labels.
    • My Homepage
Re: LED control idea
« Reply #34 on: February 15, 2005, 03:05:34 pm »
I would find blinking lights during a game far too distracting, but I would love not having to explain the controls to everyone who uses it for EVERY single game.  USB might be difficult.  What would you register the device as?  You would probably have to write your own drivers, which means we'd be stuck with windows again.

I don't think lighting a triangle with an LED would be hard at all.  Route out a shape larger than the triangle, and the black border of the vinyl will do the rest.  If that doesn't work, cut a triangle mask out of aluminum foil and glue it to the bottom of the overlay.

Well, maybe the LED idea isn't hard, but it's definitely a hell of a lot more work than either drilling a single hole for an LED, or using EL strip.  But I don't know if EL strip will be bright enough.

Your point about blinky lights is well taken - with that in mind I may decide not to do the two-level lighting.  But I've always thought it'd be nice in games like Street Fighter to have some clear indication of what direction I'm moving the stick.  It makes it a lot easier to figure out why my Shoryuken isn't working.  :)  I am also very interested in making sure people never have to wonder which button is which.  When each stick has between six to eight buttons, that's important.

There are USB HID profiles for indicator lights.  I may use that, or I may make it a more generic device type, like a virtual serial port or something, and just send bits to it.  If I were to go the virtual serial port route, I could choose to use generic, off-the-shelf chipsets like the FTDI chips.  It's basically a USB->RS232 on a chip, with driver support in Windows, Mac, and Linux.  But I'd more likely use a PIC, since I don't need the full functionality of the FTDI chip (it provides functions like the flow control lines, which aren't needed on USB, and therefore not part of the standard USB communications class.)  I'll take all these USB devices I want to build as an opportunity to learn USB programming.  On Linux.  Not Windows.  :)

I don't see why the MAME side of this would be particularly difficult.  I'll have a front end.  It'll know what game I'm running, because it will be responsible for running the game.  So when the game is being loaded, I can make the front-end run a script to handle checking the game control configuration and updating the LEDs.

RS232 would be another relatively easy solution.  I'm interested in doing this with USB, though.  I've decided I don't want to have to deal with RS232 and the Parallel port any more.  :)
---GEC

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: LED control idea
« Reply #35 on: February 15, 2005, 03:26:34 pm »
If you think about all the work and money involved in doing this, you would have to create a custom device to handle all this, and alot of people would want in on it, therefore, you would probably end up making a PCB.  I think it would be very nice to use the full functionality of this project, and what it will become.  I started wanting the buttons to light as you pressed them, but all this stuff about gaming sounds cool.  Someone should go spend an hour or so and think up a board for this.  I would, but I don't know enough :(  I hope this will progress, so people can build their ultimate cabinets!  The *ONLY* bad part about this is that the controls and the lighting will be connected through different circuits.  My origional intent was to be able to do it all through a PS2 port, which I could do.  Therefore, I think the game-lighting is out for me.  I would rather create one of those "ATTRACT-MODE" things to flash random buttons when the machine isnt being used.  If anyone actually does anything listed here, please show me :)  Im very interested!

NoOne=NBA=

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2718
  • Last login:July 23, 2011, 08:59:16 am
  • Just Say No To Taito! -Nichibutsu
Re: LED control idea
« Reply #36 on: February 15, 2005, 07:34:47 pm »
I don't care if it ends up using logic gates, or little tiny gnomes that flip a lightswitch every time the joystick moves.  ;D

I'd definitely recommend elves over gnomes for this type of application.

Gnomes tend to be way too grumpy, and finicky.
You could use wizards (ala Microsoft), but they are notoriously lazy, and only work part of the time.
I'm guessing it's something to do with their guilds.

The elves worked really well for Apple, until they stopped using them in the transition to OSX because it was *nix based.
My cab, with OS 9.2.2 in it, is rock-solid.
I attribute that, in very large part, to the elves inside.
Given their track record, I wouldn't trade my elves for all the gnomes in the world.

That's personal preference though, so feel free to use whatever mythical creatures you want in your own cabs.

cholin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:July 16, 2009, 09:22:25 pm
    • Nilok Productions
Re: LED control idea
« Reply #37 on: February 15, 2005, 07:42:40 pm »
That was umm...odd :)  I got a little email saying the topic im watching got a reply, I look at it, and its telling me which elves to use LMAO.  You're a funny guy there NoOne.

tetsujin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 222
  • Last login:April 10, 2007, 05:51:25 pm
  • My controls will have programmable button labels.
    • My Homepage
Re: LED control idea
« Reply #38 on: February 15, 2005, 07:51:16 pm »
I don't care if it ends up using logic gates, or little tiny gnomes that flip a lightswitch every time the joystick moves.  ;D

I'd definitely recommend elves over gnomes for this type of application.

Gnomes tend to be way too grumpy, and finicky.

I think the Gnomes on Linux have come a long way in the past few years, but they seem like such an odd group, one wonders if they can really work together at all.
---GEC

NoOne=NBA=

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2718
  • Last login:July 23, 2011, 08:59:16 am
  • Just Say No To Taito! -Nichibutsu
Re: LED control idea
« Reply #39 on: February 15, 2005, 07:58:32 pm »
Trimoor,

How were you planning to implement the "All ON" function of this?

If you have a switch that grounds all the LED circuits, it will have to break the connections to the buttons, or it will ground all the inputs to the I-pac as well, causing it to read every button as though it was pressed.