Doubt about the project with FEZ family

I would like one advice.

I am developing a project that must be placed between 20 and 30 buttons to be pressed by the user.

What is the best microcontroller for use in this project, FEZDomino only has 13 digital outputs, is there any way to expand the digital outputs or is it better to choose another microcontroller??

Thank you.

You could use a FEZ Panda II, it has 54 I/Os.

Alexander, why not use a unique resistor value for each button to create a button matrix?
You would then only need 1 analog input.


This works well?

It seems an elegant solution.

Have you ever done anything like this, I could spend an example?


I have not done this before myself, but some arduino shields use it.
For example:

This is the schematic for the arduino “lcd and keypad shield”.
It uses 4 buttons in the way I described. Don’t know how it will work with that much buttons, but you might be able to multiplex it in some way?

And if you don’t get it to work with one analog input, this example shows how 5 buttons can be used with 1 analog input. Since most fez devices have around 6 analog inputs, this would result in 30 buttons.


Look what I found:

I have a 25 key keypad on a 5x5 matrix on Panda. This uses 10 pins and can easily go up. I can share the matrix driver if you like.

I tried the analog way but hit some serious problems above 15 keys or so. One could use multiple analog pins but it gets overly complicated in my opinion.

You can also use a shift register or a dedicated keypad chip but I think there are plenty enough IO on the Panda.

The Domino has USB Host so you could use a PC keyboard encoder and have over 100 keys.

Have you guys looked at the keypad we offer for gadgeteer and the included source code?


I wish you would share with me the driver.

Hmm good idea t use a expander.
The ghi keypad is fine too, but I guess you want to use your own buttons?

My point is there is drivers, free code, that you can use :slight_smile:

Robert and Gus,

So I’ll use my buttons.

It will be a project for children with communication problems.

My wife works with speech therapy, so I’m doing a project to assist her and the children will be very interesting.

Do you want to feed the button input to a computer? Or do you want the microcontroller to do the speech?

What quantity do you need?

I want the microcontroller to do the speech, I need between 20 at 30 buttons.


I found two very interesting articles, both are the same author, look:

These two designs are made to arduino, detail are written in Spanish.

resistor ladder designs work, as was pointed out way up the top of this thread. Whether they’re effective or not is questionable; for the scale of # buttons you have you might have an interesting time calculating the best resistor values to use and the appropriate ranges of values they will return on a Fez. (multiple presses at the same time could be troublesome on that many buttons!)

You could do this for your “prototype” and figure out if there’s a more effective solution later if you just wanted to kick on with the project.

I would not use resistor ladder. Because you can not assign an interrupt on press handler.

I would use a 6x6 matrix, so you can read 36 buttons with 12 IO lines.

@ Wouter and @ Gus

Have you seen this shield for Arduino?

The GHI could develop a shield like this.

I’ve gone down the resistor ladder route before. There’s a reason they stop at about 4x4 (16) buttons. You can maybe go up to 20, but it gets progressively less accurate and you need resistors with better than 1% tolerance… difficult.

Look at this article and the attached spreadsheet to calculate errors:


I’d rather go with a matrix scan. I’ll try and get my Matrix scan code up on the Code site in the next day or two. Work on a physical layout for your keyboard in the meantime.

Use gadgeteer and never worry about all this :slight_smile: