Go Down

Topic: 2 computers 1 Arduino (Read 502 times) previous topic - next topic


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?


Jan 11, 2019, 01:03 pm Last Edit: Jan 11, 2019, 01:13 pm by groundFungus
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, 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.
You will save everyone's time if you read and follow the forum guidelines.  :)          


An Arduino Micro and an FTDI adapter will do this too.
"The problem is in the code you didn't post."


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.


I'd like to use USB for both, but what would be fastest for the transmitting computer?


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.
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.


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.
"The problem is in the code you didn't post."

Go Up