Control Arduino with Windows Remote Arduino: A Comprehensive Guide

Control Arduino with Windows Remote Arduino: A Comprehensive Guide

1. Overview

Many friends have already started playing with Arduino, and they usually use the official Arduino IDE to write programs to control Arduino hardware. To make control more convenient, Microsoft launched Windows Remote Arduino in the Windows IoT program. In simple terms, Windows Remote Arduino is an open-source Windows runtime component that allows us to control Arduino hardware using any of the four connection methods: Bluetooth, USB, WiFi, or Ethernet. Therefore, under the unified platform of Windows 10, we can control Arduino hardware using PCs, tablets, smartphones, and even Raspberry Pi devices running IoT Core. The functionalities provided by Windows Remote Arduino include:

(1) GPIO control (analog and digital)

Digital Write

Digital Read

Analog Write

Analog Read

Setting the pin mode for any pin

Receive events when values change / are reported.

(2) I2C interface communication

(3) Firmata user-defined protocol

2. Setting Up the Host Environment

The devices running Windows, such as PCs, Surface, or Windows Phone, are collectively referred to as host machines. We can use any of the following three methods to set up the host environment:

  • Download the Windows Remote Arduino Experience app from the Microsoft Store

  • Install the NuGet package

  • Manually add the Windows Remote Arduino project files to a new Visual Studio solution.

The difficulty of the above three methods increases sequentially. The first method is suitable for simple usage scenarios, where users can control Arduino devices without writing code by using the downloaded Windows Remote Arduino Experience. The second method is suitable for writing custom UWP applications, where users can control Arduino devices by referencing the Windows Remote Arduino package in their own programs. The third method requires manually adding the Windows Remote Arduino source code project to their own project, providing the maximum freedom for users to customize Windows Remote Arduino according to their needs.

Taking the first method as an example, open the Microsoft Store and directly install the Windows Remote Arduino Experience app on a PC or Mobile. This app is a UWP application.

Control Arduino with Windows Remote Arduino: A Comprehensive Guide

3. Arduino Setup

Windows Remote Arduino is built on the Firmata protocol, so we first need to upload the corresponding code to the Arduino hardware device. When installing the Arduino IDE, StandardFirmata is installed by default. Users can follow these steps to upload the program:

    1. Connect the Arduino device via USB, taking Arduino UNO as an example.

    2. Launch the Arduino IDE

    3. Select the corresponding board type and port number via Tools > Board and Tools > Port.

    4. Open the project via File > Examples > Firmata > StandardFirmata.

    5. Click Upload to upload the StandardFirmata sketch to the Arduino UNO.

If the user only wishes to control the Arduino device via USB, the Arduino setup is complete at this point. If the user wishes to control the Arduino device via Bluetooth, the PC needs to have a Bluetooth module, and the Arduino also needs to be connected to a Bluetooth module. For details, refer to the article “hook up a Bluetooth device to the Arduino.” Additionally, if the user wishes to control the Arduino device via WiFi, the Arduino requires a WiFi Shield. For details, refer to the article “hook up a Wi-Fi device to the Arduino.”

4. PC Operation

Open the Windows Remote Arduino Experience application, select USB as the connection type, and set the rate to 57600. If the Arduino is correctly connected to the PC’s USB port, Arduino Uno (COM*) will be displayed automatically. The user just needs to click Connect to connect to the Arduino device, as shown in the image below:

Control Arduino with Windows Remote Arduino: A Comprehensive Guide

After that, the application interface includes three pages: Digital, Analog, and PWM. Users can click the corresponding page for remote control and data reading. For example, Pin 13 is set to Output Low by default. By clicking, the level can be changed, as shown in the image below.

Control Arduino with Windows Remote Arduino: A Comprehensive Guide

Observe the LED connected to Pin 13 of the Arduino Uno; its status should now be lit, as shown in the image below.

Control Arduino with Windows Remote Arduino: A Comprehensive Guide

5. Using Ethernet Connection

The author has a W5100 Ethernet Shield, so I tried this method. Note that in this method, we need to re-upload the Arduino sketch. The specific steps are as follows:

    1. Log in to Github and download standard-firmata-networking.

    2. Unzip and copy the EthernetStream folder from the lib directory to the local Arduino libraries directory.

    3. Open standard-firmata-ethernet.ino

    4. Plug in the W5100 Ethernet Shield and connect the Arduino Uno to the PC via USB.

    5. Click Upload to upload the sketch.

Once the upload is complete, connect the W5100 Ethernet Shield to the TPLink via an Ethernet cable to check its automatically obtained IP address. Of course, users can also modify the code in standard-firmata-ethernet.ino to set its IP address.

Then, open the Windows Remote Arduino Experience application on the PC or Mobile, select Network as the connection type, and set the rate to 57600. Fill in the IP address obtained by the Arduino, with the default port number being 5000 (which can also be modified in standard-firmata-ethernet.ino).

Control Arduino with Windows Remote Arduino: A Comprehensive Guide

After clicking connect, you can control the Arduino according to the content in section 4 above.

Reference Links:

1. http://ms-iot.github.io/content/en-US/win10/WRA.htm

2. Download the Windows Remote Arduino Experience app from the Microsoft Store

3. Install the NuGet package

4. Manually add the Windows Remote Arduino project files to a new Visual Studio solution

5. hook up a Bluetooth device to the Arduino

6. hook up a Wi-Fi device to the Arduino

7. https://github.com/ms-iot/remote-wiring/

8. https://github.com/ms-iot/remote-wiring/#notes-on-wifi-and-ethernet

Leave a Comment

Your email address will not be published. Required fields are marked *