Switching question. - Page 1
Forum section: electronics / beginners

author: Chris Wilson
author_rank: Super Contributor
timestamp: August 04, 2012, 01:21:28 pm
content: I have a frequency divider / multiplier board to get multiple frequencies from a Thunderbolt GPS disciplined frequency standard. One SMC input socket takes the 10 MHz from the Thunderbolt and 4 other SMC sockets give various outputs. One of the four sockets is switchable to give six frequencies from the one socket. No switch is provided and the switching is to be done as follows.There's a four way header on the PCB board. pin 1 has 5 volts DC on it all the time, from the board. This 5 volts is then switched to pins 2, 3 and 4 in turn, then to pins 2 AND 3, and finally to pins 2, 3 and 4 together. This gives the following frequencies from the one SMC socket:No 5 volts to any other pin : 1 Hz5 volts to pin 2 : 10 Hz5 volts to pin 3 : 100 Hz5 volts to pin 4 : 1 KHz5 volts to pins 2 AND 3 : 10 KHZ5 volts to pins 2 AND 3 AND 4 : 100 KHzI am at a loss for a cheap and elegant switch arrangement. i am sure it is easy, but so far my ideas are cumbersome and complex. can anyone put me straight please? The header involved in the switching is at the top of the board, a 4 pin Molex.Thanks.

author: amyk
author_rank: Super Contributor
timestamp: August 04, 2012, 01:52:12 pm
content: Is this the divider you're using?http://www.perdrix.co.uk/FrequencyDivider/Frequency%20Divider%202%20Schematic.pdfIf it is, then I think you have these two switched around:QuoteIt's just a binary code, corresponding to the 8 channels of the output multiplexer:234000 1Hz001 10Hz010 100Hz011 1KHz100 10KHz101 100KHz110 off (could've been used for a 1MHz)111 off (could've been used for a 10MHz)What type of switch are you thinking of?

author: Chris Wilson
author_rank: Super Contributor
timestamp: August 04, 2012, 02:12:43 pm
content: Yes, that's the device I have. I may well have the frequencies v pin voltages wrong, I just assumed they went in that sequence. I believe the originator used a thumb-wheel switch, but for my purposes a single hole rotary switch is preferable, for mounting purposes. It being easier to drill a round hole than mill or file an oblong one. Thanks for the fast reply!

author: SeanB
author_rank: Super Contributor
timestamp: August 04, 2012, 02:31:04 pm
content: Use a BCD encoded switch. Nice things that use a single hole but give a binary output for you to use. Normally marked 0-9 or 0-F.

author: TerminalJack505
author_rank: Super Contributor
timestamp: August 04, 2012, 06:10:48 pm
content: Like SeanB says, a encoder that outputs binary is the most elegant. The problem is that you would need a 6-position encoder, which will be hard to find. You can use an 8-position encoder (for example) and leave the top two positions unused.Another option may be to use a SP6T switch and a circuit like one of the attached. The diodes-only circuit being the cheapest and least complicated. The circuit with the transistors will output 5V without the voltage drop due to the diodes, which may, or may not be necessary for proper operation.

author: TerminalJack505
author_rank: Super Contributor
timestamp: August 04, 2012, 06:18:32 pm
content: Whoops. There's a mistake in the diodes-only schematic. Here's the correct version.

author: Chris Wilson
author_rank: Super Contributor
timestamp: August 04, 2012, 09:49:31 pm
content: Thanks for the schematics. I think, as I need to buy in whatever type of switch I use, it would be sensible to go for the BCD encoded type rotary switch. It looks the correct thing to use, and has a lower component count. At the risk of being a total PITA, I have to say I am unsure how I would wire one up to this circuit though. I have downloaded various data sheets for BCD switches, but they all assume you know how to utilize one, and I don't, having never even heard of one before. Would it be pushing my luck to ask for a schematic for the BCD type switch? I have used the same Grayhill make of rotary switch TerminalJack505 mentions, in conventional format, for automotive use. Such things as adding a variable control for the likes of boost and traction control on mappable ecus. I know they come with a tiny locking pin you can choose to use to reduce the number of rotational positions if required, so I assume I could limit the travel to six positions like that? I had to do a bit of grovelling to get the divider, would hate to blow it up through ignorance! Thanks

author: TerminalJack505
author_rank: Super Contributor
timestamp: August 04, 2012, 10:13:42 pm
content: You should be able to wire it up like the attached schematic. Just hook 5V up to the switch's common terminal and the1,2and4terminals up to pins 2, 3 and 4 of the header.

author: Chris Wilson
author_rank: Super Contributor
timestamp: August 04, 2012, 10:37:48 pm
content: Excellent, thanks very much indeed for that, I feel a bit more confident about it now, I need to read up on just how the BCD switches work internally, and there various usages. I haven't had much dealing with digital systems. Much appreciated!

author: SeanB
author_rank: Super Contributor
timestamp: August 05, 2012, 06:35:12 am
content: You get 3 variants of these switches. One has a single pole and an output that is a single pin corresponding to the number. Easy to see as it has 1 more pin than the number of positions. Not the one you want here.The second has a single common, and 4 output pins. The pins are connected so that 5V on the common gives a BCD count of 5V on the output, switching the required bits that are needed to be high to the common, those requiring low are not connected, and often have pulldown resistors on the board it will be mounted on. This is the one you want.The third variant is for old TTL logic, and has the common connected to gnd, with the switch selecting high by leaving the pin open, and the low being connected to gnd. This works well with TTL which regards open circuit inputs as high.The only way to check between 2 and 3 is to use a multimeter and check the continuity when set to "0", if open it is type 2 and if short it is type 3.

author: Chris Wilson
author_rank: Super Contributor
timestamp: August 05, 2012, 09:30:23 am
content: Thanks SeanB. I think I have the gist of them now. I ordered this one from RS here in the UK, it's the same part number as cited earlier in the thread and seems correct to me:http://uk.rs-online.com/web/p/mechanical-rotary-encoders/6906724/?searchTerm=690-6724&relevancy-data=636F3D3126696E3D4931384E525353746F636B4E756D6265724D504E266C753D656E266D6D3D6D61746368616C6C26706D3D5E5C647B337D5B5C732D2F255C2E5D5C647B332C347D2426706F3D313426736E3D592673743D52535F53544F434B5F4E554D424552267573743D3639302D363732342677633D4E4F4E4526

author: Chris Wilson
author_rank: Super Contributor
timestamp: August 10, 2012, 10:49:10 pm
content: Thanks Sean, all done this evening and working fine. just need to mount the wall panel with the output BNC's and the rotary selector knob. Another job jobbed with the forum's assistance

author: TerminalJack505
author_rank: Super Contributor
timestamp: August 10, 2012, 11:40:25 pm
content: So did that switch have the mechanical stop like you mentioned? I saw in the datasheet that you could change it so that it wouldn't spin continuously. But the datasheet didn't make it clear whether or not you could limit to fewer than 8 positions.

author: amyk
author_rank: Super Contributor
timestamp: August 11, 2012, 08:29:12 am
content: I don't think it would be necessary to limit the switch travel, because you get an "off" feature in the 2 unused positions for basically free.

author: SeanB
author_rank: Super Contributor
timestamp: August 11, 2012, 08:46:13 am
content: You do not, it wraps around to 8=0 and 9=1 again. I used this with a BCD thumbwheel to do an extra switch function on the top 2 sections.

author: Chris Wilson
author_rank: Super Contributor
timestamp: August 11, 2012, 09:18:44 am
content: I have used Grayhill "normal" rotary switches for automotive ecu switching, and this encoder switch is mechanically identical. It comes with two *TINY* locking pins, about 1.5 mm long They drop in to a series of peripheral holes around the shaft of the switch. Where you drop them in limits the clock and anticlockwise movement, so you could, in theory lock it in one position, or seven positions. The fact is you are more likely to drop the pin into the carpet pile than the holes in the switch. They really are very fiddly. I will probably make a scale for the switch indicating the four frequency allocations, and let it fully rotate. I did *ugger a switch up when a pin dropped right through into its innards and jammed it up solid, so am a bit wary of doing the rotation limitation now, unless really necessary. HTH, cheers.