Menu Home Example Applications Support Contact Us
GCDC
Log Multiple SSPs using a Raspberry Pi

Introduction

The SSP serial interface is very simple to utilize on Linux computers, such as a Raspberry Pi. The Raspberry Pi is a simple Linux computer based on a Broadcom BCM2835 SoC and is intended for students, hobbyist and hackers. The SSP-x is a serial port interface to a 16g sensor. We use a Python script to access multiple SSP units and stream the data to a single file.

System Setup

We installed Python and mail utilities to the Pi by typing the following into a terminal window:


    sudo apt-get update
    sudo apt-get install ssmtp
    sudo apt-get install python-dev
    sudo apt-get install python-serial
    sudo apt-get install python -pip
                

The Python script is available here. Uncompress the zip file and copy the files to the Pi.

The script is easily configured using the config.txt file placed in the ./ local directory. The order of things in the configuration script do matter. An explanation of each configuration settings and the order they should be in is explained below.

    sleeptime - This is the seconds to sleep between samples (for example, 0.1 is 10Hz).
    loopcount - The number of samples recorded when the script is run
    linecount - This is the number of lines per file
    portcount - The number of serial ports to monitor. Each SSP will mount as a new serial port.
    p0 - This is the location of the first serial port
    p1 - This is the location of the second serial port

This script could be used as a cron job to capture a sample whenever the task is activated. It is recommended to set the sleeptime to 0 if the script will be used in a cron job.

Discussion

The Pi runs continously and logs data until the loop count has been reached. It is possible to set the pi to run the script to capture 10 samples every minute, if the script is set as a cron job.