Close

Windows Remote Arduino

luozhan2022luozhan2022 wrote 11/24/2022 at 02:48 • 11 min read • Like

PCB components or supplies that need to be prepared in advance

Arduino Uno Rev3

The Arduino Uno is a rigid PCB microcontroller board based on the ATmega328P (datasheet). It has 14 digital input/output pins (6 of which can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB connection, a power jack, an ICSP header and a reset button. It includes everything needed to support the microcontroller; just connect it to a computer with a USB cable or power it with an AC-to-DC adapter or battery and you're ready to go. You can tinker with the Uno without worrying about doing something wrong, worst case you can replace the chips for a few bucks and start over.

"Uno," which means "Uno" in Italian, was used to mark the release of Arduino software (IDE) 1.0. The Uno board and Arduino software (IDE) version 1.0 is the reference version of the Arduino and has now evolved to newer versions. The Uno board is the first in a series of USB Arduino boards and is the reference model for the Arduino platform; see the Arduino Board Index for an exhaustive list of current, past, or obsolete boards.

Arduino Uno Rev3

SparkFun Bluetooth PCB Modem - BlueSMiRF Silver

BlueSMiRF Silver is the latest Bluetooth PCB wireless serial cable replacement! This version of the popular BlueSMiRF uses the RN-42 module, which has a somewhat smaller range than the RN-41 module used in BlueSMiRF Gold. These modems are used as serial (RX/TX) pipes. Any serial stream from 2400 to 115200bps is seamlessly passed from your computer to your target.

The remote unit can be powered from 3.3V to 6V for easy battery connection. All signal pins on the remote unit are 3V-6V tolerant. No level translation is required. Do not connect this device directly to a serial port. If you need to connect it to a computer, you will need an RS232 to TTL converter circuit.

MCL053MD

MCL053MD is a 5mm HE red circular LED PCB component with red diffuser lens, through hole mount, round lens, 15mcd luminous intensity, 625nm peak wavelength, 45° viewing angle. This LED light is made with GaAsP on GaP.

14N9416-40.jpg (320×193)

Male/Male Jumper Wires

Manufacturer: ADAFRUIT Manufacturer Part No: 758 Newark Part No.: 88W2570 Technical Datasheet: 758 Datasheet

88W2570-40.jpg (200×200)

RCC120610K0FKEA

MFG_RCC1206.jpg (640×640)

The start of a Windows remote Arduino PCBA project

Program the Arduino

First, let's program the Arduino.

Baud Rate

StandardFirmata communicates with Bluetooth devices using a serial line or via USB. By default it uses a baud rate of 57,600 bps. Depending on the configuration of your Bluetooth device, you may need to modify this rate. It can be found in the setup method and looks like this:

Firmata.begin(57600);

Change the value to the correct baud rate. For USB, this value is configurable in the device and Windows Remote Arduino connection parameters. If you are using a bluetooth PCBA, the baud rate depends on the device you are using.

Hardware Set Up

You can always start with a USB, WiFi or Ethernet connection, but let's cover the simple connection of a Bluetooth PCBA device and LED, we will use the Windows Remote Arduino library to turn the LED on and off via Bluetooth!

power and ground rails

Plug the Bluetooth device onto the rigid PCB

The TX-0 pin is interconnected with the Arduino's RX pin.

The yellow wire is connected to the bluetooth PCB

Establish serial communication between Bluetooth device and Arduino

Add an LED to the rigid PCBA.

330Ω resistor connected to rigid PCB

The anode of the LED is connected to the Arduino

Your FS PCBA setup is now ready! It should look similar to the setup shown in the image below.

FS PCBA

FS PCBA Project Code

Arduino sketching

Install Arduio Firmata Library:

Step 1.PNG (589×298)

Step 2.PNG (838×373)

Go to Sketch Menu/Include Libraries/Manage Libraries and search for "Firmata" and install the latest version of the library.

Now open and upload the "StandardFirmata" example from File/Examples/Firmata/StandardFirmata.

It is done on the Arduino side. Now we will see the application for Windows Universal Platform.

Windows Universal Platform App

Download the example repository here. If you'd rather create your own electronics PCB fabrication project, follow the project setup guide here.

Now that we're all set, let's get into some code!

I set up a project called FS PCBA RemoteBlinky following the steps in the setup guide. In the screenshot below, you'll see the code-behind file, MainPage.xaml.cs, which simply creates a Bluetooth connection object and passes it to the RemoteDevice class in the constructor. You'll see that I specified my device name in this example. You can also enumerate available devices by calling the static .listAvailableDevicesAsync() function on the BluetoothSerial (and USBSerial) class before constructing the object.

project00.png (1012×657)

Notes for USB flex PCBA:

USBSerial has many options for specifying your device. In the constructor, you can provide the device's VID and PID, just the VID, or a DeviceInformation object (obtained from the listAvailableDevicesAsync function above). Likewise, BluetoothSerial allows you to provide a device ID (as a string), a device name (also a string), or a DeviceInformation object.

You can get the VID and PID combination of a USB device by following these steps:

Open Device Manager from Control Panel or by pressing the Windows + Pause keys together and selecting the Device Manager link on the left.

USBSerial usb = new USBSerial( "VID_2341", "PID_0043" ); Guaranteed to work only with the following hardware devices:

vidpid.png (408×455)

Next, I'll add a callback function to the RemoteDevice object's DeviceReady event. This function is automatically called when the Bluetooth Flex PCB device is connected and all necessary settings have been initialized. You'll notice that I haven't implemented anything in that function at this point. Finally, call .begin() on the connection object to tell it to connect.

Flex USB PCBA code considerations:

The parameters of the .begin() function don't matter for bluetooth flex PCBA, but you have to use the same baud rate on Arduino and UsbSerial object (first parameter). Also, the second parameter must be "SerialConfig.8N1". The rest of the example works exactly the same no matter which connection type you use.

project01.png (1003×651)

Jump to the MainPage.xaml file and create a few buttons that turn the LEDs on and off. You'll notice that I've added the button callback to the Click event and set the IsEnabled property to false, FS Tech will explain why below!

project02.png (1017×366)

project04.png (1141×730)

Flex PCBA Build and Deploy! Once connected, your button will be enabled and you can turn the LED on and off at will! Here's a screenshot of this basic example running on Windows Phone 10.

screenshot.png (480×854)

I really hope you enjoy duplicating this project and using it as a baseline for an incredible new set of PCBA projects! You can quickly go from PCB to PCBA with PCB assembly to get it done in no time.

Like

Discussions