Reading Tri-direction Scan Switch (C&C TPC Series)

In summary, the electrical sketch on page two is confusing and there is no definitive way to figure out the state of the switch from a single reading. To read the switch, you would need to connect pins 0, 1, 2, 3 to port bits 0, 1, 2, 3 and ground pin 1.
  • #1
Jiggy-Ninja
309
1
I'm trying to figure out a bit of a http://www.ck-components.com/tpc/navigation,10475,en.html. Data sheet is in the Literature box marked "Download TPC catalog pages".

The electrical sketch on page two is what's confusing me. How would I read this switch to figure out what its state is? This switch is going to be on the far side of an I2C connection along with a few other buttons, so I was thinking about using a GPIO Port Expander like the chip I linked to to read it, but I'm confused about how to do that.

Would it even be possible to deduce the state of the switch from a single reading? Or would I have to take multiple readings, fiddling with the input/output settings of the bits to figure it out?

EDIT: That should be C&K in the title. Could a mod please correct that?
 
Last edited:
Engineering news on Phys.org
  • #2
  • #3
Well the switch looks like it has six positions
and with three bits you can decode eight states..

Datasheet shows three switches that connect four terminals, see "electrical sketch" on page 2.
If you applied voltage to one pin, maybe pin 1-
The other three pins would decode to switch position.
Presumably you can read in a word from that port expander and examine the individual bits.

Be sure the program handles all eight states - you don't want it to crash if the switch breaks and gives you one of the two missing codes.
 
  • #4
None of that tells me anything I didn't already know. This switch configuration looks quite unorthodox, and I've never dealt with it before and have no idea how to deal with it. I was looking for more specific advice on a configuration or sequence of steps I could use to read the switch state.

If something other than a generic GPIO port expander is necessary to do that, I could work with that. Component count needs to be kept to an absolute minimum though. I2C is also required.

The actual project I'm looking to do with a switch like this is modifying a Wii Nunchuck to add some extra controls and interface it to a computer as a USB HID device. This is one switch I was looking at to act as a mouse scroll wheel.
 
  • #5
I was looking for more specific advice on a configuration or sequence of steps I could use to read the switch state.
Connect switch pins 0,1,2,3 to port bits 0,1,2,3 .
connect +5V to pin 1.
Read the four bits, pin high = 1
Initial = 0101
Scan Left = 1100
Scan Right = 0100
Select Left = 1101
Select Right = 0111
Select mid = 1111

Note the drawing itself is ambiguous about select left & right
http://www.mouser.com/ds/2/60/TPC_31aug10-23106.pdf page 2
but a simple continuity check with multimeter will show for sure how it's wired.

I was unable to discern from datasheet whether you'll need pulldown resistors,

If that's not the answer then i misunderstood the question.
 
  • #6
That is exactly what I was looking for, thank you.

A more optimal solution, especially since this would be used in a space-constrained project, is to ground pin 1 (or 2, since it's symmetrical) and use the internal pullups on the GPIO chip, instead of requiring 3 external pulldowns.
 
  • #7
Jiggy-Ninja said:
That is exactly what I was looking for, thank you.

A more optimal solution, especially since this would be used in a space-constrained project, is to ground pin 1 (or 2, since it's symmetrical) and use the internal pullups on the GPIO chip, instead of requiring 3 external pulldowns.

YES ! I knew that you knew and just needed to be convinced of it !

Thanks for that reponse.

BUt work it out on paper - be sure each position gives a unique code, and remember to handle the impossible ones so program won't bomb on stuck switch.
I usually declare 'impossible' code to be same as 'off', so user sees switch malfunction as failure to respond.

old jim
 
Last edited:

1. What is a Reading Tri-direction Scan Switch?

A Reading Tri-direction Scan Switch is a device used in barcode scanning systems that allows the scanner to read barcodes in three different directions: up, down, and forward.

2. What is the purpose of a Reading Tri-direction Scan Switch?

The purpose of a Reading Tri-direction Scan Switch is to increase the efficiency and accuracy of barcode scanning by allowing the scanner to read barcodes in multiple orientations without having to physically reposition the scanner.

3. How does a Reading Tri-direction Scan Switch work?

A Reading Tri-direction Scan Switch uses a combination of mirrors and sensors to redirect and capture the barcode image from different angles, allowing the scanner to read the barcode in multiple directions.

4. What are the benefits of using a Reading Tri-direction Scan Switch?

Using a Reading Tri-direction Scan Switch can improve workflow efficiency, reduce the risk of errors, and save time by eliminating the need to manually adjust the scanner for different barcode orientations.

5. Are Reading Tri-direction Scan Switches compatible with all barcode scanners?

Not all barcode scanners are compatible with Reading Tri-direction Scan Switches. It is important to check the specifications of both the scanner and the switch to ensure compatibility before use.

Similar threads

Replies
12
Views
2K
Replies
10
Views
2K
  • Computing and Technology
Replies
14
Views
3K
  • Advanced Physics Homework Help
Replies
1
Views
1K
Replies
11
Views
5K
  • Beyond the Standard Models
Replies
14
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
Replies
2
Views
6K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
3K
Back
Top