Community
cancel
Showing results for 
Search instead for 
Did you mean: 
KPerr1
Novice
1,772 Views

How to make arduino uno board and intel edison communicate using node.js?

Hey guys, how do i make each other communicate using node.js ?

pls guys....

0 Kudos
8 Replies
idata
Community Manager
85 Views

Hi KatFred97,

 

 

You can communicate your devices (Arduino and Edison) in different ways like UART or SPI or I2C. It depends how you want to connect your devices. For any of these protocols you need the mraa library to make the communication works.

 

 

The repository of this library is: https://github.com/intel-iot-devkit/mraa. There is a lot of information about this library and you can use it with node.js. If you do not know how to use it in your code, the repository has a section of examples especially for node.js so you can check the examples and use them for your code.

 

 

I hope this would be helpful for you.

 

 

Regards,

 

-Leonardo
KPerr1
Novice
85 Views

Hey Leonardo,

I want it to be connected pin to pin. eg, intel edison tx - arduino ide board rx but how do it and what should i do next?

idata
Community Manager
85 Views

First you should be aware of the different voltage levels!

An arduino normally uses 5 V and the Intel Edison is 3,3 V if you are using an Arduino breakout, the module voltage is 1,8 V

So you need a level shifter.

For UART communication you connect TX -> RX and RX -> TX (the level shifter is in between)

For the software part you can use mraa or serialport

Flo1991

KPerr1
Novice
85 Views

Hye Flo1991,

For the software part, how do i use it? Is there anything that I need to add or edit to the software? If I want to run it, should I run using terminal in node js? Do i need to do anything to the arduino side like insert the serialport code Etc. It'd be better if you could provide me with pictures. Pls guide me on this, Im really clueless about this. Thanks.

KatyFred97

idata
Community Manager
85 Views

There are many guides on the web, some are:

http://arduinobasics.blogspot.de/2012/07/arduino-basics-simple-arduino-serial.html Arduino Basics: Simple Arduino Serial Communication

https://software.intel.com/en-us/node-js-templates-for-intel-xdk IoT - Node.js* templates for the Intel® XDK | Intel® Software

The Intel XDK provides everything for devolping code in node.js

Flo1991

KPerr1
Novice
85 Views

Hey Leonardo,

I want it to be connected pin to pin. eg, intel edison tx - arduino ide board rx but how do it and what should i do next?

idata
Community Manager
85 Views

Hi KatFred97,

 

 

If you want to connect your devices (Intel Edison and Arduino Uno) using UART, you have to connect Edison's RX to Arduino's TX and TX to RX just like Flo1991 said. About the voltage levels it depends of the boards that you are using, the GPIOs specifications of each board are:

 

 

- Intel Edison compute module with or without the breakout board: GPIOs output and input voltage are 1.8 V. (The information is in the Hardware guide: http://www.intel.com/content/www/us/en/support/boards-and-kits/000005808.html, Section 4.7.2).

 

 

- Edison Kit for Arduino you can select the voltage level, it can be 3.3 V or 5 V I/O, you can look the next hardware guide: http://www.intel.com/content/www/us/en/support/boards-and-kits/000005583.html?wapkw=edison+compute+m....

 

 

- In the case of Arduino Uno the voltage level of the GPIOs is 5 V I/O, so it depends of the Edison board that you own if you have to use a level shifter.

 

 

About the software you can look the guides that Flo1991 provided, they are very helpful on both devices (Edison and Arduino). You also can look the example code in the repository that I give on the first reply, there is a code for the UART communication.

 

 

I hope this information helps you, and if you need more information about the software let us know.

 

 

Regards,

 

-Leonardo
idata
Community Manager
85 Views

Hi KatFred97,

 

 

Did the information help you? Did you successfully communicate your devices?

 

 

Remember that we are here to help, just let us know.

 

 

Regards,

 

-Leonardo
Reply