As you might know Arduino is a great platform for tinkering , making and hacking parallel to or with a Raspberry Pi. As a microcontroller it has not got all of the capability of a Pi BUT is very useful for using sensors, motors and LEDs like neopixels etc. Combining a microcontroller with a Raspberry Pi is essential if you are creating robotics or advanced control systems involving sensors / actuators. Installing Arduino IDE in Raspbian is now very straightforward and I highly recommend using the command line as opposed to downloading and installing from the Arduino website. So let’s get started with the install; boot up you Raspberry Pi, open Terminal in desktop and type in the following commands;

sudo apt-gate update && sudo apt-get install arduino

This will update your repositories and install Arduino IDE in the correct directories for you. After completing install Arduino will be available to your Pi in the main Menu —> Programming ; as shown below (Pi-TopCEED)

OK – this is the all the installation we need for official Arduino boards BUT if we want to use any 3rd party boards based on EPS8266 (IOT applications) or WS2812 (NeoPixel controllers ) we will have to install a CH340 driver so Arduino IDE can recognise the serial port communication protocol via the  USB port. Let’s open terminal again and download the CH340/341 driver – this time from GitHub;

wget https://github.com/aperepel/raspberrypi-ch340-driver/releases/download/4.4.11-v7/ch34x.ko

we will do a step by step installation here so after download has finished we install the serial driver first;

sudo insmod /lib/modules/4.9.35-v7+/kernel/drivers/usb/serial/usbserial.ko

we will then do the actual CH340 driver install and do a reboot;

sudo insmod /lib/modules/4.9.35-v7+/kernel/drivers/usb/serial/ch341.ko

sudo reboot

after reboot we will open terminal again and check install with this command;

lsmod

if you should see something like this – we are good to go:

We are now ready to test a 3rd Party board ; I will use a board supplied to me by 4tronix – a NeoPixel board in development – we like shiny & bright pixels. After plugging the board in to a spare USB port and opening Arduino we will see this upon checking port/board;

serial port succesfully recognising the USB device

board recognised as Arduino UNO (ATmega328)

 

As indicated the USB port is now recognised and the board is identified as an Arduino UNO – as the board is based on the UNO chip; ATmega328 – installation successful.

 

credits/links;

CH340 download / instructions from aperepel’s  Github repo

issues and fix for unsuccessful install (comments )

(To be continued with some geeky programming examples)

. . . share the geek love . . .Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on Pinterest
Liked it? Take a second to support jarjargeek on Patreon!

Leave a Reply

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