Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
4 years, 1 month ago.
Can anyone suggest the best way to establish communication between an arduino and a mbed?distance5m
I have already tried the serial communication between them at a little distance, but I heard that with a long distance we have to use a RS485. So would I have to buy two shields RS485? one to use in the arduino and another to use in mbed LPC1768? I just want to send some words between them. Speed is not a priority. Would wireless communication be better? and cheaper?
4 years, 1 month ago.
Hi Rayan. To best answer your question, you will need to define your environment. The distance of 5m is not that far away but is there a possibility of a ground difference between the 2 connected pieces of equipment ? Electrical noise from perhaps motors ? Inductive surges ? If yes, then consider the thought of offering isolation between the 2 pieces of equipment.
RS485 is a very popular method of using copper wiring to connect equipment and the differential signals of RS485 provide for a robust transfer of data. Varying with the number of nodes you have in the end project and speed, you could have up to 4000 ft wiring with RS485 compliant transceivers. Factors like termination network, the impedance of each RS485 transceiver will ultimately limit your wiring length. The short answer is that yes RS485 is a lower cost, easily to manage method of connecting the 2 boards. You can use $1-$3 USD RS485 transceivers (ie. Intersil, Maxim, Linear are good products to consider). If your budget allows for it, consider to use isolated RS485 modules which will then remove the issue of ground differences out of this equation. Isolation is used for factory automation where there are long lengths of wiring between the RS485 master and the external RS485 nodes. Other methods to consider are optical isolation such as fiber modules - there are some $10-$20 USD modules from Avago that work like your serial interface transceivers. Simply, power them up and feed data or receive data @ 3v3 swing. However, the modules and then the interconnect fiber will be more costly but they do exist AND will offer isolation. Then there is wireless which will do the same but the frequency / frequencies of the wireless solution must be considered. The popular ESP8266 modules may be a good choice but we have not yet started to experiment with these new versions of modules. You can source these for under $10 USD everywhere and are stand alone WIFI modules that talk via 3v3 serial interface. You can source the same modules for about $2 USD on Aliexpress out of China.
You should be able to use 2 of the above WIFI modules (point to point) and communicate over the air between the 2 boards.