Forums

Many switches, single line

Started by Bobby Joe March 8, 2012
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
On 8.3.12 3:17 , Bobby Joe wrote:
> 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
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
On a sunny day (Thu, 8 Mar 2012 05:17:49 -0800 (PST)) it happened Bobby Joe
<bobbyjoe23928@gmail.com> wrote in
<91473db2-3dbe-43b7-b975-8e36ed6dfd6c@o16g2000yqg.googlegroups.com>:

>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
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.
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.

http://search.digikey.com/us/en/products/DS2401%2B/DS2401%2B-ND/956992
On Thursday, March 8, 2012 7:36:37 AM UTC-6, Tauno Voipio wrote:
> On 8.3.12 3:17 , Bobby Joe wrote: > > 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 > > 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). >
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.
On Thursday, March 8, 2012 7:55:55 AM UTC-6, Jan Panteltje wrote:
> On a sunny day (Thu, 8 Mar 2012 05:17:49 -0800 (PST)) it happened Bobby J=
oe
> <bobbyjoe23928@gmail.com> wrote in > <91473db2-3dbe-43b7-b975-8e36ed6dfd6c@o16g2000yqg.googlegroups.com>: >=20 > >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 >=20 > 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.
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.
On Thursday, March 8, 2012 8:17:43 AM UTC-6, DJ Delorie wrote:
> 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. > > http://search.digikey.com/us/en/products/DS2401%2B/DS2401%2B-ND/956992
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.
On a sunny day (Thu, 8 Mar 2012 09:35:33 -0800 (PST)) it happened Jon
Slaughter <Jon.Slaughter@gmail.com> wrote in
<6540006.1465.1331228133683.JavaMail.geo-discussion-forums@ynlw24>:

>On Thursday, March 8, 2012 7:55:55 AM UTC-6, Jan Panteltje wrote: >> On a sunny day (Thu, 8 Mar 2012 05:17:49 -0800 (PST)) it happened Bobby J= >oe >> <bobbyjoe23928@gmail.com> wrote in >> <91473db2-3dbe-43b7-b975-8e36ed6dfd6c@o16g2000yqg.googlegroups.com>: >> >> >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 >> >> 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. > > >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?
Well you could use one as the address group select.... :-)
>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.
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: http://pantelte.com/panteltje/pic/io_pic/ Maybe the idea is of some help to you. I have put zeners as input protection.
On 2012-03-08, Bobby Joe <bobbyjoe23928@gmail.com> wrote:

> Are there cheap SPST switches that have built in single wire comm. > that can all be hooked up serially?
no.
> 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.
If you will allow 4 wires can you can do it with parallel-in serieal-out shift registers. common 8-bit parts like MC14014 can convert your switches in groups of upto 8, and you can chain as many groups as you want. send a load pulse and then send clock pulses until the state of each switch has been expressed. -- &#9858;&#9859; 100% natural --- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---
On 3/8/2012 6:17 AM, Bobby Joe wrote:
> 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?
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?
> 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.
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).
> 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.
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".
> 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.
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)
> 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
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... <shrug>