# Arduino interfacing with Mathematica

**URL:** <https://community.wolfram.com/t/arduino-interfacing-with-mathematica/9199>\
**Category:** Questions\
**Tags:** engineering, mathematica, external-interfaces, interface-construction, connected-devices\
**Created:** [September 3, 2016, 6:56pm UTC](https://community.wolfram.com/t/arduino-interfacing-with-mathematica/9199 "2016-09-03T18:56:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnson](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/johnson/32/35641_2.png) [@johnson](https://community.wolfram.com/u/johnson)\
**Post date:** [September 3, 2016, 6:56pm UTC](https://community.wolfram.com/t/arduino-interfacing-with-mathematica/9199/1 "2016-09-03T18:56:30Z")

</div>

I am using Mathematica 10 and trying to interface Arduino Uno for some data acquisition application. i am getting the device opened with DeviceOpen command. But **DeviceConfigure** not executed well to do some thing with arduino board. I am using Windows 8.1 Operating system. Can anybody help me ?

---

<div class="post-metadata">

**Author:** ![ijohnson](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/ijohnson/32/21468_2.png) [@ijohnson](https://community.wolfram.com/u/ijohnson)\
**Post date:** [September 5, 2016, 11:12pm UTC](https://community.wolfram.com/t/arduino-interfacing-with-mathematica/9199/2 "2016-09-05T23:12:32Z")

</div>

Hi Johnson,

What version of Mathematica are you using? And what code is specifically failing?

I will try and help you, but I need more information about the problem you are experiencing.

Thanks,

Ian

---

<div class="post-metadata">

**Author:** ![johnson](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/johnson/32/35641_2.png) [@johnson](https://community.wolfram.com/u/johnson)\
**Post date:** [September 6, 2016, 12:42pm UTC](https://community.wolfram.com/t/arduino-interfacing-with-mathematica/9199/3 "2016-09-06T12:42:31Z")

</div>

Hi Ian,  
I was about to acknowledge your help through the details posted in your blog regarding Arduino Interface with mathematica. I could able to interface Arduino UNo with Mathematica 10.0.2. Thanks.  
I need one more information regarding the reference voltage adjustment during analog input measurement. Can I set the reference voltage to 1.1V internally by Mathematica commands?

---

<div class="post-metadata">

**Author:** ![ijohnson](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/ijohnson/32/21468_2.png) [@ijohnson](https://community.wolfram.com/u/ijohnson)\
**Post date:** [September 6, 2016, 2:56pm UTC](https://community.wolfram.com/t/arduino-interfacing-with-mathematica/9199/4 "2016-09-06T14:56:35Z")

</div>

So you are using 10.0.02? If this is the case, then you will not have access to the built-in Mathematica device driver, but you can manually modify the sketch I attached to that blog post to include this line in the `setup()` function:

```
analogReference(INTERNAL);

```

in the sketch you upload through the Arduino IDE.

Alternatively, if you are using Mathematica 10.4 or higher, you can use a “BootFunction” to set the analog reference like this:

```
DeviceConfigure["Arduino","Upload"->"BootFunction"-><|"Code"->"void setAnalogRef() { analogReference(INTERNAL); }"|>]

```

This function will be called as soon as the Arduino turns on (as if it was called from the `setup()` function), to set the analog reference to the internal 1.1 volt reference.

Hope this helps you with your application.

Ian
