View Full Version : Wiring a switch with a LED in it....
David Rogers
12-29-2007, 03:08 PM
Hi,
I have now attached a number of basic toggle and momentary switches to my Hagstrom Board..... :)
.....and the time has come to wire up a switch that has a LED built into it.
SPEC FROM THE SWITCH PACKAGING:
"The LED lights when the switch is placed in the ON position".
There are 3 connectors on this switch .... so how do I wire this up ?
1 Wire from a connector to the Hagstrom input.....
1 Wire from a connector to the Hagstrom ground....
.....what do I connect to the 3rd terminal / connector (presubly its for the LED ?).
Thanks in advance for my next lesson in wiring switches !
:D
steveeverson
12-29-2007, 03:18 PM
I guess it's for the led power- probably 5volts, but may need to have a resistor in line to drop it down as some leds are 3v. you can get a suitable power supply from maplin or i think a PC atx supply has a 5v rail on it.
hope that helps
steve:roll:
Geremy Britton
12-29-2007, 06:00 PM
yes - you connect 2 wires from this extra terminal to hold the power source in circuit
Hi,
Just for information: this has nothing to do with the Hagstrom board. The KE72 only provides key-strokes to the Flight simulator, it does not give you state information from the Flight simulator needed to control leds.
So you can only hard wire a led in a switch to one of it's fixed positions, but be careful, that will not always mean that the led is synchronised with the switch with led in your Flight simulator panel....
If you want the latter you need interface boards like the ones from Opencockpits or FSBUS, that will give you a bidirectional interface to FS9/X.
Regards,
Nico
David Rogers
12-29-2007, 06:16 PM
Hi,
I think I didn't make a few points clear in my thread; :)
- I thoroughly understand that the LED will not be linked in anyway to FS, and that the Hagstrom is purely an input device for switches.... (I've been using the Hagstrom for a couple of weeks now).
- I am purely just looking to have the LED light up when the switch is 'made'. (As I will map this switch to the 'z' key and will use only this control for AP Master, the LED state should co-incide with the FS AP state most of the time).
So I'm purely just wanting to know what I have to connect to this third terminal connector, to give it the power......
Couple of follow up questions then;
Gez - You say connect 2 wires to the 3rd connector on the switch; connect them to what ??! :)
Steve - Would I need one of these power supplies for every LED ?? .... I'll check them out as I get all my switches and components from Maplins. :)
Thanks,
David Rogers
12-29-2007, 06:23 PM
Hey again,
Here is the power supplies page from Maplin - can anyone point me towards what I'd need as I'm struggling to find it;
http://www.maplin.co.uk/search.aspx?pctitle=Power+Supplies&mainclassid=94&classtype=M
As an alternative question - is there a way of powering this LED by batteries ?
Thanks!
mpl330
12-29-2007, 06:26 PM
Hi David,
Someone correct me if I'm wrong but couldn't you put the LED in series with the switch so that when the switch is closed the circuit is made but goes through the LED as you are wanting the LED to light whenever the switch is on???
Cheers
Mike
mpl330
12-29-2007, 06:28 PM
Hey again,
Here is the power supplies page from Maplin - can anyone point me towards what I'd need as I'm struggling to find it;
http://www.maplin.co.uk/search.aspx?pctitle=Power+Supplies&mainclassid=94&classtype=M
As an alternative question - is there a way of powering this LED by batteries ?
Thanks!
Hi,
Just use an old PC power supply - the connectors that you plug into hard drives etc are normally 12v and 5v - will have a check for you which colours are which - they will be red 2 black and a yellow...
Mike
Hi,
- I am purely just looking to have the LED light up when the switch is 'made'. (As I will map this switch to the 'z' key and will use only this control for AP Master, the LED state should co-incide with the FS AP state most of the time).
Yes, that is what I was trying to say, you have no guarantee that the led is synchronised with the state in the panel. If the FS window for instance has not got 'focus' (is not the active window), the Z key will not be recognised by FS9/X and then you're out of sync ..
So in general it's not really a good idea to hard wire leds to fixed switch positions, that control information has to come out of the FS9/X ..
My 2 cts...
Note that I also used two KE72 boards 5 years ago when I started with my 'cockpit' and was very happy with it, until I wanted to have leds... Then I moved to the Opencockpits interface boards (IOCards and SIOC), and got rid of my KE72's. If you want to see where that has brought me, have a look at www.nicokaan.nl (http://www.nicokaan.nl)
Nico
steveeverson
12-29-2007, 06:36 PM
hi David- you can use one power supply to power loads of led's- they don't draw much- mpl is right a pc power supply should be fine- i'll look into that too.. i was thinking of adding a timer to my gear lever when i make it so that the lights go to red and then off realistically as i can't get the data from pmdg..
anyway back to the sim- i have a 737 that wont fly itself you know! (actually it can once i get my head around all that vnav lnav stuff.....)
steve:cool:
steveeverson
12-29-2007, 06:43 PM
Hi David- think this is prob what you need and a bargain at £18.99!
http://www.maplin.co.uk/module.aspx?ModuleNo=32149&doy=29m12
And here's a link to the colour codes for thecables that come out of it..
http://members.chello.at/theodor.lauppert/computer/psu.htm
theres also some good info on the overhead page on ian sissons site
www.737ng.co.uk
Hope that helps
Steve:)
David Rogers
12-29-2007, 06:44 PM
[Edit: Steve, fantastic! thanks very much for this..... now go land that 737 !]
Nico - appreciate what you are saying but again, the sync just isn't important to me.... I fully understand the constraints of a standalone LED but that suits my needs. I am going for a practical / convenient sim build and the Hagstrom is perfect - won't be going down the full I/O route.... :)
Thanks Mike / Steve - I don't have a spare PC Power Supply but they are cheap to pick up and sounds perfect if I can power around 3 LEDs from the supply (I am only looking to wire 3 of these types of LED switches).
If you could let me know what the colours are that would be fabbbbb! (Would hate to blow my attic up ! :) ).
Regards,
mpl330
12-29-2007, 06:47 PM
Ok - check this link:
http://home.fuse.net/Walts_Place/powersupplyconn.htm
Red is 5v and Yellow is 12v but it is worth checking depending on which psu you get hold of - on mine i have to short out pins 13 and 14 on the ATX power supply connector to get it running - this is in place of the switch on your pc case...
Steve - just noticed you beat me to it, although you can probably get cheaper from online pc suppliers - also there was a tutorial somewhere on making the timings work on the gear lever movement so that the gear up / down LEDS changed as the gear lifted / descended - will try find it again...
All the best
Mike
David Rogers
12-29-2007, 06:54 PM
Excellent - cheers Mike!
So would I connect both 5v+ and 5v- wires to the LED terminal of the switch ?
.
Excellent - cheers Mike!
So would I connect both 5v+ and 5v- wires to the LED terminal of the switch ?
.
+5 V and GND should never be connected to one and the same terminal, you will short circuit your power supply...
mpl330
12-29-2007, 07:01 PM
Let me check what you are saying -
from your I/O board you have a wire that will go to your switch to indicate the switch is on, you will also have a wire that is the -ve / common that connects to the other terminal on your switch (to complete the loop)???
If this is the case I would expect to be able to put the LED inbetween the ON terminal of your switch and the IO board itself so that when the switch is on the power goes into the LED and out the other side back to the IO board - if this is the case then you may not need the seperate power supply if you are powering your IO board by other means (and it has enough power to power the LED) - more electronically minded please chime in here if it wouldnt work.....
Mike
mounty
12-29-2007, 08:35 PM
David,
Email Hagstrom, they have a couple of diagrams for wiring LED's. I'd send you a copy of the one I had but lost it when my system crashed. It's pretty simple wiring them in by the looks of it. You can also wire LED's in so that they are lite when in the switch off position - you just wire it into the other (third) terminal if you have a three position switch. The elec and eng hydraulics have annunciators on when the switch is off, as do probe heat a & b. Use the center terminal for the common ground in a three position switch - that allows you to use LEDs in two different ways. If you want to have an LED lite with the switch in the off position, you have to run a + wire from the third terminal to the Hagstrom thus taking up one input terminal.
Rob
mounty
12-29-2007, 09:58 PM
OOOPs,
If memory serves me right, your LED is connected to the common ground. Can't remember which way round it is but the anode would be connected say to the ground terminal (center) and the cathode would run to the Hagstrom common ground which you can daisy chain. When you throw the switch, this completes the power-ground circuit and the LED lites up. Depending on the type of LED you have you may or may not need a resistor. Kingbright supplies LED's with built in resistors so that would be the best way to go.
Rob
Geremy Britton
12-30-2007, 12:34 PM
the power supply for the LED is connected to the middle switch in a little circuit. The two outer ones are for the circuit for the switch. the middle will be to power to the led in the switch. i personally didn't want to get involved with voltages that could kill you although it did cross my mind at first for led/switches etc. i just use battery holders that can be picked up pretty cheaply or from hacked non working electronics etc.
just be careful when playing with mains power,
gez
David Rogers
12-30-2007, 06:11 PM
Argghhhh! Too much information - take a read of it all above !!
Ok, I'm only joking and I am really grateful for the help.... but I simply don't have the background on electronics (even basic), and I find I can't answer the questions that people are asking me, in order to help with answers !
I think I will leave this for now.... I thought it was going to be a lot more straightforward, ie...someting like .... "just connect an additional wire from the Hagsrom to the 3rd connector on the switch too, and you'll get the LED on when the switch is made".....but it appears a lot more fussy.
To try and answer some questions;
- The switch in question (that contains the LED) is currently connected and functioning perfectly with the Hagstrom, other than the LED. As I said earlier, I know how to use and wire a Hagstrom, and how to make a basic switch (without LED complexities!).
- The switch has 3 connectors on the back and I have a wire running from 1 connector, to the IN02 input on the Hagstrom.
- A second wire is then running from the Hagstrom's Ground part, into one of the other connectors on the switch. (Thus completing the circuit).
- There is a 3rd connector on the switch which is then for the LED, but I still don't know how this would be attached to power or a battery. :(
Sorry, please don't take my frustration with this as a sign of being ungrateful for the attempts to help :) ........theres just no clear answer yet.
Let's forget mains power for now - if I simply wanted to attach batteries to this LED switch and had a suitable battery cradle, how would I do this? There are 2 connections coming off the battery cradle (+ and -), but I only have 1 connector for the LED on the switch.......... that is where I am most confused ????
There's a national cockpit builders commendation to the person that can answer this question in pure laymans / dummies terms !
Thanks.
:)
mpl330
12-30-2007, 07:38 PM
Hi David,
I dont think you need the 3rd connector - 1 is for when it is on, 3 is for when it is off, the middle(2?) is the common - you could connect the LED to which ever side you want it to come on...
I also dont think you need the power supply we were talking about before if that helps...
Switch back
1(on) 2 3(off)
\ | /
On -ve On
1 = IN02 on Hag
2 = Ground on Hag
3 = not connected
The front will look like:
1(on) 3(off)
Connect the LED between 1 and the IO, dont use 3 as this is essentially off
Any electronics gurus confirm please :D
Best regards
Mike (having a glass of red as I am getting a bit confused now too :p)
luisgordo
12-30-2007, 07:58 PM
David,
Another link on the ATX PC power supply, for your info:
http://www.hardwarebook.info/ATX_v2.2_Power_Supply
BTW, don't forget to short the green cable (there is only one) to whichever GND cable (black). You'll need to do this to get power from the unit (ie. to switch it on!).
Also worth mentioning here that there are some old ATX power supplies that won't work if you don't connect them to some power consumer first (a hard drive, a light bulb, ...). Weird, but I have found this with some old units.
Happy New Year!!
David Rogers
12-31-2007, 08:15 AM
Thanks Mike........ I'll give it a try. I too am hoping that the PC power supply won't be required for powering simply one LED !
I will have a try with your diagram above later today and you never know !
I've also dropped Hagstrom an email as Mountie suggested.
Luis - Cheers. Happy New Year to you all !
Cheers,
David.
Any electronics gurus confirm please :D
Negative, that will not work, imho.
mpl330
12-31-2007, 09:35 AM
:oops: Thought it might work if the LED was in series with the switch being in the On position...
Oh well - back to the drawing board :???:
I'll ask someone I know if they have an idea...
Good luck
Mike
mpl330
12-31-2007, 09:48 AM
Isnt it like this 'tester' circuit:
http://www.kpsec.freeuk.com/projects/simplet.htm
Instead of "testing" the switch you are just making the led come on when you complete the circuit by moving the switch to on???
David Rogers
12-31-2007, 09:57 AM
Mmm, looks interesting, thanks Mike.
I guess if it doesn't work it may be because the Hagstrom is not supplying enough power (it is only powered by the PC's PS2 [keyboard] port) ?
I also just realised that the switches indeed have 4 connectors on the back (oops, sorry for the duff previous info). It seems 2 of the connectors are for the switch, and 2 for the LED.....
So I may try a simple experiement to wire up the 2 LED connectors to a battery ...... (switch is already wired up and operating fine with the Hag).
With the LED wired up to the + and - from the battery, we'll then see if the LED lights up when the switch is made... = happy days!
:D
andarlite
12-31-2007, 10:40 AM
David
Here's how you should do it:
GND --------SW--------- IN01
IN01 ---- LED ----220ohm------ +5V from Hagstrom card
The crude diagram above shows a switch connected to IN01 of the Hagstrom card. You would then connect the cathode of the LED to IN01, the anode goes to a resistor (220 ohm is typical for most LED) and the other end of the resistor connects to +5V on the Hagstrom card (this is very important, DO NOT USE AN EXTERNAL POWER SUPPLY).
When the switch is closed, the LED will turn on. This arrangement is best for use with a toggle switch or a latching pushbutton as oppose to a momentary switch.
I got this from Hagstrom so it's reliable information and has been working well for me.
Regards,
Henry
David Rogers
12-31-2007, 12:40 PM
Thanks Henry you're a star.
I am using a latching push button (with integrated LED), and I have now located the cathode and anode for it, so should work exactly as described.
Thanks again Henry, and to all who helped !
Regards,
David