is it possible to read 90in1?

Hi!

Just getting acquainted with arduino. Seems like a lot of fun. I'm planning to build this big machine for an upcoming art-show. Ideally my duemilanove (atmega328) should read the state of about 90 tumbler switches and then collect the user input data and print it out via mac-connected printer.

as far as i've understood, it should be possible via multiplexing all of the available 6 analog inputs?

any suggestions/opinions if this is possible? :-/

Never heard of a tumbler switch, Google tells me that is what is often referred to as a toggle switch. Sure, it is quite possible. Look up 74LS165 parallel in/serial output shift registers as one option.

You would need a dozen of them to read 96 inputs. You would need to supply clock and load pulses. So, you would need three digital pins: one in and two out.

Yep it's the same thing. Don't remember where I picked up the name 'tumbler' (:

Seems like a reasonable way to do it.. Lots and lots of messy wires and a lot of coding but hopefully it'll work.

suppose there isn't anything premanufactured available for shift registers like this : http://www.sparkfun.com/products/9056 ? Would save quite a bit of soldering..

It seems like there should be something out there. Nonetheless, the mux you linked to could work. It's 16-channel and can handle digital or analog, input or output, which makes them more versatile. So, it's more than you need but six of those modules would be all of $30. Hardly worth looking further, especially if you think you might recycle the project.

We would need a way to select which of the six multiplexers you are using. So a mux for the mux or use six more digital pins, each to select one of the muxes (muxen?). Or we could connect each to a different input pin and read them in parallel. That might even be easier.

What else might the Arduino be connected to? Pins 0 and 1 are needed for USB, but are we free to use every single I/O pin?

I'm really new to all this physical programming so, I might not know the easiest way.

The way I've planned to do this is by reading all the switches through arduino into MAX, from there combine all the results, format them nicer and send to the printer connected via usb.

In a few words its basically a full-manual operated user feedback machine.

I'm not sure if i can code all the data-handling into the arduino, without needing a computer.

You could try the more direct approach also, using a 16 to 1 data selector

http://focus.ti.com/lit/ds/symlink/sn74150.pdf http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=296-26368-5-ND

The module is 'pricey', but its getting hard to find DIP parts to breadboard with: http://search.digikey.com/scripts/DkSearch/dksus.dll?vendor=0&keywords=74HC4067

Each input will need a pullup resistor, you can buy these in SIP or DIP packages where there is 1 pin going to VCC and the individual 'outputs' connect to a 74150 input and to 1 side of your switch. The other side of the switch goes to ground.

You then take the 6 W outputs and go go thru a 7th 74150 so you just have 1 input to read into the arduino.

You will then need 4 wires to select which of the 16 inputs on layer 1 get fed to layer 2 (the 7th arduino), and 3 wires to select which output comes in to be read.

I can draw up a schematic when I get home. The 7 lines can come direct from the arduino, or you can use a shift out register and shift out the 8 bits to make a selection. So then you're down to 3 pins. 1 data in, 1 data out, 1 shift clock out.

The hardware method selected would depend on how you want to deal with the data - 96 reads of 1 bit at a time, or shift in 96 bits and break them up into 6 words for further processing.

The 96 reads would also let you pick & choose what you read & when - for example, you might only choose to read switches 3,4,5 if switch 1 was set.

Get some wirewrap socket/pins like these, would assemble pretty quick.

Break up into the needed lengths, tack the ends down, wirewrap away, will go quick once you get the hang of it.

Take a look at other breadboards also that would allow a more compact assembly:

http://www.parts-express.com/pe/showdetl.cfm?Partnumber=320-227

(edit, a more complete list: http://www.vellemanusa.com/us/enu/product/search/?id=ecs)

This particular one is nice because it has pairs of holes connected to cut down on discrete wiring id if the parts are adjacent. There are other versions also with more than 2 holes connected, or with single holes for the ultimate in flexibility.

What else might the Arduino be connected to? Pins 0 and 1 are needed for USB, but are we free to use every single I/O pin?

There shouldn’t be anything else in this project. Mostly toggle switches, probably a couple of potentiometers. Sums up to about 90-100 switches.

So now I have suggestions for three separate versions in a couple of hours. I’m already starting to like the community around the arduino :slight_smile:

Well, after I manage finish and display this project, I might try to build myself an arduino based monome. Wouldn’t be bad if I could reuse some components from this project.

What do others recommend? What are the pros and cons of these three options.

You can read switches with less inputs if you use a scanned matrix. This project :- http://www.thebox.myzen.co.uk/Hardware/Econo_Monome.html Has lights as well as switches but it is simple to not use the LEDs and to extend the switches.

Okay, here's where the Engineer part of you, needs to tell the artist part of you to write a design requirements specification. Time for the left brain to meet with the right brain.

It's okay for the artist to say "about 90-100 switches" or "a couple of potentiometers." The engineer is going to need to know whether it is [ch8804]96 points of I/O. How many is a "couple?" Exactly two?

How are the switches going to be mounted? In a nice neat left-brained 8x12 array spaced exactly 25mm apart. Or spread in a willy-nilly right-brained formation within a 100m radius from the arduino?

Contrary to popular belief the left-brained engineer isn't trying to stifle creativity but rather understand what needs to be done to implement it in the most efficient manner.

Engineers are the ultimate minimalists.

Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher.

It seems that perfection is attained not when there is nothing more to add, but when there is nothing more to remove.

--Antoine de Saint Exupéry

…concept is still a bit in progress. The number of different switches depends on the questions that will end up on the feedback machine.

Fine. I’ll stay with this concept :
5 potentiometers, 90 toggle switches, one push button (for print command) one arduino duemilanove. The switches are mounted in line, mostly with intervals of 70-80mm on plexiglass plates 300mm x 1000mm x 5mm on seven plates. So it will be a long wall-mounted aprox 7m long plexiglass plate. Arduino, the macbook with max/msp and the printer will be sitting in a separate box at the rightmost end of the plexiglass plate.

User toggles numbered switches which have questions printed above them. Some could be potentiometers, so ideally i could read 3…5 different states from that question instead of 0/1. So 90 feedback switches, 5 potentiometers. One push button to send the command to arduino to count the current state of the toggle switches and pots, send the info to max to refine the data and output to printer.

Sorry, I had it all nice and logical in my head and didn’t think out loud :stuck_out_tongue:

with max/msp

This is sound generating / controlling software, it is not the best thing for formatting output to send to a printer (if you can do this at all). I assumed you put this because it is the only language you know. This sort of thing is best done in the Processing language.

I would use a matrix you will need a diode in line with each switch, and two serial in parallel out shift registers (you could get away with only 1 if there were 64 switches) and one parallel in serial out shift register. The the other stuff could just hang off the remaining arduino pins. For multi choice questions you can use rotatory switches, much better than using pots.

This is sound generating / controlling software, it is not the best thing for formatting output to send to a printer (if you can do this at all). I assumed you put this because it is the only language you know. This sort of thing is best done in the Processing language.

Actually I'm more of a semi-experienced web-programmer guy. A friend of mine is a bit more familiar with max. He said that what I want should be possible with max. Basically I need to calculate/generate the right text-blocks based on the inputs and output them to a small check-printer (haven't obtained one yet, so i can't say the model yet). Sorry, English isn't my native language, so I'm probably not as fluent nor can express myself as clearly as I wish I could..

You can read switches with less inputs if you use a scanned matrix. This project :- http://www.thebox.myzen.co.uk/Hardware/Econo_Monome.html Has lights as well as switches but it is simple to not use the LEDs and to extend the switches.

Seems like a good option to keep the monome dream alive also :)

Sorry for being a complete beginner, but hey, that's how you start, eh.

I wonder if any of you could please make me a step-by-step instruction how to cope with this project? The parts list and other tricks I should know. I guess I could come up with a small donation or smth as its a half-financed school-project. A big thanks for sure ;)

but hey, that's how you start, eh.

No I was born knowing all this stuff, well actually this stuff didn't exist when I was born, I sort of grew up with it. ;)

haven't obtained one yet, so i can't say the model yet

That is going to determine a lot of the back end to your project.