Some kind of selector knob?


9 posts
by EtanSivad » Thu Dec 06, 2012 5:56 pm
I'm looking for an add on part that I'm not even sure what to call it. Which makes it really hard to google for it.

Basically, I want a knob that can be turned to about 5 or 6 different values. Like a volume knob, but with a finite number of steps not an analog scale.
So, the knob could be set at values 1 through 6, and then I'd read the value with a shell script to control another script I'm running

(The ultimate goal is to make a timelapse box where I can specify the frame rate. So, setting 1 would be 1 frame per second, setting 2 would be 1 frame per minute, etc, etc.). I'm looking for a solution that I can set the exposure time, power up the box, it'll get read by the automation scripts and run from there.

Thanks,
Posts: 3
Joined: Thu Dec 06, 2012 5:47 pm
by nroff-man » Thu Dec 06, 2012 6:51 pm
hi

you need to google for a rotary switch.

something like `12 way rotary switch' ought to do it.

Bye

Edit: spelling
User avatar
Posts: 19
Joined: Mon Jul 30, 2012 7:31 pm
Location: /usr/bin
by gordon@drogon.net » Thu Dec 06, 2012 9:12 pm
EtanSivad wrote:I'm looking for an add on part that I'm not even sure what to call it. Which makes it really hard to google for it.

Basically, I want a knob that can be turned to about 5 or 6 different values. Like a volume knob, but with a finite number of steps not an analog scale.
So, the knob could be set at values 1 through 6, and then I'd read the value with a shell script to control another script I'm running

(The ultimate goal is to make a timelapse box where I can specify the frame rate. So, setting 1 would be 1 frame per second, setting 2 would be 1 frame per minute, etc, etc.). I'm looking for a solution that I can set the exposure time, power up the box, it'll get read by the automation scripts and run from there.

Thanks,


You should simply have 6 separate toggle switches - and for real geek charm, arrange the Pi to read them as a binary number - 64 different speeds - or just 3 toggle switches will give you 8 settings...

Old fashioned rotary switches going out of fashion, I suspect. There's a 6-way one on this page though - http://www.maplin.co.uk/rotary-switches-2417 will give you an idea what to look for.

You'll probably need another separate switch to "enter" the value you set on the rotary switch though... Big Red Button type of thing!


-Gordon
--
Gordons projects: https://projects.drogon.net/
User avatar
Posts: 1508
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
by EtanSivad » Thu Dec 06, 2012 10:16 pm
The rotary knob looks to be exactly what I'm looking for. Though, I'm at a loss on how I would wire this to the Pi board itself. Any suggestions for what hardware to use to interface with it?

The toggles would be cool, but less serviceable. My goal is to make a setup so simple my mom could use it.
Posts: 3
Joined: Thu Dec 06, 2012 5:47 pm
by toxibunny » Thu Dec 06, 2012 10:41 pm
It's basically just a fancy switch, so you'll probably connect one prong to the 3.3v GPIO, then maybe some sort of pull-up resistor or whatever, then the rest of the prongs will go to input GPIOs... Dead easy.
note: I may or may not know what I'm talking about...
Posts: 1085
Joined: Thu Aug 18, 2011 9:21 pm
by techpaul » Fri Dec 07, 2012 1:46 am
Normally I would connect the common pin to ground and pull ups to a rail on the outputs, then connect outputs to GPIO pins.

If you want you could use a more complec solution of rotary encoder switch (the type that give you continuous rotation controls)
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/
Posts: 1509
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
by EtanSivad » Fri Dec 07, 2012 3:40 pm
Ok, this is starting to make sense. I found a bunch of rotary switches that will work.
You mentioned that I need to possibly add a resistor to the voltage line, how will I know if I need to add one? I'm presuming that I'd need to read the voltage with a multi-meter, but what level of return do I want?
Posts: 3
Joined: Thu Dec 06, 2012 5:47 pm
by rurwin » Fri Dec 07, 2012 4:00 pm
You want a hex- or BCD-coded switch. That way you don't need a pin for every position.

Maybe this one.

The wiring should be for example...
3.3V to the common, 1K resistor from every way to 0V, 10k resistor from every way to a different GPIO pin.
Chose the GPIO pins so you can read them in one go as a binary number.

A BCD coded switch will give you 10 positions, and they can be bought without the stop, so you can turn them from position 16 (or 10) to position 1.
User avatar
Forum Moderator
Forum Moderator
Posts: 2903
Joined: Mon Jan 09, 2012 3:16 pm
by gordon@drogon.net » Fri Dec 07, 2012 5:52 pm
EtanSivad wrote:The rotary knob looks to be exactly what I'm looking for. Though, I'm at a loss on how I would wire this to the Pi board itself. Any suggestions for what hardware to use to interface with it?

The toggles would be cool, but less serviceable. My goal is to make a setup so simple my mom could use it.


The switch will have a common pin and 6 position pins. Connect the common pin to the 0v pin on the Pi, connect the 6 other pins to 6 of the Pi's GPIO pins, enable the internal pull-up's on the GPIO pins and off you go. A separate switch acting as an "enter" key could be wired up in the same way. So turn the rotary switch, push the "enter" key, and off you go - the Program on the Pi is watching for the Enter key to be pushed, then it will sample the rotary inputs...

You could just sample the rotary inputs and wait for e.g. "no changes in 4 seconds". So you turn the knob and when you've left it in the same position for 4 seconds, then the software says: "a-ha! that's the selection" then does that action...

-Gordon
--
Gordons projects: https://projects.drogon.net/
User avatar
Posts: 1508
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK