Instructables
Picture of Control Arduino Wirelessly with MATLAB
GEDC0174.JPG
GEDC0176.JPG
GEDC0178.JPG
GEDC0181.JPG
GEDC0182.JPG
Been seeing few DIYs on how to establish a communication between MATLAB application and Arduino that is hardwired to PC. However, I haven't encountered anything that control Arduino via MATLAB wirelessly using the ENC28J60 compatible Ethernet shield. In this ible', I'm going to show the simplest way to control Arduino using MATLAB wirelessly. 

WHAT YOU NEED?

1) Arduino - You need a controller. I used Arduino since it is supported by MATLAB. For this project however I used, Gizduino, a locally made Arduino-based controller.

2) Ethernet Shield - You need a compatible Ethernet shield for your board. I used the ENC28J60 for my board.

3) Wi-Fi Router - To connect your Arduino which would be the means to communicate to your PC wirelessly.

4) LED - Any components to indicate communication between devices. For this project I used LED.

5) Printer Cable - To connect Arduino to your PC.

6) UTP Cable - To connect your Ethernet shield to the router.
 
Remove these adsRemove these ads by Signing Up

Step 1: Connect Ethernet Shield to Arduino

Picture of Connect Ethernet Shield to Arduino
Carefully connect your Ethernet shield to your Arduino. Avoid bending the pins.

Step 2: Connect LED

Connect any components that could indicate communication between devices. In this 'ible I used an LED. Will try to turn LED on and off wirelessly using MATLAB. I've connected my LED's anode (long pin) to Digital I/O pin 6 of the Ethernet shield attached to the Arduino and LED's cathode (short pin) to Ethernet's GND.

Step 3: Connect Arduino to PC

Picture of Connect Arduino to PC
Plug-in the printer cable to your Arduino and connect to PC.

Step 4: Connect Ethernet Shield to Router

Picture of Connect Ethernet Shield to Router
GEDC0190.JPG
Plug-in UTP to your Ethernet shield and any of the LAN ports of your router.

Step 5: Open Arduino IDE

Picture of Open Arduino IDE
Pic 02.jpg
Pic 03.jpg
Pic 04.jpg
I used Arduino 1.0 because of the Ethernet shield library compatibility. After opening Arduino 1.0, download the library and copy paste the content to the library folder of your Arduino 1.0.
JhunDaniel1 month ago

Hello, well this question is not related in this wonderful project. But i would like to ask that does the way you code in arduino is the same as you code in Gizduino.
I make a project and I've coded it in arduino, now i want to do it in gizduino, but when I run it, it would'nt work. Thanks in advance.
BTW nice project.

matlabgui1 year ago
hi, trying to understand code
urlread('http://192.168.0.15/?led=off');
what urlread do? led is name for port where is led diode?
i want tu use gui to communicate with arudino using ethernet communication but i cant find how to send for example how to send number to arduino, or how to accept data back from arduino...thanks in advance for any help ...
Analogue-Chick (author)  matlabgui1 year ago
The "urlread" command in MATLAB is similar to hyperlinking since we created web server address for each of the commands that the ethernet shield, as well as the controller understands. It only means reading the assigned web server (url) address. You can compose any web server address you want, in which case I assigned "?led=off" for off mode and "?led=on" for on mode to make things easier. If you want to send information to Arduino via MATLAB, I think you need to integrate the codes available for ENC28J60 and MATLAB support package for Arduino. I haven't figure out how to do this yet, but I'm sure about the coding it's either purely assigning every tasks to a web server or combining the pde for the ethernet shield and MATLAB support package for Arduino. I'll probably post another 'ible for this when I get my hands on an ENC28J60 unit. Just borrowed the ethernet shield from a friend when I did this 'ible.
rmagtibay1 year ago
nice
Analogue-Chick (author)  rmagtibay1 year ago
Salamat Sir! :)
UOS1 year ago
Well my Ethernet Shield is on its way, and when it comes, I will definitely try this ASAP! Thanks!
Analogue-Chick (author)  UOS1 year ago
Thanks for checking this ´ible out. Hope you get your Ethernet Shield soon. Enjoy! :)