Multi-digit rotary switch

Go To Last Post
20 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey all,

 

I have a 6-segment rotary switch with each of the wheels having digits 0-9. Each segment has a common pin and 4 data pins for the different digit combinations.

 

I've written some code that can run a 74165 shift register and 74138 decoder, but I'm having some difficulty figuring out how to build the supporting circuitry that will allow me to sequentially go from segment to segment so that i only need one shift register IC. I admit my knowledge of electronics hasn't yet caught up with my programming ability and I'm at a loss right now figuring out how to do it.

 

There seem to be several posts about how to use an individual rotary switch, but i haven't found one yet that uses multiple. Any suggestions?

 

Thanks!

This topic has a solution.
Last Edited: Thu. Jun 20, 2019 - 02:26 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you post a schematic of how you have things connected already? It's not entirely clear from your written description.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


fishbones wrote:
I have a 6-segment rotary switch

I was thinking one of these at first:

 

So perhaps a clear picture of what your describing would help.

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Ah interesting - what I had in my mind was a number of switches more like this...

 

 

(that's because I've used the hex version of this kind of thing in the past).

 

I think OP needs to clarify - hopefully a schematic will also identify the kind of switch being discussed?

 

PS now I re-read "6 segment" in the OP I guess it's more like your picture. But in that case, when you rotate the knob don't all 6 banks just all go to the same setting? In which case why duplicate the same thing 6 times?

Last Edited: Thu. Jun 20, 2019 - 01:57 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here's a partial hopefully showing the important bits.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The rotary switch in question is a Digiswitch model 378/502-6

 

-EDIT-

 

I've attached an image showing front and back

 

Attachment(s): 

Last Edited: Thu. Jun 20, 2019 - 02:07 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

fishbones wrote:
I've written some code that can run a 74165 shift register and 74138 decoder, but I'm having some difficulty figuring out how to build the supporting circuitry

It would help to know what you intend to do with these.  If you want to read the switches, you can daisy chain three of the 74165s and shift in all of the switches, then do any logic decode in s/w.

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

 

It would help to know what you intend to do with these.  If you want to read the switches, you can daisy chain three of the 74165s and shift in all of the switches, then do any logic decode in s/w.

 

 

Jim

 

One use I have in mind is to make a high precision timer board.

 

I hadn't considered using 3 shift registers daisy chained together; this just might be the solution i need, thank you!

 

I was hoping to only use one shift reg to avoid wrangling all those individual wires going to the switch, but I'm beginning to believe my original plan is impractical because of the nature of the switch internals.

Last Edited: Thu. Jun 20, 2019 - 02:20 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ghjk

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

Last Edited: Mon. Jun 24, 2019 - 08:32 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


I was thinking more along this line:

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

I was thinking more along this line:

 

Yes, this is my new approach now; each shift register will read two rotary wheels and the full daisy-chained 24-bit value will be decoded on the micro as you had suggested.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

but I'm beginning to believe my original plan is impractical because of the nature of the switch internals

Yes, you cannot connect the switches together, the lines selected in one switch cause lines in a different switch to also be "shorted" together.

 

How about using a pot & ADC to make a setting?..just dial the pot and read the number out on the display.  MUCH simpler

You could have a button to alternate between showing the pot value & the countdown time

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Lots of ways to skin a cat...(Sorry, Cliff)

 

This is what I had in mind, it uses one diode for each of the four data pins per switch, (i.e. 4 diodes per switch).

It uses the internal pull-up resistors.

It uses one Switch Select Line per switch.

 

I drew in two switches, you can add the rest.

 

The diodes could be mounted to the back of the switches, then gang connect the Data A, Data B, c, and D lines, (almost like you have it now, but you need the diodes).

 

The Switch Select lines are held low to read a specific switch, and set high to disconnect that switch while reading another one.

 

In my mind, selecting a micro with enough I/O pins to do this without the additional chips would be easier.

 

JC

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For future reference, those switches are usually called "thumbwheel" switches. Everyone would have known immediately what you are talking about if you had used that term.

 

Jim

 

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could probably use 5 resistors per switch to form a voltage divider...then run the 4 switches to 4 adc lines  (one adc per switch).  So the overhead is only 4 AVR lines & 20 resistors , to read 16 "bits".

The diode way needs 16 diodes & 8 avr lines to do the same.

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Fri. Jun 21, 2019 - 02:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

fishbones wrote:

I was hoping to only use one shift reg to avoid wrangling all those individual wires going to the switch, but I'm beginning to believe my original plan is impractical because of the nature of the switch internals.

 

Do you know if these thumbwheel switches have inbuilt diodes ?  You can test with a multimeter - dual up '7' and see if 3 LSB pins appear shorted.

 

The HEF4021 can be useful for scanning parts like this bank of switches. It has 8 IP and 3 outputs, so can manage a matrix up to 24 (with matching diodes and pullup resistor SIP pack)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could just connect all the commons together instead of the data lines, then take a number of HC244s to make a selector. you have 1 x hc244 for 2 wheels. connect all the outputs together to 4 IO lines and select each wheel individually to get a readout.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 then take a number of HC244s to make a selector.

Why make all the complication & expense of extra chips?  Using the ADC is the most straight forward, requires no additional chips,  and only takes a few cheapo chip resistors (will require 5 per switch).

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess that it is a six-digit binary output device.   Put Vcc on ONE at a time the top pins.  Read the four bit binary value (for the selected value 0-9)  on the output bus that is used for all six digits.

 

This looks like an <expensive> pre-microcontrollers device that can today be replaced by a $2 matrix keypad and a $1 microcontroller.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You really need a display to replace the complete functionality of the switches. There really is a small set of applications where these switches really win out. Plus the fact that they are non-volatile.

 

Jim

 

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Fri. Jun 21, 2019 - 11:35 PM