The Arduino service is used to communicate and control the very popular Arduino micro-controller. MyRobotLab runs on a computer and controls the Arduin hardware through a serial port.

The Arduino needs to be loaded with an Arduino sketch called MRLComm. The latest can be found at the end of this page.

This sketch allows commands from MyRobotLab to be processed on the Arduino hardare, it also allows the Arduino the capability to send data back to MyRobotLab (MRL).

This sketch only has to be loaded once on the Arduino.  The only time it would need to be re-loaded is when it needs to be updated.  After you load the Arduino sketch you may connect (MRL) with the Arduino through the appropriate communication port.  If the Arduino sketch is up to date, you'll see a message after connecting (goodtimes)

<<picture goodtimes>>

If your Arduino sketch it out of date it should say which version it is expecting.  

<<picture out of sync>>

Simply, load the latest MRLComm sketch to fix.

Once MRL is connected to the Arduino, it allows all the many other Services to interact with the Arduino.

  • You can use Arduino as a simple type of oscilliscope
  • You can use Python to effectively program the Arduino, turn on off or read pin values, interact with sensors, control servos, etc.
  • MRL can control and communicate with many Arduinos, there is no limit
  • MRL can be used to communicate between Arduinos
  • With MRL's WebGUI service you can very quickly and easily setup a web interface for an Arduino.
  • With MRL's Sphinx service you can control and Arduino with speech recognition.

<<video demostration>>

<<TODO - hyperlink all oher services>>

<<sketch at bottom>>

<<library at bottom>>

Additonally if you are experienced with Arduino or interested in integrating rather than replacing one of your sketches with MRL, you can use the MRLComm library.  

<<how to load mrcomm library link>>

The GUI view to this service has two sub panels.  It has a Pins Panel, and an Oscope.  


You should be at least somewhat familiar with Arduino setup and programming.  See the Arduino website for more information. The Arduino must be connected to your computer when MyRobotLab starts.

In the MRL tab, start the arduino service by right clicking it and selecting start.  Name it anything you like.  Open the Arduino service tab by clicking it.

Editor Menu Bar:

Editor Icon Bar:

Sub Panels:




#file : toSort/ edit raw
# getting analog input back from arduino into Python

arduino = Runtime.createAndStart("arduino","Arduino")

readAnalogPin = 1
readDigitalPin = 7

# make friendly sample rate
# arduino.setSampleRate(8000)

# add call back route
arduino.addListener("publishPin", "python", "publishPin")

# my call-back
def publishPin(pin):
  print, pin.value, pin.type, pin.source

# get data from analog pin for 5 seconds

# get data from digital pin for 5 seconds



#file : service/ edit raw
# Connects a serial device on Windows this would COMx 
# You will need MRLComm.ino loaded on the Arduino
from time import sleep
from org.myrobotlab.service import Arduino

# create an Arduino service named arduino
arduino = Runtime.createAndStart("arduino","Arduino")

#you have to replace COMX with your arduino serial port number
# arduino.connect("/dev/ttyUSB0") - Linux way

# give it a second for the serial device to get ready

# update the gui with configuration changes

# set the pinMode of pin 8 to output (you can change the pin number if you want)
arduino.pinMode(8, Arduino.OUTPUT)

# turn pin 8 on and off 10 times
for x in range(0, 10):
	sleep(1) # sleep a second
	sleep(1) # sleep a second

# analog input pins - you can see input
# on the oscope 
# pin # = 13 + analog pin#  
# (in this case pin 16 is analog pin 3)
sleep(2) # read the analog value of pin 3 for 2 seconds
arduino.arduino.disablePin(16) # stop polling

eziovn123's picture

How can I control a servo

How can I control a servo through analog pins ?