Sunday, July 29, 2018

Getting started with Arduino Uno Microcontroller using Raspberry Pi 3 B+



Hi,

 I like to share my experience connecting Raspberry Pi 3 B+ , Arduino Uno , LED light and blink the LED.


I.Things Needed :

 1. Raspberry Pi 3 Model B+


 2. Arduino Board

             

 3. Solderless board

 4. 3 Male to Male Jumper wires.


5. LED light



6. 300 ohm Resistor to  protect LED


7. USB A to USB B Connector ( to connect Raspberry Pi 3 B+ with Arduino )






II.  Install necessary packages :

a) Install Arduino IDE in Raspberry Pi 3 B+ with :

sudo apt-get install arduino
After installation, you will see the Arduino IDE as follows in Raspberry desktop :

                    
b) Connect Arduino and Raspberry Pi using USB A to USB B Cable :



You will be seeing board light blinking in Arduino board.



III.  Circuit Completion

Complete  the circuit has shown below : 




Completed circuit :






   
IV. Blink light program

a)  Go to Arduino IDE, Choose the type of Arduino board : go to Tools > Board > Arduino Uno.
 

b) Select the port the Arduino is connected to, look under Serial Port under the Tools menu ( serial port in the raspberry Pi will be like /dev/ttyACM0).   


c) Go to File >  Examples > Basics > Blink




d) Change the pin number in the Blink Program to Pin 7 as shown below :


Alternatively , copy the code from :

https://gist.github.com/johnsylvester1/eab9fd314e6f84a5d63bc9109af63013

e) Compile the Blink program by clicking the tick button( left most button in IDE )

f) Click the upload button to upload the blink program.


IV. Executing the blink program

a) Output will appear as shown below :




b) Now disconnect  USB cable connecting Raspberry Pi , Arduino.

Now connect the USB cable to any Mobile USB charger.  You will see LED still blinking without Raspberry Pi connected because blinking program is loaded in Arduino board. The light will be blinking as long as power is available for Arduino board.


Now , you have successfully connected Raspberry Pi , Arduino and made a LED light blinking.

Kindly share your comments to improve my posting.







Mastering IoT Development

Hi, Before reading this post, I would recommend to read the post : https://johnsylvester-johnsylvester.blogspot.com/2018/09/iot-key-co...