Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
Page 1 of 2 1 2
#3411850 - 10/17/11 09:38 AM First Button box - Finished!  
Joined: Mar 2011
Posts: 75
darkmouse Offline
Junior Member
darkmouse  Offline
Junior Member

Joined: Mar 2011
Posts: 75
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

Last edited by darkmouse; 11/20/11 05:27 PM.
Inline advert (2nd and 3rd post)

#3411896 - 10/17/11 11:53 AM Re: First Button box [Re: darkmouse]  
Joined: Dec 2009
Posts: 748
AndyB Offline
Member
AndyB  Offline
Member

Joined: Dec 2009
Posts: 748
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

Last edited by AndyB; 10/17/11 11:53 AM.

Andy's simpit: http://www.simpit.me.uk
#3411925 - 10/17/11 12:50 PM Re: First Button box [Re: AndyB]  
Joined: Mar 2011
Posts: 75
darkmouse Offline
Junior Member
darkmouse  Offline
Junior Member

Joined: Mar 2011
Posts: 75
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!

#3411960 - 10/17/11 01:43 PM Re: First Button box [Re: darkmouse]  
Joined: Jan 2004
Posts: 1,221
f15sim Offline
More projects than sense!
f15sim  Offline
More projects than sense!
Member

Joined: Jan 2004
Posts: 1,221
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
#3412049 - 10/17/11 04:03 PM Re: First Button box [Re: darkmouse]  
Joined: Dec 2009
Posts: 748
AndyB Offline
Member
AndyB  Offline
Member

Joined: Dec 2009
Posts: 748
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
#3412072 - 10/17/11 04:25 PM Re: First Button box [Re: AndyB]  
Joined: Mar 2011
Posts: 75
darkmouse Offline
Junior Member
darkmouse  Offline
Junior Member

Joined: Mar 2011
Posts: 75
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?

Last edited by darkmouse; 10/17/11 04:32 PM.
#3412264 - 10/17/11 08:30 PM Re: First Button box [Re: darkmouse]  
Joined: Dec 2009
Posts: 748
AndyB Offline
Member
AndyB  Offline
Member

Joined: Dec 2009
Posts: 748
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
#3412325 - 10/17/11 09:30 PM Re: First Button box [Re: AndyB]  
Joined: Mar 2011
Posts: 75
darkmouse Offline
Junior Member
darkmouse  Offline
Junior Member

Joined: Mar 2011
Posts: 75
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.

#3412427 - 10/17/11 11:27 PM Re: First Button box [Re: darkmouse]  
Joined: Mar 2011
Posts: 13
wledzian Offline
Junior Member
wledzian  Offline
Junior Member

Joined: Mar 2011
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.

#3412697 - 10/18/11 07:56 AM Re: First Button box [Re: wledzian]  
Joined: Mar 2011
Posts: 75
darkmouse Offline
Junior Member
darkmouse  Offline
Junior Member

Joined: Mar 2011
Posts: 75
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!

#3412795 - 10/18/11 12:05 PM Re: First Button box [Re: darkmouse]  
Joined: Mar 2003
Posts: 3,922
Paradaz Offline
Senior Member
Paradaz  Offline
Senior Member

Joined: Mar 2003
Posts: 3,922
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

Last edited by Paradaz; 10/18/11 12:20 PM. Reason: updated

On the Eighth day God created Paratroopers and the Devil stood to attention.
#3412973 - 10/18/11 04:27 PM Re: First Button box [Re: darkmouse]  
Joined: Mar 2010
Posts: 128
Rich_Price Offline
Member
Rich_Price  Offline
Member

Joined: Mar 2010
Posts: 128
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

#3413091 - 10/18/11 06:45 PM Re: First Button box [Re: darkmouse]  
Joined: Dec 2009
Posts: 748
AndyB Offline
Member
AndyB  Offline
Member

Joined: Dec 2009
Posts: 748
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

Last edited by AndyB; 10/18/11 06:48 PM.

Andy's simpit: http://www.simpit.me.uk
#3413147 - 10/18/11 07:52 PM Re: First Button box [Re: Rich_Price]  
Joined: Mar 2003
Posts: 3,922
Paradaz Offline
Senior Member
Paradaz  Offline
Senior Member

Joined: Mar 2003
Posts: 3,922
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.
#3413616 - 10/19/11 10:23 AM Re: First Button box [Re: darkmouse]  
Joined: Mar 2010
Posts: 128
Rich_Price Offline
Member
Rich_Price  Offline
Member

Joined: Mar 2010
Posts: 128
No probs!!

#3415066 - 10/21/11 09:27 AM Re: First Button box [Re: darkmouse]  
Joined: Mar 2011
Posts: 75
darkmouse Offline
Junior Member
darkmouse  Offline
Junior Member

Joined: Mar 2011
Posts: 75
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!

#3415383 - 10/21/11 07:24 PM Re: First Button box [Re: darkmouse]  
Joined: Dec 2009
Posts: 748
AndyB Offline
Member
AndyB  Offline
Member

Joined: Dec 2009
Posts: 748
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

Last edited by AndyB; 10/21/11 07:25 PM.

Andy's simpit: http://www.simpit.me.uk
#3415545 - 10/21/11 10:44 PM Re: First Button box [Re: darkmouse]  
Joined: Sep 2007
Posts: 55
Thommo Offline
Junior Member
Thommo  Offline
Junior Member

Joined: Sep 2007
Posts: 55
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.

#3437859 - 11/20/11 04:26 PM Re: First Button box [Re: darkmouse]  
Joined: Mar 2011
Posts: 75
darkmouse Offline
Junior Member
darkmouse  Offline
Junior Member

Joined: Mar 2011
Posts: 75
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

Last edited by darkmouse; 11/20/11 04:34 PM.
#3437929 - 11/20/11 07:12 PM Re: First Button box [Re: darkmouse]  
Joined: Oct 2009
Posts: 24
propman Offline
Junior Member
propman  Offline
Junior Member

Joined: Oct 2009
Posts: 24
Nice job Darkmouse. I'll be looking forward to your "idiots guide" because when it comes to electronics I'm clueless. thumbsup

Page 1 of 2 1 2

Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
Carnival Cruise Ship Fire....... Again
by F4UDash4. 03/26/24 05:58 PM
Baltimore Bridge Collapse
by F4UDash4. 03/26/24 05:51 PM
The Oldest WWII Veterans
by F4UDash4. 03/24/24 09:21 PM
They got fired after this.
by Wigean. 03/20/24 08:19 PM
Grown ups joke time
by NoFlyBoy. 03/18/24 10:34 PM
Anyone Heard from Nimits?
by F4UDash4. 03/18/24 10:01 PM
RIP Gemini/Apollo astronaut Tom Stafford
by semmern. 03/18/24 02:14 PM
10 years after 3/8/2014
by NoFlyBoy. 03/17/24 10:25 AM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0