You can control an Arduino connected to Windows 10 via a USB cable with PowerShell.

Windows 10 provides automatic detection and loading of drivers for Arduino devices. By using a .Net library called Solid.Arduino ( ) we can control the Arduino IO pins from our script.

Your Arduino should have the StandardFirmata sketch installed (see blog posting )

You can download a pre-compiled copy of Solid.Arduino from

Start PowerShell_ISE.exe and paste in the following code. Update the path to Solid.Arduino to match your location.

You can change the $LEDs array to specify the pins that you have connected LED’s to.

add-type -path ‘C:\Users\imorrish\OneDrive\PowerShell\GPIO\Solid.Arduino.dll’

$connection = New-Object Solid.Arduino.SerialConnection(“COM4”,Solid.Arduino.SerialBaudRate]::Bps_57600)

$session New-Object  Solid.Arduino.ArduinoSession($connection,2000)

Start-Sleep -Seconds 1


#Turn on LED’s one by one

$sleepTime 2

[Int[]]$LEDs = 10,11,12,13

ForEach ($led in $LEDs){


 Start-Sleep $sleepTime




One thought on “Control Arduino GPIO with Windows PowerShell Script

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s