Predictive Policing Awareness Machine

For this assignment we were tasked with choosing a topic to design and build a critical object about. Teams were also given sets of requirements for the created piece. The piece Gilad and I made was required to use an organic element, convey surrealism, and emote anxiety.

After a lot of brainstorming we decided to work around the topic of systemic bias, more specifically that of predictive policing and their use of artificial intelligence. This piece from propublica was eye opening to us and helped to shape the framework of the awareness machine we created.

The critical object we created was based around the idea of of a feedback cycle where data that has an innate bias in it continually gets fed into a system where the output seems uncontaminated but contains remnants of the biased data within it.

The system we created was an organic representation of those black box systems. Having a dropper of durian essence, an extremely pungent fruit that can fill a room quickly, fall onto a flower which acts as the output of the system. The liquid then creates an odd sensation where a flower which is usually associated as beautiful and pleasant smelling is now revolting. The final piece of the system is that the flower has a chance of falling into a blender and being chopped up. This is partially to make a statement about how the American criminal justice system can be a crap shoot and to say that it can have permanent effects on those who fall into it for one reason or another.

We wanted to have the final design of the piece be minimalistic and have an overall sterile look to it. The thinking behind this being that an association with this look and systems of various kinds would occur.

The technology behind the piece was fairly simple. Using a Finite State Machine built in arduino code we were able to asynchronously control a high torque servo and then use a powerswitch tail to control the blender. Everything was controlled using Arduino.

Some pieces were laser cut to help add to the design.

A final video of the working piece can be found below.

Arduino Code:

#include <ArduinoHttpClient.h>
#include <WiFiNINA.h>
#include <ArduinoHttpClient.h>
#include <SPI.h>


#include "arduino_secrets.h"
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
/////// Wifi Settings ///////
char ssid[] = SECRET_SSID;
char pass[] = SECRET_PASS;
char sessionKey[] = SECRET_KEY;
String MAC = SECRET_MAC;

const char serverAddress[] = "tigoe.io";  // server address
String route = "/data";
// set the content type and fill in the POST data:
String contentType = "application/json";
int port = 443;
int sensorPin = A1;

//temperature values
String tempString, newPost, tempData;


byte mac[6];
WiFiSSLClient wifi;
HttpClient client = HttpClient(wifi, serverAddress, port);
int status = WL_IDLE_STATUS;

void setup() {
  Serial.begin(9600);              // initialize serial communication

  // while you're not connected to a WiFi AP, attempt to connect:
  while ( WiFi.status() != WL_CONNECTED) {
    Serial.print("Attempting to connect to Network named: ");
    Serial.println(ssid);           // print the network name (SSID)
    status = WiFi.begin(ssid, pass);  // try to connect

    }

  WiFi.macAddress(mac);

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);
  Serial.print("Mac Address: ");
  Serial.println(macToString(mac));

}

void loop() {


    //String tempData;

  int sensorReading = analogRead(sensorPin);

  float voltageReading = sensorReading * 3.3;
  voltageReading /= 1024.0;

  //temperature in Celcius
  float tempC = (voltageReading - 0.5) * 100;

  Serial.print(tempC); Serial.println(" degrees C");    tempData = String(tempC);

  //
  //  Serial.println("making POST request");
  //
  //  // send the POST request
  //  //client.post(path, contentType, postData);

  postData(tempData);



  // read the status code and body of the response
  int statusCode = client.responseStatusCode();
  String response = client.responseBody();

  Serial.print("Status code: ");
  Serial.println(statusCode);
  Serial.print("Response: ");
  Serial.println(response);
  client.stop();    //close request
  while (true);  // stop



  Serial.println("Wait ten seconds\n");
  delay(10000);
}



void postData(String newData) {
  //  // have to insert extra \ before " in data JSON,
  //  // since it's a JSON string within a JSON string:
  //  newData.replace("\"", "\\\"");

  //  // the template for the body of the POST request:
  //   String body = " {\"macAddress\":\"MAC\",\"sessionKey\":\"KEY\",\"data\":\"DATA\"}";
  ////  Serial.println(body);
  //  // replace the template placeholders with actual values:
  //  body.replace("MAC", macToString(mac));
  //  body.replace("KEY", sessionKey);
  //  body.replace("DATA", newData);
  //  Serial.println(body);
  //  // make the request
  //  //body = "{\"macAddress\":\"84:0d:8e:34:a9:70\",\"sessionKey\":\"31b2cc54-e15d-4c89-9b38-474490983388\",\"data\":\"temperature:26.70\"}";
  //  client.post(route, contentType, body);

  tempString = "{'\"temperature'\":\"";
  tempString += tempData;
  //tempString += "\", \"tempData\":\"";

  newPost = "{\"macAddress\":\"";
  newPost += MAC;
  newPost += "\", \"sessionKey\":\"";
  newPost += sessionKey;
  newPost += "\", \"data\": ";
  newPost += tempString;
  newPost += "}";
  Serial.println(newPost);
  client.post(route, contentType, newPost);


}

void getData() {
  // set the content type and fill in the body:
  String contentType = "application/json";
  // the template for the body of the POST request:
  String body = " {\"macAddress\":\"MAC\",\"sessionKey\":\"KEY\"}";
  // replace the template placeholders with actual values:
  body.replace("MAC", macToString(mac));
  body.replace("KEY", sessionKey);

  // make the request:
  client.beginRequest();
  client.get(route);
  client.sendHeader("Content-Type", "application/json");
  client.sendHeader("Content-Length", body.length());
  client.beginBody();
  client.print(body);
  client.endRequest();
}

void temperatureCheck(){

  
  }




String macToString(byte mac[]) {
  String result;
  for (int i = 5; i >= 0; i--) {
    if (mac[i] < 16) {
      result += "0";
    }
    result += String(mac[i], HEX);
    if (i > 0)  result += ":";
  }
  return result;
}