Emulating a keypress with electronics (Using Rotary Encoder)

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
TimEG
LCD!
Posts: 11
Joined: Sat Apr 15, 2006 7:11 am

Emulating a keypress with electronics (Using Rotary Encoder)

Post by TimEG »

Hi,

I've been trying to source information about how to use a rotary encoder with the MO keypad inputs. I have searched the forums and now know how to interpret the quadrature signal using either a PIC or hardware logic. Now I have to say I am not a hardware engineer, my background is purely software so all this is very new to me.

The circuit diagrams I have found all have two pin outs. One goes high when the encoder is turned CW the other goes high when it's turned CCW... That much seems straight forward. The question is, how do I go about turning that into a signal the MO can read?

I understand the matrix kepad input works only when a button is pressed that mechanically joins one of the columns with one of the rows. How do I do that electronically? I know that you need a mosfet or something but I have no idea how it would be connected. Could someone please direct me to a circuit diagram which shows how this can be done.

So to sum up. When the Rotary Encoder Output A goes high I need to join Column one and row one on the MO. When the Rotary Encoder Output B goes high I need to join Column one and row two on the MO. How do I do this, where does to power come from etc??

EDIT: Just wanted to clarify something. What I'm not sure about is where the power comes from. Say I decide to use a PIC with one output connected to the gate of the mosfet. The PIC needs to be powered from a 5V source. Where does that source come from and how does it all connect to the MO??

The following diagram might help explain!

Image

Raquel
Matrix Orbital
Matrix Orbital
Posts: 805
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post by Raquel »

Hello TimEG,

Thank you for posting on the forum.

So it looks like you want to power your rotary encoder from the MO. There are a couple of ways of getting power from the MO board, but it depends on the module you have, can you please tell me what module you have and its pcb revision?
Raquel Malinis
Design and Development
Matrix Orbital

TimEG
LCD!
Posts: 11
Joined: Sat Apr 15, 2006 7:11 am

Post by TimEG »

Raquel wrote:Hello TimEG,

Thank you for posting on the forum.

So it looks like you want to power your rotary encoder from the MO. There are a couple of ways of getting power from the MO board, but it depends on the module you have, can you please tell me what module you have and its pcb revision?
Hi. The model is VK204-24-USB and I believe there is only one revision of PCB V1.0 (I hope that is right)

I would like to power the rotary encoder from the MO yes!

Thanks, Tim

Raquel
Matrix Orbital
Matrix Orbital
Posts: 805
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post by Raquel »

Hi Tim,

There is a capacitor by the display connector at the top of the board (populated horizontally). The right side of the cap with the white stripe is 5V and the left is gnd. This 5V is same 5V coming from the 3.5" floppy power cable, not from the USB.

Please make note though, that any damage caused by soldering / altering of the module will void your warranty.

Please let me know how it turns out.
Raquel Malinis
Design and Development
Matrix Orbital

TimEG
LCD!
Posts: 11
Joined: Sat Apr 15, 2006 7:11 am

Post by TimEG »

Thanks for the quick reply.

Hmmm. Might have to double check I have everything correct before I attempt this... I'm not great with electronics so could you confirm a couple of questions for me.

1 - Which one is ground and which one is high, the columns or the rows connector?

2 - Do I need an additional wire as shown in the diagram (Red wire, with appropriate components) to allow a connection to flow through the gate on the mosfet (Red) or will the current flow happily through to ground via the keypad connector (Blue). If you see what I mean.

EDIT: Also, rather than solder onto the MO, can I spur off the floppy connector instead. I.E. Will that achieve the same thing or is there a reason why I would have to go driectly off the MO itself?

Image

Jon
Matrix Orbital
Matrix Orbital
Posts: 231
Joined: Mon Oct 24, 2005 10:38 am
Location: Calgary, AB, Canada
Contact:

Post by Jon »

Hi Tim,

Raquel has these answers for you:

1) The rows are high (input pulled up to 5V) and the columns are normally low

2) No, you do not have to add an additional gnd connection.

3) Yes, you can spur off connections from the 3.5" floppy connector, there is no reason to connect to the MO. I just thought that was want you wanted originally in your first post.

When you use an n channel fet, connect the gate to the rotary encoder output, connect the drain to the row and the source to the column.

Best Regards,

TimEG
LCD!
Posts: 11
Joined: Sat Apr 15, 2006 7:11 am

Post by TimEG »

That's great. Basically tell's me everyhting I need to know. Thanks for the advice!

Raquel
Matrix Orbital
Matrix Orbital
Posts: 805
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post by Raquel »

Hi Tim,

You are welcome. Please let me know how it turns out.

Best Regards,
Raquel Malinis
Design and Development
Matrix Orbital

poprhetor
LCD?
Posts: 4
Joined: Sun May 21, 2006 3:19 pm

What will this be?

Post by poprhetor »

I'm brand new to all this electronics stuff, so please be patient with me. I'm most likely going to purchase the MX422 in the next month, and I'm researching different input solutions, since I won't be using the Matrix keypad. So I'm curious . . . what exactly is the interface you're working on? All I know about rotary encoders I learned on this thread and on Wikipedia a few minutes ago. :-?

Will this be some kind of touchpad or sensor interface?

Raquel
Matrix Orbital
Matrix Orbital
Posts: 805
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post by Raquel »

Hi poprhetor,

Thank you for posting on the forum.

Unfortunately, I am not sure what application Tim will be using his rotary encoder. But if you decide on using any interface to your MX422, I will be happy to help you with questions you might come up with.

Best Regards,
Raquel Malinis
Design and Development
Matrix Orbital

poprhetor
LCD?
Posts: 4
Joined: Sun May 21, 2006 3:19 pm

Post by poprhetor »

Hmmm . . . well then, I'd be happy to take you up on that. :) We can start a new thread if you like--I'll leave that up to you.

I don't have the unit yet, so I won't ask too many questions that are likely in the manual. Right now, I'm interested in finding out what kind of switches can be made to work with the unit, since I'm not interested in the stock keypad or any other conventional keypad. I'll be putting this in a bare aluminum UFO-1203 pc case from mountainmods.com, so the whole thing should have a clean, industrial feel. The first thing to catch my attention about the Matrix Orbital was its very clean appearance. Anyway, I've been looking at a lot of switches, primarily for their aesthetic value, but I need to know what kind of switches will actually work. I read in another thread that I must use momentary switches. Is that true? I was thinking of something sort of like this, but with an LED that shows through the base. I think I may have found something like that in what I see here at the top of the page, although exactly how the LED looks isn't obvious. It's also a "bypass switch," and because I don't know what that means, I don't really know what to do about it. :roll:

So I guess it comes down to me learning the basic vocabulary--the names of the types of switches that can be used for this application--and taking that new knowledge with me to some stores here in town. I live in a big enough city (San Diego) that I can find some reliable, hardcore geeks in the field to help me find the switch I want, as long as I can give them some basic info to go on. Many thanks in advance for your help!

Raquel
Matrix Orbital
Matrix Orbital
Posts: 805
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post by Raquel »

Hi poprhetor,

When you have decided with the switch you want to use, then we can get to work. The switches you've indicated look feasible.

I will try my best to help, and hopefully I can.
Raquel Malinis
Design and Development
Matrix Orbital

TimEG
LCD!
Posts: 11
Joined: Sat Apr 15, 2006 7:11 am

Post by TimEG »

Hi poprhetor & Raquel,

The project I'm working on is using a small Alps encoder (No: RKJXT1E12001). The device is a tiny rotary encoder with a built in 8 direction joystick and a center button push. It really is amazing and only cost $5 (Although I had to get it shipped to the UK from Mouser in the US). With the encoder it features 11 switches and it's only about a cm square!

I'm not that versed in electronics but as a small project I wanted to connect this to the MO keypad so I could use it as the main method for controlling the unit. I though it would be great to have all the functions I need accessible from a single compact switch.

The encoder can't be connected directly to the MO keypad inputs but must be decoded so I have purchased a PIC programmer and am going to write a small program to do the hard work. I'm currently using a P16F627A chip, the outputs of which will then be fed through MOSFETs which will simulate a key-press on the MO keypad. Now that's the theory!! Putting it into practice may be a little harder. I'm a software engineer and have never used a PIC before so am currently teaching myself some basic hardware to get this running. The main stumbling block is that I know very little about MOSFET's so want to make sure I have everything 100% stable before I go connecting this to my display.

(Speaking of which, if you have any recommendations for a suitable MOSFET please let me know. The gate will be driven at logic voltage from a PIC so any advice as to what I should be looking for would be hugely welcome)

I'll be sure to let you know how I get on and post some pictures on my website when I get it working. Hope that's enough info!

poprhetor
LCD?
Posts: 4
Joined: Sun May 21, 2006 3:19 pm

Post by poprhetor »

Well, I know I'm new to this stuff, and therefore a bit dense, but I have trouble imagining exactly how it will look and work from an end-user perspective. I'll be very happy to see some pics when you have them, so yes . . . . please post a link to some pics as soon as they're available.

I wish I had the knowledge to conceive of something like that, but geez . . . I studied philosophy in college! You techies always impress me. I'm afraid my ability to conceive of interesting interfaces is stymied by my lack of basic electronics knowledge. Oh well, I'll start learning here. :)

Post Reply