I'm attempting to see if I can capture an incoming stream of data being transmitted remotely from an arduino device into Mathematica.

The plan is to connect some temperature probes to the Arduino, connect it to a Kamado Grill (i.e. Big Gren Egg). The Arduino has an XBEE modem that will be coupled via WiFi to my computer. By reading the temperature profile and output that will control the air intake I'll hope to play around with the control systems functionality of Mathematica, plot temperature profile of the grill/smoker and meat in real time, communicate back to the grill and change target temperature, all from the comfort of the living room.

In the picture below I have tested the connection between the Arduino and the computer and have succeeded in reading the data flow via a terminal connected 19200,N,8,1. Im reading in this case the distance read from an ultrasonic sensor, which is being transmitted back to the computer every 5 seconds.

What is the best way to capture the data stream? Is there a specific existing function to use?

XBEE Modem

  • 2
  • 3
    $\begingroup$ You might be interested in this Tech Conference talk: youtube.com/watch?v=W3P5JF4whgA (I haven't watched it, but I remembered seeing the title the other day). $\endgroup$
    – Szabolcs
    Dec 5, 2012 at 0:20
  • $\begingroup$ I've had some thoughts along similar lines for using Arudino for EEG readings. I'd love to hear what you work out on this. $\endgroup$
    – Jagra
    Dec 5, 2012 at 1:21
  • 1
    $\begingroup$ Dear @s0rce, thanks for the links! Navigating through the different links found a potential solution to the serial port issue with library.wolfram.com/infocenter/Demos/5726 but Im having issues with the MacOSx and/or Mathematica 9. The Link is not successful (keeps running and never finishes loading). I'll try tomorrow with Win XP and MMA 9 and MacOSx with MMA 8 to see if I can make it work. $\endgroup$
    – Zviovich
    Dec 5, 2012 at 4:22
  • $\begingroup$ @Szabolcs, fantastic video! I could make it work that way. Have several arduino boards so I can use one as the remote by the Smoker, and connect the other one as a bridge to the PC. The ArduinoLink' package that Wolfram's son uses to connect the arduino does not seem to be available yet. $\endgroup$
    – Zviovich
    Dec 5, 2012 at 4:30

2 Answers 2


Mathematica 10 has support for a serial device which greatly simplifies things. I am capturing byte data from an XBEE on a usb card being sent from an arduino with an XBEE transmitter. In Mathematica the only commands needed to plot 200 points on a Mac are...

port = "/dev/tty.usbserial-DA00X00E"
dev = DeviceOpen["Serial", {port, "BaudRate" -> 9600}]
out = DeviceReadList[dev, 200]

This technique can be used for any serial input. The SerialIO package worked fine but now things are much easier.


I was finally able to connect to the serial port by using the package SerialIO created by Rob Raguet-Schofield found here http://library.wolfram.com/infocenter/Demos/5726/ and then following the instructions and testing the Arduino program that William Turkel posted in his blog.


Hope to see the package ArduinoLink being developed by Keshav Saharia being released soon.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.