Disclaimer: This post is not a paid promotion and is not intended to influence the choice of one programming language over another. The intent is solely to add value to the engineering and maker community by sharing author’s personal understanding and practical experience with these tools.
In the IoT world, Python is often the “default” for hobbyists. However, if you are coming from a scientific background, you want a language that handles math natively and fast. Julia gives you the “ease of Python” with the “speed of C,” making it the perfect brain for an IoT system that might eventually need to do more than just toggle a light like running a predictive model or a custom forecasting algorithm.
Before we dive in, let’s address the elephant in the room: Possibilities of Julia’s Interaction with Arduino
For serious development, installing Julia in a way that is accessible globally from your terminal is key. if you have access to the Microsoft Store, you can install Julia by running the following in the command prompt.
winget install --name Julia --id 9NJNWW8PVKMN -e -s msstorerefer https://julialang.org/downloads/ for more installation instructions.
Exploring the Two Faces of Julia
Once installed, you’ll primarily interact with Julia in two ways:
Non-interactive Mode: Executing pre-written scripts (e.g.,
julia my_script.jl). This is what we use for automated data logging or running background IoT tasks.Interactive Mode REPL: The Read-Eval-Print Loop. This is the “sandbox” where you can test snippets of code in real-time.
Equipping Julia for Hardware: The SerialPorts Package
By default, Julia is a master of math but doesn’t “know” how to talk to a USB port. To bridge this, we need to install specific packages using Julia’s built-in package manager (Pkg).
The Workflow:
Enter the REPL: Type
juliain your terminal.Switch to Pkg Mode: Press the
]key. You’ll notice the prompt changes fromjulia>to(@v1.12) pkg>. *note while preparing the blog Julia version is 1.12Install the Bridge: Use the following command to install the necessary serial communication tools:
add LibSerialPorts
Note: In older versions of Julia, SerialPort is preferred for hardware interaction, but the installation process remains identical.
What’s Next ?
Stay tuned for Bridging the Physical and Digital: Building an Arduino-Powered Keypad Interface with a Julia Web Dashboard.
