Interconnect two teensy boards that are hid devices connected to two different PC

Status
Not open for further replies.

mydyingbride

New member
Hi all. I am a preety stupid with electrical stuff, so want to ask help here.
So, I am trying to make hardware keyboard and mouse emulator. I want to make one teendy boart to be a mouse+keyboard device on one PC and another teensy board to be a reciver(using HID RAW device) on another PC(so, one PC will retrieve mouse movements and key press from PC and send them to another teensy board).
I need to connect one teensy to another, I guess serial connection will be okay, but they will have different power sources. How to properly connect them? Is it enough to connect teensys GND (e.g. one power source GND will be connected to another power source GND) and after that connect serial pins? Or I need some resistors or whatever on pins to avoid board damage when one board is powered and sending signals, and other board is off?

Thanks in advance :)
 
The easiest way out there is to use a diode (so only the LOW signal passes through the receiving Teensy, the cathode facing the transmitting side) and a pullup resistor powered by the receiving Teensy to restore the HIGH signal.

When the receiving end is not powered while the transmitting end is sending signals, the RX pin will only receive LOW or OPEN (HI-Z) signals.

The GND of the two Teensys should also be connected.

I'll recommend using 1N4148 diode and 1KΩ resistor because they are cheap, very common, and suitable for your application.
 
The easiest way out there is to use a diode (so only the LOW signal passes through the receiving Teensy, the cathode facing the transmitting side) and a pullup resistor powered by the receiving Teensy to restore the HIGH signal.

When the receiving end is not powered while the transmitting end is sending signals, the RX pin will only receive LOW or OPEN (HI-Z) signals.

The GND of the two Teensys should also be connected.

I'll recommend using 1N4148 diode and 1KΩ resistor because they are cheap, very common, and suitable for your application.

Sorry for bad image:

scheme.jpeg

So, cheme will looks like this?

btw, thanks a lot for reply :)
 
I've broken so many things myself that I'm getting careful nowadays. In your case, I worry about ground loops.

I myself would use a pair of optocouplers instead. Perhaps two 6N136s. Depending on the type of optocouplers you use, you may need to invert the RX/TX signals. (Teensy LC and 3.x can invert the signal in hardware; see Teensyduino Serial documentation and particularly the SERIAL_xxx_RXINV_TXINV constants.)

If you want really high baud rates, I'd use hardware flow control (RTS and CTS in addition to RX and TX), and two optocoupler pairs, perhaps two ILD213T's.

If you prefer to use ready-made break-out boards, I'd use two Sparkfun BOB-09118s, which have transistors to correct the logic. (That is, although ILD213T inverts the logic, the break-out board has a transistor for each signal to invert it right back.) If the teensies are A and B, then one break-out board would be used for A's RX and RTS, powered by A; the other would be used for A's TX and CTS, powered by B.
 
If you only need to send data in 1 direction, the standard MIDI circuit might work well. Or built 2 if you need to communicate both ways. MIDI known to work well over ~25 feet distance and has excellent documentation on many sites. The receiver uses an optocoupler. There's no need to send actually MIDI messages. Any normal serial communication can work.
 
Status
Not open for further replies.
Back
Top