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
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.