Here, we use a Raspberry Pi 3 Model B+ to make an Arduino Uno blink an LED! We’ll cut this up into two parts: how to install the Arduino IDE and how to use the IDE on the Raspberry Pi. While it’s possible to program the Arduino through Platformio, doing it this way should be much simpler for someone new.

Why You Want to Use a Raspberry Pi to Program Arduino

Typically, you would want to do it because: But there’s more to it than that. In fact, there’s a good tradeoff between using a standalone PC and using your Raspberry Pi! Pros Cons As it is, the Raspberry Pi is good enough if you’re making a quick, do-it-in-a-weekend IoT project. Just plug in your sensors, peripherals, and Arduino, then type in your code to see it work along with the rest of your system. But if you’re still in the “have to figure out how this circuit works” stage, then please use a proper desktop PC. It’s gonna help with the headaches.

The Things You’ll Need

Installing the Arduino IDE

Programming with the Arduino IDE

The code makes the LED turn on and print “LED on” on the Serial Monitor for 0.5 seconds, then does the opposite, turning the LED off and printing “LED off” for the same amount of time.

Arduino Etiquette

With that done, you should be able to start making anything with the Raspberry Pi and Arduino. To backtrack a bit, if you’re going to do this often, you need to learn a bit about making things easier with the Arduino. Always remember the phrase: pins off, code up, power out.

Pins Off

Let’s start by taking all the wires off the pins. If you take along time on a new project, chances are you mat have already forgotten your pin designations. You might, for instance, wire up an output pin on “HIGH” together with another output pin on “LOW.” That’s one easy way to break a GPIO pin on a microcontroller chip!

Code Up

Code up is simple: upload your code. Always keep in mind that the Arduino is always powered up while it’s connected to the USB port.

Power Out

Lastly, when you’re going to update your circuits, always turn off the power by removing the Arduino from all power sources. The last thing you’d want to happen is putting the wrong wire in the wrong place at the worst moment to make smoke pop out of whatever you’re doing. Remember, short circuits can ruin your project instantly.