Forums » Technology » Pit Builders » First Button box - Finished!


Page 1 of 3 1 2 3 >
Topic Options
Rate This Topic
Hop to:
#3411850 - 10/17/11 02:38 AM First Button box - Finished!
darkmouse Offline
Junior Member

Registered: 03/22/11
Posts: 72
Hi Fellas,

Just embarking on the build of my first button box, and have a few questions. I've never really touched electronics before and am a little clueless - I've read over all the relevant posts that I can find and am fairly sure I understand how the various types of button need wiring up and configuring, but am not so sure about rotary encoders and LEDS. So,

1. I can't get hold of the type Leo Bodnar recommends (he has none, and digikey want £30 for delivery from the States - my CPL is costing me £3 per minute, every penny counts!), but would this do the same job? - http://uk.rs-online.com/web/p/products/2...7633D4E4F4E4526 - it was the closest match I could find.

2. With an LED built into a switch I believe I have to use a resistor in 'sequence' to stop the LED burning too bright. What does in 'sequence' mean? ie. is it just wired in on the same piece of wire that goes from the 5v to the LED pin?

Any help much appreciated - when I'm done I'm going to write an absolute beginners tutorial with pictures etc to help other cretins like me!

Cheers,

Darkmouse


Edited by darkmouse (11/20/11 09:27 AM)

Top
#3411896 - 10/17/11 04:53 AM Re: First Button box [Re: darkmouse]
AndyB Offline
Member

Registered: 12/13/09
Posts: 288
Loc: Ayrshire, Scotland
Hi Darkmouse,

welcome to the forums.

I take it that you have one of Leo's boards. If so, you can get these on ebay:

http://www.ebay.co.uk/itm/12mm-Rotary-En...=item3a6b79e34f

I just got a set of 10 ( complete with aircraft type knobs ) for £10. So far I've not had any problems with them on his BU0836 board. There are 5 pins: 2 on one side are for the push switch, the other three are the enbcoder. Centre pin goes to a ground on Leo's board and the other two go to consecutive button pins ( hat's important!). You have to be running Leo's encoder program which converts the outputs of the encoders to repeated button presses. Simple ....

Only took abouot a week to get here.

If you need a copy of the encoder program email me through my website and I'll send it to you.


LEDS

If you can imagine a stream of water being supplied by a lake in the mountains. It flows out to the sea. OK got the picture ?

Water flows from the lake because it's higher than the bed of the stream i.e there is a potential difference between then that causes a pressure on the water and causes it to move.

The +ve in a circuit is the lake. The stream is the wiring and/or components. The sea is the -ve of the circuit. The difference between then causes the electricity to FLOW from +ve to -ve. (well, that's how it was explained to me at first!!!)

If you had a landslide at some part of the stream and it was partially blocked the flow of water to the bit after the blockage would be reduced. The blockage would be a RESISTOR. The bigger the value the more of a blockage.

A diode (or LED) is like a gate that only lets the electricity flow one way.

An LED usually needs around 2 volts across it to light but we tend to use 5 volts or 12 volts around our pits. To stop the extra voltage from popping the LED we put a resistor in line with it to cut down the flow to it. SIMPLE .....


In series just means in line.


+ -----------------/\/\/\/\/\-------------------!>!----------- -

The squigly line is the resistor. Diodes are normally drawn as a triangle pointing along the line with a bar across the tip. The base of the triangle is the Anode (or positive) end of the diode and the bar is the Cathode (negative connection).

If you're running with a 5 volts supply I'd try a 1K ohm resistor (the coloured bands are brown, black and red) first and see how bright that is. T make it brighter, reduce the value of the resistor. There are lots of sites on the net to get the resistor colour code from.

Hope this helps.

Cheers,

Andy


Edited by AndyB (10/17/11 04:53 AM)
_________________________
Andy's simpit: http://www.simpit.me.uk

Top
#3411925 - 10/17/11 05:50 AM Re: First Button box [Re: AndyB]
darkmouse Offline
Junior Member

Registered: 03/22/11
Posts: 72
Cheers AndyB, that is exactly the sort of gen I was looking for (the stream explanation was usefull!) - just ordered the encoders, and heading to Maplin later to pick up the rest of the switches, buttons etc.

I have the bodnar buo836x and am currently just drawing out the layout and functions I want on the box - its gonna be a general purpose box for both racing and flying. I've just realised that I probably need a bigger project box for all the stuff I now want it to do (I've just seen a symprojects GI pro gear indicator which would look cool in it!)

Another quick question before I do any damage to the board - before I wire things up for real, is it possible to plug the board into the computer and then just attach/detach buttons/switches etc at will to see what they do? Once I've figured out the simple stuff, I'll try the encoder and once I've figured out all that stuff I'll attach everything for real!

This might have been a mistake - I have spent more time researching this box this morning than doing my cpl groundschool. Its also gonna get more expensive than I planned if I incorporate the bloody gear indicator!

Top
#3411960 - 10/17/11 06:43 AM Re: First Button box [Re: darkmouse]
Gene Buckle Offline
Member

Registered: 01/13/04
Posts: 699
Loc: Graham, WA
Two great calculator sites:
http://ledcalc.com/
..and...
http://ledcalculator.net/

Hover your mouse over the "?" icons to get more detailed information on each field.

g.
_________________________
Proud owner of 80-0007
http://www.f15sim.com - The only one of its kind.
http://geneb.simpits.org - the Me-109F/X Project

Top
#3412049 - 10/17/11 09:03 AM Re: First Button box [Re: darkmouse]
AndyB Offline
Member

Registered: 12/13/09
Posts: 288
Loc: Ayrshire, Scotland
Hi again,

Yeah, there's no reason why you can't connect the board and set it up on the computer and then try your connections.

Just make sure you don't have a +5 connected to a ground at any time as that might damage the board.

That shouldn't be a problem if you're only making connections to the button section.

Luckily you have a BU0836X as that saves you having to work out switch matrices.

cheers,

Andy
_________________________
Andy's simpit: http://www.simpit.me.uk

Top
#3412072 - 10/17/11 09:25 AM Re: First Button box [Re: AndyB]
darkmouse Offline
Junior Member

Registered: 03/22/11
Posts: 72
A +5 connected to ground? Sorry, I really am a cretin. Does that mean don't run a wire from the +5 on the board to a gnd on the board? Or dont run a wire from a switch terminal that requires +5 to a gnd? (ETA) Or as my cleverer girlfriend just mentioned, make sure that a wire running from the +5 doesn't touch ANY ground ie radiator?


Edited by darkmouse (10/17/11 09:32 AM)

Top
#3412264 - 10/17/11 01:30 PM Re: First Button box [Re: darkmouse]
AndyB Offline
Member

Registered: 12/13/09
Posts: 288
Loc: Ayrshire, Scotland
You're not a cretin. Problem is that I worked in the electronics for years and make assumptions I shouldn't make.

Basically what I should have said was make sure the +5 volts NEVER touches the 0 volts (ground) on Leo's board. It shouldn't really touch any other ground (ie radiator, kitchen taps stuff like that) either.

To use the stream analogy again. If you had a dam across the lake in the mountains and it let a small amount of water through constantly, that would be your stream.

If the dam burst all the stored water (or electricity) would flow out in an uncontrolled manner and smash up the valley that the stream runs through.

Electricity is great, but you have to keep it under control.

If you put a switch between the +5 and ground and pushed it there would be lots of smoke from your board and a nasty smell (you will do this by mistake at some point in the future, we all have.....) and your board would be fecked (technical term).

That's one of the advantages of resistors. They're the building blocks that allow us to control electricity.



I grabbed a bit of the image for your board to show you an example.

You can see that the push button switch is connected across terminals B1 and it's ground (GND).

The encoders (when you get them) are connected thus:

middle pin is connected to the ground of ONE of the two switch terminals.
Each of the other pins are connected to TWO CONSECUTIVE switch inputs.

It doesn't matter which GND you use as they're all connected together on the board.

Once the program is running, when you turn the encoder one way you get repeated switch closures on B2 and when turned the other way you get repeated switch closures on B3. Does that make sense to you ?

cheers,

Andy
_________________________
Andy's simpit: http://www.simpit.me.uk

Top
#3412325 - 10/17/11 02:30 PM Re: First Button box [Re: AndyB]
darkmouse Offline
Junior Member

Registered: 03/22/11
Posts: 72
Andy, thats fantastic - I'm sure I will 'feck' my board at some point, hopefully not until I've built at least one functional button box (I might steer clear of LED's in that case!)If you don't mind I'm going to incorporate your diagram into my idiots guide (obviously I'll reference it).

I've been messing about with buttons tonight and have managed to get simple momentary push buttons working, the massive on/off switch under the red missile cover, but only had partial success with the on/off/on type.

I used the same principle as your diagram shows for the encoder ie. I attached one wire from B1 to the left pole, another wire from GND1 to the middle pole and a third wire from B2 to the right pole - unfortunately I can only get one button to light up in the USB controller panel, not sure yet whats wrong - do they need a GND connection to each as well? Anyway, I'll figure it out tomorrow!

The help is much appreciated!

ps. I'll be in touch for the encoder program when they arrive.

Top
#3412427 - 10/17/11 04:27 PM Re: First Button box [Re: darkmouse]
wledzian Offline
Junior Member

Registered: 03/15/11
Posts: 13
AndyB's description of the encoder operation is not correct. Most encoders do not output pulses indicating clockwise or counterclockwise, but rather they output a 'quadrature' pattern.

Each output is connected to ground for half of a cycle. The patterns for each output overlap, so you have four 'zones':
A B
+ +
+ -
- -
- +

Try turning your encoder as slowly as you can; you should see the pattern in the usb control panel.

The detent positioning varies between different encoders; some will have detents between each transition, some will have detents between every other transition, and some will have detents only once per full cycle. You need to use the encoder software supplied on Leo's site to configure the card to properly read your specific encoder.

Top
#3412697 - 10/18/11 12:56 AM Re: First Button box [Re: wledzian]
darkmouse Offline
Junior Member

Registered: 03/22/11
Posts: 72
Hi Wledzian,

Thanks for that - I should probably have made it clearer in my post that the trouble I had was with the on/off/on toggle switches, not the encoders, which are winging their way across the atlantic to me, and as per AndyB's description just have the three connection poles - I was under the impression that since the on/off/on also has three connection poles it would be wired up in a similar manner - I'll do some more experimenting today to figure them out!

Cheers for all the help chaps!

Top
#3412795 - 10/18/11 05:05 AM Re: First Button box [Re: darkmouse]
Paradaz Offline
Member

Registered: 03/20/03
Posts: 1934
Loc: Andover, UK
Bizarre question here, but what is the name of the little plastic 'things' that for example fit onto the prongs of a mother header.....such as the led+ and led- prongs?

I'm looking at buying one of Leo Bodnars SLI-M modules (when back in stock) and adding a few push buttons or rotaries to a custom mod. I know these things are similar to the jumpers found on a board but I also know that's not the correct term for it either as it obviously isn't 'bridging' the connection either.



Alternatively, what is the best way of getting hold of this kit in the UK. I've had a quick scour of ebay.co.uk and not really found what I'm looking for and also RS supplies for bit and pieces. Do I have to order from the US to really get the best rotaries and switches? Early impressions are these are like rocking horse #%&*$# to track down!

Edit: I'm looking at Molex KK connectors (is this correct, or are they a special type of 'KK' connector) but still can't find much information/suppliers, especially in the UK


Edited by Paradaz (10/18/11 05:20 AM)
Edit Reason: updated
_________________________
On the Eighth day God created Paratroopers and the Devil stood to attention.

Top
#3412973 - 10/18/11 09:27 AM Re: First Button box [Re: darkmouse]
Rich_Price Online   content
Junior Member

Registered: 03/12/10
Posts: 89
Hi,

Is this the sort of thing you are after? You have to make them up yourself or there are pre-crimped wires on the site. This is a great site and really quick delivery and they're in the UK!

Technobots

BR

Rich
_________________________
http://www.komodosimulations.co.uk
i7 920 OC'd to 4.3ghz (Watercooled)
6GB Dominator
64gb SSD
Nvidia GTX 480

Top
#3413091 - 10/18/11 11:45 AM Re: First Button box [Re: darkmouse]
AndyB Offline
Member

Registered: 12/13/09
Posts: 288
Loc: Ayrshire, Scotland
Hi again Darkmouse,

The wiring I showed for the encoders IS CORRECT as long as you are using Leo's encoder program which converts the stuff Wledzian spoke about in to simple button presses. I was simply trying to keep it simple for you.

I thought you might have problems with the toggle switches. A lot of builders (including myself) use biased switches. This means the toggle is held in one position by a spring. You push the toggle to the other position where it makes the circuit and when you release it the spring pulls it back to the original position. A toggle like this works like a push button switch and will work with your board.

My opencockpits USBkeys board is exactly the same. They don't like switches that are closed for a while.

Does your switch have 3 or 6 connections on the bottom ? if it has 6 then you can wire it as:




BTW you should credit Leo for the diagram not me. The original image was his, I just scribbled over it.......


I check my email from my simpit site regularly during the day so it you'd like a faster answer use that.

Cheers,

Andy


Edited by AndyB (10/18/11 11:48 AM)
_________________________
Andy's simpit: http://www.simpit.me.uk

Top
#3413147 - 10/18/11 12:52 PM Re: First Button box [Re: Rich_Price]
Paradaz Offline
Member

Registered: 03/20/03
Posts: 1934
Loc: Andover, UK
Originally Posted By: Rich_Price
Hi,

Is this the sort of thing you are after? You have to make them up yourself or there are pre-crimped wires on the site. This is a great site and really quick delivery and they're in the UK!

Technobots

BR

Rich


Perfect....cheers Rich
_________________________
On the Eighth day God created Paratroopers and the Devil stood to attention.

Top
#3413616 - 10/19/11 03:23 AM Re: First Button box [Re: darkmouse]
Rich_Price Online   content
Junior Member

Registered: 03/12/10
Posts: 89
No probs!!
_________________________
http://www.komodosimulations.co.uk
i7 920 OC'd to 4.3ghz (Watercooled)
6GB Dominator
64gb SSD
Nvidia GTX 480

Top
#3415066 - 10/21/11 02:27 AM Re: First Button box [Re: darkmouse]
darkmouse Offline
Junior Member

Registered: 03/22/11
Posts: 72
Thanks again AndyB - I tried that just before I checked the forum again, and funnily enough it worked! I think I know enough to build it without royally 'fecking' it now, so it'll get built over the next few days when I have some time - No doubt, I'll probably find some more silly questions to ask before I'm done!

I'll post pictures once I'm finished - I'm sure, as ever, the only person I'll manage to impress is myself!

Top
#3415383 - 10/21/11 12:24 PM Re: First Button box [Re: darkmouse]
AndyB Offline
Member

Registered: 12/13/09
Posts: 288
Loc: Ayrshire, Scotland
Hmmm, that's very interesting.

It looks like on your BU0836x board each input has it's own GND.

On my own BU0836 board, provided I don't wan't more than 12 imputs I can use a common GND. If I want to go up to 32 inputs I've got to get in to rows and colums and blocking diodes ( luckily you don't have to..... ).

Glad you got it worked out It's far more satisfying when you manage to get it yourself, but sometimes you need a gentle push in the right direction. Look forward to seeing the pics.

Cheers,

Andy


Edited by AndyB (10/21/11 12:25 PM)
_________________________
Andy's simpit: http://www.simpit.me.uk

Top
#3415545 - 10/21/11 03:44 PM Re: First Button box [Re: darkmouse]
Thommo Offline
Junior Member

Registered: 09/25/07
Posts: 27
Loc: Australia
On the pin header housings, if you are an Australian reading this thread and looking for them you can get them from:

http://www.robotgear.com.au/Category.aspx/Category/52 (housing)
http://www.robotgear.com.au/Category.aspx/Category/27 (cabled housing)

Posting as I had a little trouble finding a good site for them in Oz. I had no problems ordering from that site, fast service.

Top
#3437859 - 11/20/11 08:26 AM Re: First Button box [Re: darkmouse]
darkmouse Offline
Junior Member

Registered: 03/22/11
Posts: 72
Finito! Better late than never I guess! I doscovered a few design flaws right near the end, such as having no real means of attaching the bodnar board securely in the box enclosure and realsising that any tension on the usb cable may move the board around pulling out wires, but nevermind, it all works!

Thanks for all the help, especially AndyB! In the next few weeks I'll try and put together an absolute idiots guide to making a similar one - comprehensive enough that someone with zero experience can just follow the instructions and it'll work.

Once again, cheers guys.

PS. not sure whats up with the photo, standby


Edited by darkmouse (11/20/11 08:34 AM)

Top
#3437929 - 11/20/11 11:12 AM Re: First Button box [Re: darkmouse]
propman Offline
Junior Member

Registered: 09/30/09
Posts: 24
Nice job Darkmouse. I'll be looking forward to your "idiots guide" because when it comes to electronics I'm clueless. thumbsup

Top
#3438866 - 11/21/11 02:18 PM Re: First Button box [Re: propman]
AggressorBLUE Offline
Member

Registered: 12/15/09
Posts: 1315
Loc: South East PA
Originally Posted By: propman
Nice job Darkmouse. I'll be looking forward to your "idiots guide" because when it comes to electronics I'm clueless. thumbsup


X2, and Leo owes you a free board when you post that, as your essentially writing the un-offical instruction manual for his product! Only thing I have against his board, is that with his forums shut down, instructions are hard to come by.

Of course there are lots of threads and helpful forum members, but the issue is that everyone comes in with a different level of experience, so the questions and answers are all over the place. For a green-horn without an electrical engineering background, it's quite daunting.
_________________________
My Rig:AMD Phenom X4 955 Black Edition OCed@3.8 GHz/GIGABYTE GA-890FXA-UD5 AM3 AMD 890FX Mobo\ MSi AMD 6950 2GB \ 8 Gigs of G.skills Ram\Storage: WD Black 750 GB HDD\All held together by: Coolermaster HAF 932 case

Other Assets Deployed:
HOTAS: Logitech G940 frown CH FighterStick/Pro-Throttle/Saitek Combat Rudder Pedals smile
Wheel: Fanatec 911 Turbo S w/ Playseats Racing Seat. smile



Top
#3439463 - 11/22/11 09:53 AM Re: First Button box [Re: darkmouse]
Gene Buckle Offline
Member

Registered: 01/13/04
Posts: 699
Loc: Graham, WA
Er... What happened to his forum?

g.
_________________________
Proud owner of 80-0007
http://www.f15sim.com - The only one of its kind.
http://geneb.simpits.org - the Me-109F/X Project

Top
#3439866 - 11/22/11 09:14 PM Re: First Button box [Re: Gene Buckle]
AggressorBLUE Offline
Member

Registered: 12/15/09
Posts: 1315
Loc: South East PA
Originally Posted By: Gene Buckle
Er... What happened to his forum?

g.


Last I checked, it wasn't up anymore
_________________________
My Rig:AMD Phenom X4 955 Black Edition OCed@3.8 GHz/GIGABYTE GA-890FXA-UD5 AM3 AMD 890FX Mobo\ MSi AMD 6950 2GB \ 8 Gigs of G.skills Ram\Storage: WD Black 750 GB HDD\All held together by: Coolermaster HAF 932 case

Other Assets Deployed:
HOTAS: Logitech G940 frown CH FighterStick/Pro-Throttle/Saitek Combat Rudder Pedals smile
Wheel: Fanatec 911 Turbo S w/ Playseats Racing Seat. smile



Top
Page 1 of 3 1 2 3 >
Topic Options
Rate This Topic
Hop to:


Forum Use Agreement | Privacy Statement | SimHQ Staff
Copyright 1997-2012, SimHQ Inc. All Rights Reserved.