Best way to connect 2 or more teensy

Status
Not open for further replies.

urbanspaceman

Well-known member
Hi, this week i have thousand of questions...
which is the best way to connect 2 teensy?

i2c? How many teensy ar linkable?
and if i have 2 (or more) boxes each with it's own teensy, what kind of connector it is best to use?

Thanks
 
It probably depends on the details:
  • How many Teensys?
  • How far apart are they going to be?
  • If you have more than 2 Teensys is the communication organized as a single master and multiple slaves, or is it n-to-m connection where any teensy can try to connect to another?
  • How much data is going to be sent?
  • Do you need the data communication channel to check for errors, or will you be doing that in the Teensy?
  • Wired vs. radio vs. communication via light?

I2c should work well if the distances are fairly short, and you have one Teensy as the master and the other as slaves. Here you would typically use standard 0.1" male/female connectors, or just solder the wires directly. You need one setup of pull-ups on the i2c bus between each of SDA/SCL and the 3.3v bus.

RS-485 (now TIA-485) is the general goto for wired signalling over a distance. You would hook up a serial line that includes RTS/CTS support to the RS-485 and hook up the other RS-485's in term. Often times you would use cat5/cat5e/cat6 'ethernet' cables to connect the devices. Here is one (I haven't used it): https://www.sparkfun.com/products/10124.

I believe RS-422 is also useful, but it is only point to point.

There are various radio technologies. Many of them provide connection with a serial port (often with RTS/CTS). Since it is radio, you don't need to connect each Teensy to each other, but you do have to worry about signals getting through, and filtering out unwanted transmissions. With radio, you need to pay attention to what frequencies are available where you live. Adafruit recently has put out a bunch of LORA radio units, particularly with their feather systems (you can get a Teensy to Feather adapter to use the feather wings): https://www.adafruit.com/products/3231

Onehorse has a nRF24L01+ radio board that solders directly onto the Teensy: https://www.tindie.com/products/onehorse/nrf24l01-add-on-for-teensy-31/

You could have each Teensy have an ethernet connection, and use standard ethernet software. Unless you really need to have the units on the internet, this is probably overkill. Ditto for wi-fi connections.

You could have one Teensy communicate to another using a LED and a light receiver on the other side, possibly using a fiber optic cable to connect the two Teensys.

I imagine you could also generate sound in one Teensy and have a recognizer in the other, but that is probably not as useful.
 
Last edited:
the idea is
teensy as controller -> teensy sound-generator

or 2 teensy -> controller to 1 teensy sound generator

etc...

distance is not a problem, every teensy is close to performer

every box (one teensy for each box) may be equipped with 2 female 3.5 mono jack
to connect in this way

first box out -> in second box
second box out -> in third box.. etc...

i have to power all the box...
maybe if i use a connector with 4 wire?
2 for i2c and 2 for power?

is possible?
 
You should be able to use a 4 wire connection (such as the stereo 3.5mm with 4 connections). Alternatively, the 6 pin phono jack or 8 pin RJ45 connections might be useful. You do need to make sure there is enough power for all of the devices. It may be better to have a 5 wire connection (3.3v, ground, VIN, SDA, SCL), where VIN is either 5v from USB or 3.7v from Lipo.
 
Last edited:
Or maybe you could hack USB cables to keep the USB power to power your Teensies and use UDB D+ and D- for your data ?
 
Or maybe you could hack USB cables to keep the USB power to power your Teensies and use UDB D+ and D- for your data ?

That may be problematical, in that people would expect a USB cable to be a USB cable (and you wouldn't want to use the standard USB connection, but provide a separate one). If you had a Teensy 3.6 with its separate USB host controller, you could hook the secondary Teensy up with standard USB cables.

You can get JST or similar connectors to simplify plugging and unplugging the Teensys. Here is a 5 pin variant that Adafruit sells: https://www.adafruit.com/products/1664. My experience is that you typically also want to think about strain relief when you have cables coming out, particularly with locking cables. Cables like the 3.5mm audio connectors that pull out without locking, can be useful when something happens and the Teensy ends dangling by the cable.
 
If going with the four way audio jacks, be careful of the pin order since things will short in various orders as things plug/unplug. Suggestion is:
Tip - 5V
rings - data/clock
base - gnd

With the power supply being the socket and the user being the projecting plug

If all goes well you can pull this without anything really horrible happening since the 5V can only every touch the intended 5V pin, but it's not impossible for the tip to bridge adjacent points as it moves, dumping 5V into your data pins etc. A 100 ohm series resister on the data pins will make things more robust (and as free bonus reduce ESD risk), but will also reduce your signal integrity.
 
Status
Not open for further replies.
Back
Top