Using the A111 Pulsed Radar Sensor with a Raspberry Pi

This Tutorial is Retired!

This tutorial covers concepts or technologies that are no longer current. It's still here for you to read and enjoy, but may not be as useful as our newest tutorials.

View the updated tutorial: Getting Started with the A111 Pulsed Radar Sensor

Pages
Contributors: jimblom
Favorited Favorite 3

Introduction

Does your project require high-precision, cutting-edge distance, speed, motion, and/or gesture sensing? We're not talking ultrasonic, or even infrared here, but 60GHz radar! Say hello to our tiny, pulsed radar friend the Acconeer A111!

A111 Pulsed Radar Breakout

SPX-14811
1 Retired

The A111 is a single-chip solution for pulsed coherent radar (PCR) -- it comes complete with antennae and an SPI interface capable of speeds of up to 50MHz. Applications for PCR include distance-sensing, gesture, motion, and speed detection. The sensor can monitor one-or-more objects at distances of up to two meters.

Our breakout board for the A111 includes a 1.8V regulator, voltage-level translation, and it breaks out all pins of the pulsed radar sensor to both 0.1-inch and Raspberry Pi-friendly headers.

Required Materials

To use the A111 you'll need either an ARMv7 or an ARM Cortex-M4 -- the closed-source SDK currently only supports these architectures. This tutorial will explain how to use the radar sensor with a Raspberry Pi -- a platform based on an architecture supported by the A111's SDK.

The A111 Breakout includes a 20-pin, 2x10 female header, which should mate to Raspberry Pi's of any generation. If you'd rather manually wire the A111 to your Raspberry Pi, male headers and about 9 male-to-female wires should do the trick.

Break Away Headers - Straight

Break Away Headers - Straight

PRT-00116
$1.75
20
Jumper Wires Premium 12" M/F Pack of 10

Jumper Wires Premium 12" M/F Pack of 10

PRT-09385
$4.95
1

Raspberry Pi 3

DEV-13825
92 Retired

A111 Pulsed Radar Breakout

SPX-14811
1 Retired

Tools

You will need a soldering iron, solder, and general soldering accessories.

Solder Lead Free - 100-gram Spool

Solder Lead Free - 100-gram Spool

TOL-09325
$9.95
8

Weller WLC100 Soldering Station

TOL-14228
2 Retired

Setup the Hardware

Raspbian and SPI

This tutorial assumes you've already set up a Raspberry Pi with Raspbian. For help installing the Debian-based OS on your Pi, check out the docs on Raspberrypi.org. Or -- better yet! -- check out our Headless Raspberry Pi Setup tutorial.

You'll also need to enable SPI on your Pi. For help with that, check out our SPI on Pi tutorial.

The A111 Pulsed Radar Breakout is designed to sit directly on top of a Raspberry Pi. It doesn't span all 40 (2x20) pins of a Raspberry Pi B+ (or later), but the 26-pin -- 2x13 -- header should be compatible with any Pi.

Solder the 2x13 header so the female side is facing away from the greenish-black A111 IC. Then connect the shield to a Raspberry Pi ensuring that the "Pi Display" text on the breakout matches up with the display header on your Pi. The sensor should be facing up after plugging it in.

Breakout Stacked on a Pi

A111 Breakout plugged into a Raspberry Pi.

Or, if you'd like to manually wire the breakout up to a Pi, here is the pin-out we'll use through the rest of this tutorial:

Breakout PinRaspberry Pi Pin NameRasPi Pin Number
CSSPI0 CS024
SCLKSPI0 SCLK23
MISOSPI0 MISO21
MOSISPI0 MOSI19
INTGPIO2522
ENGPIO2713
VCCIO3.3V1,17
GNDGND6, 14, 20, etc.
VIN5V2, 4

Enable SPI on your Raspberry Pi

Get the SDK

The software development kit (SDK) for the A111 is, unfortunately, locked behind a closed source blob that currently only supports Cortex-M4 and ARMv7 platforms. To download the SDK, visit Acconeer's "Products" page.

Towards the bottom, under the "A1 Software Development Kit" header is a link to GET SOFTWARE**. Read through the license, agree, and then request the A1 SDK for Linux ARMv7 software.

Requesting the ARMv7 SDK

Requesting the ARMv7 SDK from Acconeer.

After supplying your email address, you should receive a download link email nearly instantaneously.

SCP the SDK to Your Pi

Once downloaded, you'll probably need to transfer the ZIP'ed SDK over to your Pi. To achieve this, we recommend SCP. If you're on Windows, WinSCP works very well for transferring files from one device to another.

Using WinSCP to upload the SDK ZIP file to your P i

Using WinSCP to drag-and-drop the SDK into the home directory of your Pi.

If you're on a Mac or Linux machine, with SCP available, you can use a command like the below to copy the ZIP file over:

language:bash
scp acconeer_evk_service_linux_armv7l_xc111_r4a_xr111-3_r1c_a111_r2c_v1_3_5.zip 192.168.0.100:~

Unzip the SDK

Once uploaded, you can use the terminal to unzip the SDK using the following commands (included are commands to install unzip):

language:bash
unzip acconeer_evk_service_linux_armv7l_xc111_r4a_xr111-3_r1c_a111_r2c_v1_3_5.zip -d a111

Then cd to the "a111/evk_service/..." directory to prepare to build the example software.

SDK Overview

The A111 SDK includes source code, archived libraries, include files, and documentation for using the A111 pulsed radar sensor. Here's a quick overview of what's included with the SDK:

  • doc -- Doxygen-generated documentation for the A111 API and source code.
  • include -- Header and API files which describe how to interact with the pre-compiled A111 libraries.
  • lib -- Pre-compiled A111 static archives. API for these files are provided in the "include" directory.
  • out -- Compiled board and example object and executable files.
  • rule -- Recursive Makefile rules for board and example files.
  • source -- C source files for custom boards and example applications.
  • makefile -- Top-level makefile. Recursively calls files in the "rule" directory to build example and board files.

Adding Custom Example and Board Files

The SparkFun A111 Breakout's default pins will not work with those of the SDK's examples. To build and run an example with this board, we have an example board definition, make scripts, and example applications. Click the button below to download these files from the GitHub repo:

If you copy this ZIP file to your home directory, this command will unzip it to the right directory (assuming your SDK was unzipped to: "~/a111/evk_service_linux_armv7l_xc111_r4a_xr111-3_r1c_a111_r2c".

language:bash
unzip sparkx-a111-source.zip -d a111/evk_service_linux_armv7l_xc111_r4a_xr111-3_r1c_a111_r2c

The SparkX ZIP includes these files, which should be extracted to their matching SDK directories:

  • rule/makefile_build_sparkx_detector_distance.inc -- Build rules/Makefile for the sparkx_detector_distance.c source file.
  • rule/makefile_build_example\_\*\_sparkx -- Build rules/Makefile for the sparkx-breakout example files.
  • source/acc_board_rpi_sparkx.c -- Board definitions -- pin connections, clock frequency, etc, for the SparkX A111 Breakout.
  • source/sparkx_detector_distance.c -- Modified distance detector source file.

Once downloaded, these files should be extracted to the like spot in the original ZIP file.

Rule directory structure

Example of SparkX example files added to the "rule" directory. (Don't forget the "source" directory files too!

Build and Run the Test Sketch

Building the Board and Example Applications

Once uploaded to your Pi, executing the make file -- and it's recursive dependencies -- should build all of the examples you may use with the A111. To build all board and example files, navigate to the SDK's top-level directory and type make.

make example

Troubleshooting

If you have any trouble building the board and example files, ensure that you have gcc and make packages installed. (E.g. apt-get install make gcc)

Running the Example Applications

Once compiled you can run the example application (from the top-level SDK folder) by typing:

./out/sparkx_detector_distance

Example application run

This will run our modified distance-detector example application. This application will begin by calculating raw peak-distances, with a maximum of ten reflections. Following about 125 samples, the example will briefly estimate minimum and maximum thresholds, then continuously monitor for nearby objects until CTRL + C is pressed.

Evaluating the Example Application

The output of the example application can be a little difficult to parse. Here's an example output, and an explanation of what each of those values printed out means:

Distance detector: Reflections: 5. Seq. nr: 424. (200-700 mm): 648 mm (137), 658 mm (250), 665 mm (255), 676 mm (209), 686 mm (65)
  • Reflections: \<r> -- r is the number of reflections -- a value between 0 and 10 -- visible to the A111 sensor.
  • Seq. nr \<n> -- This number -- n -- should increment with each successive measurement.
  • (200-700m) -- This is the set measurement range of the A111 sensor.
  • \<d0> mm (\<a0>), \<d1> mm (\<a1>), ... -- dn in this example is the distance of reflection n and an is the amplitude of that reflection.

Running Other Examples

In addition to the distance detector, the SDK includes a few extra examples. To execute these files, run them from the out directory:

  • sparkx_envelope_service_example -- Reads in the envelope data, which us usually further-processed and used in distance, measurement, or other types of algorithms.
  • sparkx_envelope_iq_example -- Advanced version of the envelope service, which includes phase information for very small variations in distance.
  • sparkx_power_bins_example -- Demonstrates how to use A111 "power bins," which are still, kind of, a mystery to us...

Resources and Going Further

If you need any reference material surrounding our A111 Breakout Board, check out this documentation:

For help building bigger, better applications around the A111, refer to Acconeer's SDK documentation, including:

Need some inspiration for your next project? Check out some of these tutorials for ideas:

Large Digit Driver Hookup Guide

Getting started guide for the Large Digit display driver board. This tutorial explains how to solder the module (backpack) onto the back of the large 7-segment LED display and run example code from an Arduino.

Building an Autonomous Vehicle: The Batmobile

Documenting a six-month project to race autonomous Power Wheels at the SparkFun Autonomous Vehicle Competition (AVC) in 2016.

LIDAR-Lite v3 Hookup Guide

A tutorial for connecting the Garmin LIDAR-Lite v3 or the LIDAR-Lite v3HP to an Arduino to measure distance.

TFMini - Micro LiDAR Module Hookup Guide

The TFMini is a ToF (Time of Flight) LiDAR sensor capable of measuring the distance to an object as close as 30 cm and as far as 12 meters! The TFMini allows you to integrate LiDAR into applications traditionally reserved for smaller sensors such as the SHARP GP-series infrared rangefinders.