Serial Communication and Firebase Data Sending With DragonBoard 410c

Introduction: Serial Communication and Firebase Data Sending With DragonBoard 410c

Using Python serial library, we read the sensor values and send to Firebase using Pyrebase third party library.

Step 1: Setting Serial Parameters

To read the sensors values with serial communication we need to import a Python library called "serial":

import serial

ser = serial.Serial('/dev/ttyUSB') is the port that serial is connected;

ser.baudrate = 115200 is the serial baudrate of serial;

Step 2: Setting Firebase Database Parameters

To make communication with Firebase we need to install a third party library called "Pyrebase".

To do this we will execute the follow terminal command:

pip install pyrebase (before this, you need to install the pip "python").

After this import the library (import Pyrebase).

Now the parameters will be set:

config = {

"apiKey": "AIzaSyBlHBEbRzYL5IOHc9Yqkn-2XlxHe1R947Q",

"authDomain": "",

"databaseURL": "",

"storageBucket": ""


These parameters you will obtain in your Firebase database.

Next you create firebase variables:

firebase = pyrebase.initialize_app(config)

db = firebase.database()

Step 3: Reading Values From Serial and Sending to Firebase

The following code reads a serial line:

var = serial.readline()

To format and convert to float the next two lines are executed:

var = var.replace('\0', '')

var = float(var)

Now we send the value to our database:

db.update({"key": var})

After all we will finish the serial communication:


Be the First to Share


    • Pocket-Sized Speed Challenge

      Pocket-Sized Speed Challenge
    • Super-Size Speed Challenge

      Super-Size Speed Challenge
    • Audio Challenge 2020

      Audio Challenge 2020


    DIY Hacks and How Tos

    Welcome to Instructables. Thanks for sharing with the community.