PDA

View Full Version : Electronics Noob + Button Help



Atomic_Sheep
01-02-2011, 06:32 AM
Hi guys, I recently purchased the BU0836X card and I'm at the stage of playing around with it but I don't know where to start. I've got very little understanding of electronics and I don't want to fry my computer so I wanted to find out what sort of stuff I can plug in there? Does it matter which switches I use? Voltage/wattage wise? Is there a back to front and right to front way of putting the switches in or will the switch be simply reversed if I plug it in back to front and then switch the terminals?

I had a read of the specifications of the card but it doesn't really explain to me how to connect all the stuff to it. It also says it supports both digital and analogue. What's the difference on that front? I know digital is like square sin waves and it's like binary? So it uses microprocessors to work? While analogue is purely using stuff like capacitors etc? Although microprocessors use capacitors too if I'm not mistaken so yer, a bit confused. How do I know if a switch is digital or analogue?

Basically, is there some source of information that will get me started on understanding how to use this board?

RadarBob
01-02-2011, 01:27 PM
In terms of the BU0836, digital means that the input of the card is switched between two voltage levels.
The card sources a voltage (5V) on the input pin. The microprocessor on the card reads the input, and in the normal (input un-activated) condition it 'sees' the 5V, and decides that the input is in a logic 0 condition (one of the two digital states).

In order to change the state of the input, the user is expected to connect the input pin to Ground (0V).

On the BU836X this is easy because it provides two pins per input: One is the input and the other is 0V ground.

All the user has to do to change the input state to logic 1 (the other of the two digital states) is to connect the two input pins together.

When this is done, the voltage sourced by the input is reduced to 0V, the microprocessor reads the input, and this time 'sees' that it is now 0V and decides that this is now a logic 1 condition. This would trigger a state change condition that is passed on to fs. Typical application flight deck switches - Anything in fs that is controlled by two states that are either 'ON' or 'OFF'

This can be done (for test purposes) by simply connecting a piece of wire between the two input pins.

Normally though, we would want to use some form of switch.

Switches provide a short circuit (or very nearly) connection. They are bi-directional, so it doen't matter which way round you connect them. They are usually rated in terms of current and voltage.

Voltage sourced by BU0836 is low (5V) - So practically any switch will do. Current sourced by the card is also very low: A few milli-amps (thousands of an amp) - So again practically anything will do.

Provided you don't start applying any voltages to these pins from external sources, you will not damge the card or your computer by connecting any form of switch to the card inputs.

There are 32 of these digital inputs.

The card also has 8 analogue inputs.

The analogue inputs work such that 3 pins are provided:
Again, One of the pins is 5V, another is Ground (0V) and the third is the input pin.

The microprocessor measures the voltage that is applied to the input pin. The user is expected to connect a device that applies an analogue voltage - In this sense 'analogue' means that rather than just being in two possible digital states (0V/5V) like the digital inputs, the voltage applied can be anywhere in the range 0V to 5V (0.5V,2V,3.5V...etc). This type of input is used for proportional control - e.g. a joystick axis.

On these analogue inputs one would typically connect a potentiometer (variable resistor/Pot) typical value 10k Ohms (10,000 Ohms). The potentiometer is a continuously variable control that can connect across the 5V/0V) pins provided, and produce a third voltage which is proportional to the position of the shaft of the device. This voltage would be applied to the third (input) pin. When the pot shaft is fully at one end of its travel range (say fully anti-clockwise in the case of a rotary pot), then the voltage applied to the nput pin would be 0V, and at the other end (fully clockwise) the value applied to the input pin would be 5V) - With the pot shaft positioned anywhere else, the voltage applied to the input pin could be anywhere between the two voltage values.

The card uses an analogue to digital converter to measure and covert the input analogue voltage value to a digital value (using multiple binary bits) that represents the current position and this value is passed to flight sim. Typical applications: Control column could use one pot for pitch and another for roll - Would use two of the 8 inputs/ Thrust levers one pot each etc..

Hope this helps

Best Regards,

Rob

Atomic_Sheep
01-04-2011, 09:51 AM
Thanks for the response. Cleared a few things up. So basically, the way I understand it, I can basically stick pretty much anything into the board and it wont die as long as I don't try to connect various power supplies? I'm not planning on connecting power supplies but basically form what I'm reading, anything over 5V and/or 100mA will hurt it?

Also, since you suggested that a switch is bascially a short circuit... will the card register something if I simply insert two wires into the digital areas and then simply touch them? Or do you dare me/should I try this and see for myself if it will work ;)? I just want to double check that I won't hurt it even though I'm starting to see that as long as what I connect isn't a power source, I'm almost guaranteed to be safe.

EDIT: Never mind, I just re read the part where you suggested using just one wire and running it across two terminals.

EDIT2: The other thing that I was thinking of was the jay el... basically the airbus equivalent to korry. From memory, they run on 9V, what needs to be done to get them working with this card? Create a mini circuit whereby I have a 9V power supply leading to the switch and then run it in a series circuit with a resistor or a parallel circuit with a resistor or something or am I am just totally off base on this one? I don't have any korry switches or jay el switches but was planning on getting one to see how they were made and play around with it a bit and try to get it to work etc so wanted to figure out how they might be connected if at all.

RadarBob
01-04-2011, 04:27 PM
Sounds like you have got the hang of it now.

Yes, shorting the two digital input pins together with anything low resistance wire/switch is ok.
No need to connect any external power supplies - All required voltages are sourced from the card.

Also, do not short the +5V/0V inputs on the analogue connections - I would guess that protection
against this is probably built in, but be careful anyway.

There are some diagrams on Leo Bodnars site which shows the various connection possibilities - Also I would recommend Ian Sissons site www.737ng.co.uk for info on basic practical I/O Card connections, and in particular those involving the BU0836.

I am not familiar with the Jay-El or its application on the Airbus, but I know a bit about the use of the Korry on the 737.

Korry 318, the most common, is essentially an indicator rather than a switch. It comes in several different variants depending on the application. They have diodes built in - So the current only flows one way through the lamps (or LED's in the Chromalux version). In the more common type, a positive voltage (+28V) is permanently applied to one side of the lamp and the user circuit is expected to connect the controlled side to ground to illuminate the indicator. The other type works the opposite way round, and the user circuit is expected to provide a positive voltage to illuminate the indicator and a permanent Ground is wired to the other side.

These indicators do have switches in them, but this is intended to be used for a 'press to test' or 'press to reset' function. Normally, two pins are used for this. In the common type, there is usually the lamp voltage present on one of them when the switch is not pushed, and it transfers to the otherwhen pushed. This voltage is the voltage present at the bottom end of the lamp - So if you put 28V on one end of the lamp and 0V/Gnd on the pin that is connected to the bottom end of the lamp when switch pushed, then the indicator will light for self test.

There are some versions of this indicator that do provide an independent (dry) pair of contacts with no voltage on them that can be used for anything, but I've not seen one yet.

I suggest that you have a look at the manufacturers datasheets for the various types - Again I don't know about Jay-El, but the Korry one is available on the Korry/Esterline website (albeit the LED version not the incandescent lamp).

The indicator usually has a circuit diagram printed on the side as well.

I have also seen the large square Korry (515 I think) that is used for Master Caution and Fire Warn, and that indicator/switch has separate lamp and switch circuits.

Normally, one would wire the indicators to an output card - Something like OpenCockpits Relays or USBRelays.

I say Relays, because the OC Master will supply 5V and source sufficient current to light an LED based indicator - But not an incandescent lamp. OC (USB)Relays provides dry bi-directional contacts that go short-circuit (like a switch) when the associated output is activated so you can put your 0V Ground on one contact and connect the other to the bottom end of your indicator (which has +28V or whatever) on the top end.


Cheers,

Rob

Atomic_Sheep
01-07-2011, 08:24 AM
I found a bunch of wires lying around the house and tried sticking them into the various holes and managed to get it to work. So many thanks for clearing that question up. Haven't tried analogue slots as I don't have anything analogue to test it with yet.

Now for more questions, the way I understand it, the older Korrys have 28V because they use incandescent lamps but the newer ones have less than 28V or have the same 28V but with resistors and use LEDs?

Also, the way I see it, you need two cards for korry style switches i.e. one is an input card wherebyou you press the button and you see the game controller settings screen light up that button and the corresponding LED to light up but for the game to output a light, you need a seperate card and a seperate circuit?

Another question is... if what I just said is corret, then the way I see it, in order to create a button which you press and it has a corresponding action registered by the game and at the same time have an LED come on e.g. lets say we are talking about the APU Start button which from memory, when you push it, should have the ON blue light to come on and when the APU comes online, the the AVAIL part of the swithc is to come on. So... to get this to work.. what we need is a series circuit whereby an LED lighting the ON is in series to the switch itself and then we need a second seperate circuit which takes output from the simulator and via an output card goes to another LED lighting the AVAIL part?

I'm also planning on using LED's, so I take it unless I connect too many of them which is going to be difficult due to space resitrictions within the button, then I'll need a greater voltage in which case I'll need a different input card? But for approximately 2 LED's per light, 5V should be sufficient right? +I'm guessing there needs to be a resistor in there somewhere as well?

Lastly, I know that when you press the Korry and the Jay El switches, they stay pressed in. So the way I see it, if it's pressed in, it's in a constant state of ON and a short circuit exists which enables the light to be lit, and when you depress it, the light comes off as the short cirtcuit is no longer pressed in? Obviously the secondary light works independently.

RadarBob
01-07-2011, 05:00 PM
All sounds right.

The Korrys with LED are designed as direct replacements for the incandescent version, so all the leds are built in along with a voltage spike protection circuit.

In the situation you describe, yes you can use one set of contacts on the switch to connect to the Input Card and the other set to connect a supply through to one half of the indicator (via resistor if led type) provided the switch contacts are independent.

Ideally though, I would take all the inputs to input card and all outputs from output card, and use some system simulation software (e.g. ProSim) to provide the logic/timing. Not sure what the equivalent is for Airbus, but I'm sure someone on here will.

Resistor for LEDs calculated as R= (Supply Voltage - LED Voltage)/LED Current

LED working Voltage and Current can be found from the manufacturers datasheet or supplier catalogue.

Typical values: LED Voltage = 2V, LED Current = 10-20mA

For 5V Supply: R = (5V - 2V)/0.02A = 150 Ohms
For 24V Supply: R = (24-2)/0.02A = 1100 Ohms

You can put two or more leds in series, in which case you just add up the LED voltages and use the same current:

R = 24 - (2+2)/0.02 = 1000 Ohms

Not a good idea to put two LEDs in parallel with a single resistor - In this case, treat them like two singles each with their own resistor.

Two LEDs in series on 5V should be ok depending on led voltages. I would tend to use two in parallel though. In this case the driving circuit should be capable of sourcing twice the current eg 40mA - Not a problem for relay output, but check Output Card spec if you want to drive it direct.


Cheers,

Rob

RadarBob
01-09-2011, 01:41 PM
You might also find this interesting:

http://www.mycockpit.org/forums/showthread.php/14086-Real-Korrys-Real-Trouble...?p=69139&viewfull=1

Atomic_Sheep
01-10-2011, 07:53 AM
Thanks RadarBob, much appreciated. Hopefully when I read the manuals for the switches again, I'll be in a position to finally understand the diagrams that are provided.

Atomic_Sheep
01-12-2011, 10:04 AM
Ideally though, I would take all the inputs to input card and all outputs from output card, and use some system simulation software (e.g. ProSim) to provide the logic/timing. Not sure what the equivalent is for Airbus, but I'm sure someone on here will.


By this you mean... rather than placing the LED, which will usually come on when you press the switch in series to the switch itself, you would connect the LEDs to the output card which will then through your proposed software turn the LED on as you turn the switch on but this second method also allows for greater flexibility in case I've missed something in the proceedures of the aircraft which then means that the light won't always come on with the switch pressed? i.e. this method simply is more robust if I need to change something in the future in case for example I've overlooked situations whereby the lights can come on despite the buttons not being pressed e.g. test mode or something?

RadarBob
01-12-2011, 12:15 PM
Yes, that's exactly right.

As you say, switch inputs go in, indicator outputs come out, and what happens in betwen is handled by the logic in the software.

People like Marty Bochane with ProSim have spent a long time studying the way that the different systems interract, and developing a software systems model that accurately emulates the condition of the real world outputs for given real world inputs and with regard to what the aircraft model is doing.

If you know for a fact that the indicator is always on when the switch is depressed, and at no other time, then of course you can save yourself an input and an output by hard-wiring it.

But unless you know the systems inside out, I think you are better to leave the logic to software.

This way, in your simple example, if you later find out that there is a situation in which the light goes out with the switch still depressed, then you don't have to re-wire your panel to fix it - It is just a keyboard job.

You don't have to use an off-the-shelf solution though - You could
do a lot of it using something like SIOC to read your switch conditions, and set your outputs accordingly - You might for example, want to take into account the state of another switch or FS variable.

This would be my advice, but others have chosen different routes, and may wish to provide another perspective at this point - Which of course is always welcome!

I don't think that there were quite the range of options available in the past as there are now.


Best Regards,

Rob

Atomic_Sheep
04-04-2011, 08:44 AM
I started trying out some designs for various switches and I ran into a question which you answered, yet I didn't quite understand the full gravity of. To get things straight.

1.) Basically, I will not be able to get FSX or the like to provide the required outputs to get Korry switch output states? i.e. offsets from FSUIPC are only for switches and not lights?

2.) Output card wise, would it be possible to direct me in the direction of some examples? Arduino are output cards that could be used for LED indicators lights? Any more examples which may perhaps be more widely used in home cockpits?

3.) Output cards have the same sort of connection to components as input cards correct? i.e. you've got the same 2 or 3 terminals depending on what you're outputting to? How would an LED be controlled by an output card? I'm guessing the computer program e.g. ProSim737 which you suggested sends some sort of signal to the card (what sort of signal would this be? Digital or does it even matter lets say in the case of an LED?) and then the card's IC with its chips which have logic gates inside, send electrical impulses of some sort to the output connectors which are in turn connected to the electrical component such as an LED?

RadarBob
04-04-2011, 09:25 PM
Hi Atomic_Sheep,

Very good questions, and ones that encompass quite a range of areas - Some of which I am not that clued up on.

However, here is my understanding, which I am sure that someone will put us straight on if I haven't got it completely correct!

FSUIPC offsets hold the current value of FS parameters and communicates with external software/hardware to read/modify those values when requested.

FSUIPC provides a means for external hardware such as joysticks / keypresses generated bythe PC keyboard or an input board such as BU0836 that emulates a joystick with lots of buttons to modify the values.

BU0836 is one of the most popular input boards.

To get outputs to drive your indicators you are right in saying that need some output hardware. I would say that the most popular choices for this would be the Opencockpits family or Phidgets - Although there are others. I'm not familiar with Arduino I'm afraid.

Software such as ProSim models aircraft systems that are not fully modelled by FS, and communicates the state of these modelled parameters to FS using FSUIPC.

Opencockpits SIOC software provides links to the Opencockpits family of hardware I/O boards, to communicate the state of the hardware inputs to FS using FSUIPC and to set the states of the hardware outputs according to values read from FS via FSUIPC.

SIOC does much more than that though, as it provides a scripting 'language' which allows you to implement logic/arithmetic functions/timers etc in simple code. It also provides a graphical type User Interface which allows you to implement the same funtionality without having to write the code.

You don't have to use SIOC though, as OC also have software modules that can handle the interface to the hardware and communicate with SIOC/FS in a simpler way - Have a look at the
documentation that is available for download from the OC website.

ProSim can also read the state of Opencockpits hardware inputs (switches) directly from SIOC variables and communicate the state of the systems model parameters to SIOC to control indicators.

ProSim also talks directly to Phidgets I/O boards - Don't know anything about Phidgets, but I believe that these are Martys
I/O board of choice.

Typical output board e.g. OpenCockpits Master uses a 74HC series CMOS logic chip as an output device. Output state is 0 or 5V and it can sink or source around 25mA max. You can connect leds with resistor from output to ground (source mode) or you can connect leds (again with resistor) between +5V and output (sink mode)

Usually one wire output with either a common ground for all outputs - Or a pair of output terminals may br provided, one of which is ground.

If you want to drive something that requires greater current or voltage, then you could either use a different output board (say OC USBRelays) or feed the Master output to some kind of driver circuit of your own design.

In the case of a relay board, a pair of contacts or possibly common/normally open/normally closed contacts would be provided.

General operation of driving an ouput using SIOC/OC Master might be:

User would write a statement in SIOC code to create an SIOC variable and link it to the value of a FSUIPC offset

Another statement would be written to link the state of the SIOC variable to a particular output line on a particular OC Master Card.

The FSUIPC offset value might then be changed (say toggled 0/1) by clicking the control in FS with mouse or perhaps by an input from a BU0836 board/ OC Master Card.

SIOC would be scanning the FSUIPC offset, and 'see' that the value has changed. It would then modify its own variable which in turn would trigger an internal instruction to vary the state of the linked Master Card output line. How the communication between SIOC and the hardware works I am not sure but I guess it depends on how the hardware is connected - For example you can connect an OC Master to your PC parallel port or you can connect it to a USB Expansion Board and connect that to your PC USB port.
If it were parallel connected, then SIOC would I suppose control the parallel port directly - There is no processing on a Master Board, just multiplexing/addressing/data latches - USB Expansion on the other hand uses a USB micro-controller (PIC). SIOC would send (serial) data to the PIC which represents the current state of the outputs, and the PIC would emulate the parallel data format produced by the PC parallel port.

Hope this helps.

Cheers,

Rob

Atomic_Sheep
09-07-2011, 10:28 AM
Thanks for your response. I'm still trying to figure all this out. How do I gain access to the states of various switches, lights and numerical displays in FSUIPC? I want to try to write a simple program which will be able to see the values which FSUIPC interrogates FSX for and then use them to drive some stuff I want to try to connect. In particular, I'm trying to get some 7 segment displays to show corresponding values.

RadarBob
09-08-2011, 06:04 PM
Well, if you just want to drive some 7 seg displays, then I would say that your easiest way would be to use an OC Displays card, read the appropriate FSUIPC offsets into SIOC and then write them to the card.

If you want to do it the hard way and write your own program in something like Visual Basic, then there is an SDK downloadable with FSUIPC that has code examples demonstrating how to read and write FSUIPC offsets in various s/w languages. You would of course also have to build suitable hardware to talk to your software - There are some PIC examples in Mike Powells book on building simulated instruments which show ways to drive 7 Seg displays and handle serial comms - Or you could use a PIC with onboard USB and search the net for some firmware framework examples - A bit tricky really.

So, if you are still struggling with the concepts, and are not handy at programming and building electronics my advice would be to stick with 'virtually off the shelf with some tweaking' e.g. OC and SIOC.


Plenty of folks on the forum have done exactly what you are trying to do in different ways.

Anybody have any further thoughts/suggestions for Mr 'Sheep?

Cheers,

Rob

Atomic_Sheep
09-10-2011, 02:09 AM
Thanks, no shortcuts it seems... I was hoping that I was overlooking something. I'm just going to be switching over to X-Plane so I need to figure out how to interact with simulators in general. There's an X-Plane FSUIPC but I haven't read its documentaiton nor do I think it's anywhere near as developed as the FS one. Either way, certainly an interesting challenge. Not sure which route to take... off the shelf or try to make my own. Creating my own electronics boards will be the hardest and that part I'm least willing to experiment with as it's my weakest area, the programming should be doable if I stick at it long enough. Time will tell.

RadarBob
09-10-2011, 03:02 AM
You might take a look at the POKeys Extended Joystick Card as introduced by Wendy -See product Reviews from Home Page for an overview of what it can do.

Not investigated it myself yet, but it looks to be a cost-effective and versatile board - You can also talk to it using your own apps or using the GUI which keeps your options open. Pro-Sim support and programmable I/O also make it appealing.

Would like to get one myself to play with, but sadly don't have any free time for project work at the moment.

If you go the PIC route, then you could build something yourself on matrix board that would be reasonably tidy without getting involved in making PCBs due to the relatibvely low component count.

Cheers,

Rob