Arduino Forum

Using Arduino => Project Guidance => Topic started by: itsviz on Jan 11, 2019, 12:48 pm

Title: 2 computers 1 Arduino
Post by: itsviz on Jan 11, 2019, 12:48 pm
I'm trying to connect an Arduino to 2 computers, the first computer sends information to the Arduino, ie. numbers or strings, and then the Arduino sends input to the second computer using that information

Which Arduino would be best suited for this? And how could I go about doing this?
Title: Re: 2 computers 1 Arduino
Post by: groundFungus on Jan 11, 2019, 01:03 pm
You could use an Uno (or another mega 328 based board), although it has only 1 hardware serial port so one PC could use that and the other would use a software serial port with a TTL to USB adapter (FTDI).  Software serial ports are slow, but if you can live with less than 38400 baud rate that will work. 

A Mega has 4 hardware serial ports so you have high speed on all ports.  Only one port is USB so the TTL to USB adapter would be needed for the other port.

You need an application on each PC to receive and send the serial data.  The IDE serial monitor can e used for very simple stuff.  A terminal program ( TerraTerm (https://ttssh2.osdn.jp/index.html.en),  RealTerm (https://sourceforge.net/projects/realterm/)) can be for more complex stuff like writing and saving files.  Or custom apps that connect with other PC software.

A good primer on serial communication is the serial input basics tutorial (http://forum.arduino.cc/index.php?topic=396450.0).
Title: Re: 2 computers 1 Arduino
Post by: MorganS on Jan 11, 2019, 01:30 pm
An Arduino Micro and an FTDI adapter will do this too.
Title: Re: 2 computers 1 Arduino
Post by: pert on Jan 11, 2019, 02:47 pm
How do you want to connect the computers to the Arduino. People are assuming USB but you might also use WiFi, Ethernet, or Bluetooth. On one or both computers.
Title: Re: 2 computers 1 Arduino
Post by: itsviz on Jan 11, 2019, 08:45 pm
I'd like to use USB for both, but what would be fastest for the transmitting computer?
Title: Re: 2 computers 1 Arduino
Post by: GoForSmoke on Jan 11, 2019, 10:20 pm
One would use a USB to serial cable or adapter on a USB cable. That would be the slower one by far.

With boards a handwidth or so apart I have run software serial at 57600 baud without losing chars. The distance matters.
Title: Re: 2 computers 1 Arduino
Post by: MorganS on Jan 12, 2019, 06:09 pm
I'd like to use USB for both, but what would be fastest for the transmitting computer?
Use an Arduino with a native USB connection.