Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

share|improve this question
You might be interested in this Tech Conference talk: (I haven't watched it, but I remembered seeing the title the other day). – Szabolcs Dec 5 '12 at 0:20
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. – Jagra Dec 5 '12 at 1:21
Dear @s0rce, thanks for the links! Navigating through the different links found a potential solution to the serial port issue with 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. – Zviovich Dec 5 '12 at 4:22
@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. – Zviovich Dec 5 '12 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.

share|improve this answer

I was finally able to connect to the serial port by using the package SerialIO created by Rob Raguet-Schofield found here 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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