Many switches, single line

Are there cheap SPST switches that have built in single wire comm. that can all be hooked up serially?

Or is there an efficient method to allow for expanding the number of switches easily?

I was thinking of a possible DAC like setup but this limits the number of switches and speed and may be error prone. 16 switches would require a 16-bit DAC.

What I'd like is a single 1 wire interface for routing all switching and controls through the unit and be "infinitely" expandable. Each switch would require a unique ID. It would be nice it were possible to have each control determine it's ID based on it's distance from the master. This is so no mapping has to be done.

The concept is to simply routing a large panel with many controls to simply a 1-wire interface which reduces wiring and pcb size significantly while allowing for expansion if required.

Is there anything out there that gets close to this? Essentially it boils down to finding cheap pots and switches that have the interface built into them

Reply to
Bobby Joe
Loading thread data ...

Have you thought of noise in your single line?

16 bits needs an analog resolution of about 60 ppm of full signal, it goes easily into microvolts (thermals & co).
--

Tauno Voipio
Reply to
Tauno Voipio

On a sunny day (Thu, 8 Mar 2012 05:17:49 -0800 (PST)) it happened Bobby Joe wrote in :

Maybe some i2c I/O expanders, PCF8574 8 bits digital in and or out, PCF8591 for analog in and out. Else of course a PIC win many pins and ADC + digital I/O to say RS232.

Reply to
Jan Panteltje

Last time I needed to do this, I wired each switch in series with a maxim one-wire ID chip (i.e. DS2401). When you close the switch, the controller can scan the serial number in the chip, and you can put many such chips on the bus.

formatting link

Reply to
DJ Delorie

Of course, this is why I said "...may be error prone". It's not a good way to do it unless you have only few switches.

Reply to
Bobby Joe

oe

These might work. I'm trying to reduce cost and size as much as possible el= se they don't serve much of a purpose. It would be nice to find pots and sw= itches with these integrated in but that's a pipe dream.

I'm not too familiar with the i2c expanders. Do these act like any i2c devi= ce? I assume there is a maximum of 4 bit address space so it limits the nu= mber of devices to 16 without some channel selection? At least glancing ove= r the DS shows 4 bits for address. I'm sure they have larger address spaced= versions?

These might work real well for what I need if I could get 7-bit addresses. = I like the analog versions since that will make it much simpler for pots.

Reply to
Jon Slaughter

That's interesting. Very cool trick if it works well in practice. I suppose one would have to extend any momentary switch long enough to scan the entire bus.

It seems like it might be a very effect way to handle switches. That coupled with Jan's suggestion might work well.

Would be nice to have one of these with an extra A/D pin. I would then get almost exactly what I wanted.

Reply to
Jon Slaughter

On a sunny day (Thu, 8 Mar 2012 09:35:33 -0800 (PST)) it happened Jon Slaughter wrote in :

Well you could use one as the address group select.... :-)

The PCF8574 has indeed only a few sub addresses, so that makes perhaps 32 I/O (would have to look it up). It also has an interrupt output, so with 3 wires you do not have to poll for a switch change. I have used those, but nowadays I would use a PIC, one with many pins. Have it poll, and send some RS232 code if a key changes, or some analog value changes, Here is a small scale PIC version:

formatting link
Maybe the idea is of some help to you. I have put zeners as input protection.

Reply to
Jan Panteltje

With what OTHER constraints? How many switches? How frequently are you wanting to examine their states? How much hardware do you want to associate with each switch?

A DAC is too *slow*? Have you also considered an ADC? I.e., let the switches conditionally implement a network and see how it responds to excitation (of various forms).

Yet, you want no switch's state to mask the states of other switches "beyond it"? I.e., you have to allow for EVERY switch to have changed state on that wire each time you examine the "wire".

If you are willing to put some electronics by each switch, then you should be willing to put that electronics on the PCB "somewhere", right? (it costs you more money to put that something on the switch than on the PCB *by* the switch... unless you want to make your own "switch modules" that could be used in any similar application)

You then need a way of telling the "application" which particular switch this is (i.e., if you put a digital ID in each switch and want them to be interchangeable, you need a "calibration protocol" by which the application can learn that switch #10445 is the "motor on" switch, #99765 is the "motor off" switch, etc.

What happens if a switch gets replaced but the configuration is never updated? You need a human to tell you where the switches are physically connected Though you can automatically deduce *logical* connections if you allow switches to be daisy-chained: "OK, the switch AFTER #56654 identifies itself as #99543. And, the switch after *that* identifies itself as..."

(This could end up being a very brittle implementation)

Now you are adding "cheap" to the criteria? A tiny MCU with upstream and downstream ports that let the *host* tell each switch who it is (at power up). I'd hardly call that "cheap", though.

There are lots of ways you can accomplish this goal but each has tradeoffs -- cost, size, "detect time", etc. Until you quantify those criteria...

Reply to
Don Y

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.