Connecting 10+ teensys to read 140+ sensors

Status
Not open for further replies.

torin

Member
Hello,

I have some noob questions about using multiple teensys with a single computer. I am working on a project idea that would require 140+ capacitive touch sensors (in the form of large copper pipes) being read in realtime with the need for musical response times (less than 8ms delay when triggered). I've done similar projects before, but never at such a large scale. Any ideas if this would at all be possible? Ideally I would like to use many teensys using the touchRead pins (so 9 sensors per board). I just have no clue about using so many teensys together connected to a single computer. The installation would also be quite large, so any insights on sending data over long distances would be much appreciated. I know usb requires powered hubs over longer intervals of distance, and if that could be avoided that would be awesome.

Thanks for any help at all!

Torin
 
I'd suggest a RS485-based communications network. Ideally full duplex using CAT5 wiring (cheap, twisted, and easy to get pre-confectioned).

Use Easytransfer to send a single uint16_t that captures all the possible states of the sensors (i.e. on/off) using a shift+add approach, i.e. for example

uint16_t x =0;
for (uint8_t i=0;i<9;i++) if (Channel=true) x+=1<<i;

Thus Channel 0='on' adds 1, Channel 1 being on adds 2, Channel 2 being on adds 4, etc. to the uint16_t. That way you pass all the info with a minimum of bus traffic. The master unit can then ping each slave periodically and poke them into sending the latest 'on/off' state. Ring around the rosy on the bus to hit each slave. Since you are using a uint16, you can embed the address of the slave unit into that number too. Just use some of the upper 'free' bits for that.

That way, the master can shoot off requests onto the bus that the slaves are listening too and then parse the responses as they come in. Key here will be to keep all the slave response times to be somewhat similar so they don't end up stomping on each others transmissions. Pauls transmit enable pin functionality is particularly useful on a full-duplex bus, so use it. For extra credit and stomp-proofing, you could even use a 2/2 RS485 chip and use a channel to enable RTS/CTS. That way, none of the slaves would ever interfere with each other.

The remaining wire pair can then be used to establish a common ground for all the RS485 units.
 
Last edited:
Status
Not open for further replies.
Back
Top