I have a requirement for my project, I have to connect multiple laptops to single Arduino. If any laptop gives the signal the Arduino has to perform the respective operation. How can I achieve this?
A reasonably simple solution would be to connect each PC to its own Arduino and have those Arduinos communicate with the master Arduino by wireless - such as nRF24L01+ modules which are cheap and reliable.
PS ... I wrote the above while you were writing the previous Reply. IMHO this is a situation where a wireless solution should be simpler.
However if you really do want a wired solution and if you have a USB-TTL converter for each PC then with a few diodes and a resistor you could connect the TTL Rx and Tx signals of all all of them to a single serial port on the Arduino. The problem, however, is to regulate things so only one PC can talk at any one time.
dileepkantapop:
Can we use USB hub, Multiple laptops are connected using USB hub then USB hub is connected to Arduino. I tried this but it's not working.
Robin2:
A reasonably simple solution would be to connect each PC to its own Arduino and have those Arduinos communicate with the master Arduino by wireless - such as nRF24L01+ modules which are cheap and reliable.
PS ... I wrote the above while you were writing the previous Reply. IMHO this is a situation where a wireless solution should be simpler.
However if you really do want a wired solution and if you have a USB-TTL converter for each PC then with a few diodes and a resistor you could connect the TTL Rx and Tx signals of all all of them to a single serial port on the Arduino. The problem, however, is to regulate things so only one PC can talk at any one time.
...R
dileepkantapop:
Hi UKHeliBob,
I need to connect 6 laptops minimum to single Arduino.
If it is indeed 6 laptops that you are going to communicate with, then I would take up Robin2 advice as you can "easily" create 6 pipes to connect/communicate each PC to the arduino.
sherzaad:
If it is indeed 6 laptops that you are going to communicate with, then I would take up Robin2 advice as you can "easily" create 6 pipes to connect/communicate each PC to the arduino.
If you study my examples you will see that there is no need to use multiple pipes and also the fact that there are 6 pipes does not limit you to communicating with 6 other nRF24s. Also note that an nRF24 has only a single wireless so it can only receive message at a time - but messages are very quick.
Computers have an A-type connector; the other side of the cable that fits in there is a (variation of a) B-type. That only fits in one port in the hub.
You must have a very special hub (or it isn't a hub) or hacked your own cables (A-type to A-type) to be able to connect multiple PCs to one hub.
If you want to use USB, for each computer, you will need a USB to I2C module. You will then need to put all the I2C on the I2C bus and use the I2C library.