Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Complete Sensor Guide
      • Engineering Deep Dives
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Tech Terms
    • Webinars & Digital Events
  • Resources
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • White Papers
  • Guest Post Guidelines
  • Advertisers
    • Advertise
    • PR Submissions
    • Eblast Submissions
  • Subscribe

Sending Data from Beaglebone Black to Arduino Through UART (Part 7/15)

By Ashish Vara August 5, 2016

This tutorial represents communication between Beaglebone black and Arduino through UART.  You don’t need any another peripheral for this tutorial. UART stands for universal asynchronous receiver and transmitter.  It transmits and receives data asynchronously with another device which also supports UART protocol.

Required Tools:

  • Beaglebone Black
  • Arduino
  • Female to Female connectors

Setup of Software environment

Install the latest python version in BBB as explained in tutorial How to make first python program with Beaglebone Black. Install the adafruit python-GPIO library.

Working

Beaglebone transmits the message which is entered from command prompt and Arduino receives the data and displays it on Arduino serial terminal. Run the python script from SSH terminal and at the same time open Arduino serial in PC. Write some message from SSH terminal. BBB transfers the data through UART which is then received by Arduino and displayed on serial terminal.

Description

BBB has on chip five UART ports each containing two pins: RX pin and TX pin  to receive and transmit respectively. In this tutorial, UART1 is used for communication with Arduino. Here, BBB acts as transmitter and Arduino as receiver. Connect the UART1 transmitting pin (24th pin of header P9) of BBB to receiving pin (pin number 10th) of Arduino.  I have used software UART in Arduino that’s why I have connected it with pin number 10th (I declared 10th and 11th pin as RX and TX in program respectively). Make the common ground connection between Arduino and BBB  which is necessary for communication.

Open the command terminal and  access Beaglebone black through SSH as explained in getting started with Beaglebone black. Create a new file using touch command with .py extension (i.e. led.py). Open the file with any text editor (i.e. nano, vim etc.) and write a code in python language.

Connect Arduino with PC through USB cable. Open  it and then write a code for receiving data in C language. For help, you may  refer to the tutorial how to Install and run Arduino in Linux.

UART setup in BBB

You need to import UART in program to make use of I2C device. You can create your own library but that would consume more time. Hence Ad fruit library can be used that provides all kind of python library of BBB.

import Adafruit_BBIO.UART as UART

Also import the serial from python library. It encapsulates access  to serial port.

import serial

Configure UART by following function:

UART.setup(“UART1”)

serial.Serial (port = “/dev/ttyO1”, baudrate=9600)

First function is setup and configuration of UART1. Second function accesses the serial device with defined baud rate. Find the device port attached with UART from  the list below and access it.

Magnetometer interfacing with Beaglebone black

Now, you can transmit and receive data through UART. You can close the port when you don’t want to use it.

Arduino Setup

Write a receiving source code in Arduino and load it  onto Arduino Uno.  After the data is received, it will be displayed on the serial terminal.

Run the script from terminal:

Enter the following command with file name from command prompt:

            python filename.py

i.e. python uart.py

You may also like:


  • LED blinking in Beaglebone Black (Part 3/15)

  • Switch Interfacing with Beaglebone Black ( Part 4/15)

  • DC Motor Interfacing with Beaglebone Black (Part 5/15)

  • Servo Motor Controlling with Beaglebone Black (Part 6/15)

  • Getting started with Beaglebone Black (Part 1/15)

  • LED blinking In Beaglebone Black

Project Source Code

 

Project Source Code

###

// UART.C

#include

 
SoftwareSerial uart(10,11);
 
 
void setup()
{
  Serial.begin(9600);
  uart.begin(9600);
  
}
 
void loop()
{
 
  if(uart.available() > 0)
  {
    Serial.write(uart.read());
  }
 
}
 
//
 
import Adafruit_BBIO.UART as UART
 
import serial
 
UART.setup("UART1")
 
disp = serial.Serial (port = "/dev/ttyO1", baudrate=9600)
 
disp.close()
disp.open()
 
while True:
        if disp.isOpen():
 
                print "Serial is Openn"
                message = raw_input("Enter your message:n")
 
                disp.write(message)
                disp.write("n")
 
                exit = raw_input("You want to exit or not YN:")
 
                while ((exit != 'Y') and (exit != 'N') and (exit != 'y') and (exit != 'n')):
 
                        print "Invalid Input!!!n"
 
                        exit = raw_input("You want to exit or not YN:")
 
 
                if (exit == 'Y') or (exit == 'y'):
                        break
 
                else:
                        print "To be continue....n"
 
 
print "Sorry!!! You not able to do communicate with device"
disp.close()

###

 


Circuit Diagrams

data-from-beaglebone-arduino-using-UART

Project Video


Filed Under: BeagleBone, Electronic Projects

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

Log in to leave a comment:

Lost your password?

Don't have an account? Register here

Submit a Guest Post

submit a guest post

EE TECH TOOLBOX

“ee
Tech Toolbox: Wide Bandgap Semiconductors
Moving from silicon to GaN or SiC feels like a whole new ballgame, doesn’t it? It isn’t just about faster switching; it’s about managing the layout parasitics and thermal realities that come with that speed. This month’s Tech Toolbox features a curated eBook that tackles these design hurdles head-on.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS feed: EDABOARD.com Discussions. EDABOARD.com Discussions.

  • 7555 with no discharge resistor for monostable operation?
  • I have an Acer Aspire 5 A515-54G-53H6 issue with mother board
  • PCB not properly made
  • Flyback converter working incorrectly
  • Improve Equipment Efficiency

RSS feed: Electro-Tech-Online.com Discussions Electro-Tech-Online.com Discussions

  • Electronics and PIC Programming Assembler Update
  • Getting rid of old magazines
  • PIC code for 2.42" I2C OLED Display?
  • Getting Back Into Electronics
  • Best way to check charge and discharge many mixed batteries?

Featured Tutorials

LoRa and LoRaWAN: A Complete Guide to Wireless Communication

  • Best practices for securing LoRa networks
    Best practices for securing LoRa networks
  • Understanding LoRa architecture: nodes, gateways, and servers
    Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
    Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
    How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
    How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices
    How communication works between two LoRa end-node devices
More Tutorials >

Recent Articles

  • Texas Instruments adds agentic AI to CCStudio
  • onsemi adds trench SiC for power systems
  • Silanna launches matched chipset for multi-channel LiDAR
  • Renesas launches browser-based embedded development hub
  • Diodes targets EV charging current sensing

EE ENGINEERING TRAINING DAYS

engineering
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2026 Arrowfly LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of Arrowfly
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Complete Sensor Guide
      • Engineering Deep Dives
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Tech Terms
    • Webinars & Digital Events
  • Resources
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • White Papers
  • Guest Post Guidelines
  • Advertisers
    • Advertise
    • PR Submissions
    • Eblast Submissions
  • Subscribe