BLuE Crickets

Introduction

We live in an ever growing ecosystem of connected devices. Some of these networks are at the forefront of our lives, for example we might immediately recognize when the wifi goes out or we can’t get a mobile data signal. But there other networks that are less visible, were we might not even realize that we are a persistent node always sending and receiving tiny bits of data.

BLuE Crickets scan for Bluetooth Low Energy devices. It translates the number and signal strength of nearby devices into sound and light, seeking to focus attention on one often ignored system in our lives.

What is Bluetooth Low Energy

alt text

A BLE Chip - source

You likely know what Bluetooth is; this wireless communication protocol connects our phones, computers and headphones through radio waves. Every Bluetooth enabled devices has a special chip that responsible for this communication.

Bluetooth Low Energy (BLE) is also a wireless communication technology and is powered by another chip. Surprise! It gets its name because BLE chips use less energy that a traditional Bluetooth devices. It is extremely likely that you have a BLE device with you at all times, you guessed it, your phone!

You might be thinking, “what is this other chip that I’ve never heard about before actually doing?” Well, a lot. If you are the proud owner of an iPhone, your device is constantly pinging other nearby Apple devices. This is how the “Find My” network is able to locate your the phone you left in the taxi last night as you painfully watch to travel around the city. It is unclear if turning off the “Find My” feature will even remove your device from this network.

With all the BLE chips around, you can also get a pretty good idea of how many people are around assuming that most of us our carrying a phone with BLE. This is the idea of a PAX counter, polling for BLE signals as a proxy for people.

BLuE Crickets works on this principle, it identifies the number and signal strength of nearby BLE devices and representing this data using a small piezo speaker and an OLED screen.

Project Inspiration

During the Radical Networks class during the Berlin session of NYU IMA Low Res, I discovered that an ESP32 board could act as a PAX counter and gather nearby BLE signals. Turning on a simple Meshtastic PAX counter program, I was surprised to see the amount of nearby devices.

I began to think of these devices as bugs, both in parlance of surveillance and as creatures in their own right, communicating in a language impossible to understand. Like the drone of crickets on a summer night, these chips are also chirping their signals.

Hardware

alt text

Software

The software consists of a custom Arduino sketch. When the program starts it begins to look for nearby BLE signals. It counts the number of devices and collects the signal strength. No identifying information is collected, although it can show the mac address and manufacturer id that each device is broadcasting.

The chirp() function converts the collected data into the audio and image. The length of a single chirp is determined by the number of devices divided by 10. So if 84 devices are found, the chirp will be 8 cycles of high/low frequency.

Signal strength represents how close devices are to the BLuE Cricket. The code calculates the average signal strength and maps this value between 4000 Hertz and 8000 hertz, so if devices are closer then the chirps will be a higher pitch.

This function also controls the screen output. A rectangular bar is centered in the screen. The width of the bar represents the frequency of the chirp.

Here is the chirp() function in its entirety.

void chirp(){
  if (deviceCount == 0) return; // Safety check

  rssiAvg = totalRSSI / deviceCount; //calc from scan totals

  Serial.print("rssiAvg: ");
  Serial.println(rssiAvg);

  chirpFreq = map(rssiAvg, -100, -20, lowFreq, highFreq); //tune, most averages in the the high 80s to low 90s

  Serial.print("chirp freq: ");
  Serial.println(chirpFreq);
  int size;

  for(int count = 0; count < deviceCount/10; count++){
    //ramp up
    for (int freq = lowFreq; freq <= chirpFreq; freq += 100) { // Increase frequency in steps of 100 Hz
      size = map(freq, lowFreq, highFreq, 10, 128);
      ledcWriteTone(BUZZER_PIN, freq);
      /* display.println(String(freq)); */
      drawRect(size);
      display.display();
      delay(10);             // Wait 10 ms before the next frequency
    }

    //hold high freq
    ledcWriteTone(BUZZER_PIN, chirpFreq);
    delay(100);

    display.clear();
    drawRect(0);
    display.display();

    //hold low freq
    ledcWriteTone(BUZZER_PIN, lowFreq);
    delay(100);
  }

  display.clear();
  ledcWriteTone(BUZZER_PIN, 0);
}