Filed Under #electronicrituals

Digital Amulet Part Two: Programming

This project was a combination of my finals for Homemade Hardware and Electronic Rituals. While reading personal posts on instagram, I realized that I often commented the phrase ‘sending love’ when I wanted to show my support for that person. In a way, through our connections on social media, we give each other protection and support. An amulet is an item that traditionally gives its wearer protection and good luck. I wanted to make an amulet that received its power through the internet. Link to first post documenting the fabrication of the board

Programming the ESP8266 Module

It was such a challenge to finally be able to flash code to my module!! I used this USB to TTL Serial Converter with a CP2102 chip and the Arduino IDE to program the module. This guide from Adafruit was helpful to learning how to set up for programming from the Arduino IDE. I had to change some of the settings, specifically reset method: nodemcu and flash mode: QIO. alt text

Here is my programming set up. The board is connected to an external powersource at 3.3V and connected to my computer via the usb to ttl serial converter attached to the 3 header pins on the board. I’m flashing code to the board with the arduino IDE on my laptop. alt text

The usb to ttl serial converter has to be connected to the header pins on the board correctly:

  • ground to ground
  • rx to tx
  • tx to rx

To flash code, you have to hold down the GIO0 button, press down the RESET button and then let both go. I then look in the serial monitor in the Arduino IDE to see if my board is connecting to WiFi.

Connecting to WiFi and Making HTTPS Requests

I had to use https requests instead of http since the instagram api website is https. I based my code off of the esp8266 wifi https request example. I did not use the fingerprint verification part because I could not find the correct SHA1 fingerprint from my browser. I used a hotspot network created from my mobile phone to test.

Instagram API

I used this API before for another electronic rituals project so I was already familiar with what data you could get. However, it is getting deprecated soon so I will probably have to update this project in the near future. For this project, I’m getting the number of likes and the number of comments on the most recent 3 posts. I first tested in the browser but soon realized I needed to make direct requests to the instagram api from the esp8266 board itself. I limited it to the first 3 posts because the returned JSON object for the default 22 posts was too large to fit on the esp8266’s memory and my program kept crashing. Here is the url I’m calling to in my final code. The returned data is in JSON format so I had to figure out how to parse that in the Arduino environment (see next section). The request to the url is made every 7 seconds because instagram rate limits to 500 requests per hour.

ArduinoJSON Library

This was my first time using the ArduinoJSON library and it took me a long time to understand what was going on. I based my code off of the http client example and used the assistant to calculate my dynamic buffer size based on my JSON object.

const size_t bufferSize = 5*JSON_ARRAY_SIZE(0) + JSON_ARRAY_SIZE(1) + JSON_ARRAY_SIZE(3) + 8*JSON_OBJECT_SIZE(1) + 3*JSON_OBJECT_SIZE(2) + 14*JSON_OBJECT_SIZE(3) + 11*JSON_OBJECT_SIZE(4) + 2*JSON_OBJECT_SIZE(15) + JSON_OBJECT_SIZE(16) + 7572;

After parsing the JSON object, I can now get the number of likes on the first three posts and check if there are any new comments.

FastLED Library

Now, I just had to code the lighting pattern that I wanted the neopixels to display. I used the FastLED library because it made it easier to work with the rgb values of the neopixels. I experimented with 2 kinds of lighting to test if a more explicit interaction was better or not. I didn’t want the lighting to seem like a 1 to 1 interaction because that would be more like a notification device. But I also didn’t want the relationship between instagram data and the amulet to be undetectable.

  • likes: blue pattern where brightness is mapped to the average # of likes on the first three posts
  • comments: adding red to leds in a wipe pattern if the # of comments on the first three posts increases alt text

As you can see, the likes lighting pattern relationship to the instagram data is not as explicit as the comments lighting pattern.

Finished Documentation

Link to full code for project

alt text alt text

Written on April 28, 2018

Computer Generated Randomness

I struggled to think of an idea for how to seed my random function. My first idea was to use MTA data on whether a train was late or not when I read that trains are ontime only 58% of the time which is almost like flipping a coin. However, I had trouble getting the data and I didn’t want to spend the majority of the time figuring out MTA’s api. I may use this for a future project. So I decided to implement psuedo-randomness using my local system time. I wanted to see how often and when it would feel like I’m cycling through the same values.

Part 1

See the Pen GxejYE by Jillian (@jzhong) on CodePen.

Above is a codepen with my function. The buttons let you get an example of what numbers would be generated depending on your needs. Below is the actual function that generates a number between 0 and 1.

function randomNum(){
  var currentTime = new Date();
  var currentHours = currentTime.getHours();
  var currentMinutes = currentTime.getMinutes();
  var currentSeconds = currentTime.getSeconds();
  var currentMiliSeconds = currentTime.getMilliseconds();
  var timeVal = currentHours * currentMinutes * currentSeconds * currentMiliSeconds;
  
  var maxVal = 23 * 59 * 59 * 999;
  var stringNum = String(timeVal / maxVal);
  var editedNum = stringNum.slice(3,16);
  var finalNum = Number(editedNum) / 1e13;
 
  return finalNum;
}

Part 2

I decided to try using my custom random function to replace the javascript random() function in a bookmarklet I made for Hacking the Browser to see if I would perceive a difference in the behavior. Drag the link to your bookmarks bar and click it to start. Then click on any links on the browser page. After clicking a link, it should fly off in one of 8 directions that are randomly chosen.

Flying Links with Javascript random()

Flying Links with custom random function

Written on April 10, 2018

Meditation #4: Talking Board of Today

alt text

Concept

I wanted to create a modern, electronic talking board that is easily accessible to many users. I brought back an idea I was working on several years ago and redesigned it. I had created a mobile Ouija board app where the planchette is moved based on the accelerometer readings of the mobile phone. To use this app, users have to all hold the phone face up together. Using the ideomotor effect, the phone might turn and rotate, making the planchette move to a letter.

I had it uploaded to the Google Play Store but it was removed after a copyright claim by Hasboro :(

Designing for Mobile

For this iteration, I just copied the standard Ouija board design in the app. Since the screen space is limited to what is under the planchette compared to a physical Ouija board where users can see the whole board at all times, I didn’t think this was actually the ideal board design for a mobile app. So, for this meditation, I decided to redesign the board for my app experience and simplify the spirit communication by making the board only answer yes or no questions. I also tuned the app to be more sensitive for the ideomotor effect to work properly.

alt text

The app is made in Unity and tested on Android (Google Nexus 6P).

If I would improve the design, I would add the letters of the alphabet and numbers in a radial design from the center point. I think that makes it easier to move to any letter or number from the starting point (if all characters were almost equidistant from the start). I also wanted to have the word that you land on to appear as an overlay on the screen briefly if you stay on it for a certain amount of time but I couldn’t figure out how to do that while also strugglying with using UI elements in Unity.

Written on March 29, 2018

Meditation #3: Social Media Birth Chart

alt text Social Media Birth Chart

Concept

I wanted to generate birth charts based on social media activity. I thought, maybe I could predict the personality of a person based on their social media. And I would do this by generating a birth chart for their account based on the location, time, and date the account was created. However, I could not get information on when an account is created from the instagram API. Instead, I opted to create a birth chart for each post based on when it was posted and the location tag. This is roughly answering the question: Where were the planets in relation to my last post on instagram when it was created?

How it works

I could generate a birth chart for each post a user has; however, to demonstrate the concept, I only generate one for the most recent. The user has to log in to their instagram account. Since my instagram developer account is in Sandbox mode, only instagram accounts registered by me have permission to log in. If you log in with a non-registered account, you will get an error on login.

You can test with the public itp instagram account which I have registered.

username: public_itp password: Public

I then feed the results from the API call to the Astolabe website used in Allison’s random birth chart example after parsing the information to find month, day, hour, minute, latitude, and longitude. If the post has no location tag, I enter the default as the latitude and longitude of New York. I set the timezone to UTC since the timestamp returned from instagram is a Unix timestamp.

Example

I signed into my instagram account and generated a birth chart for this post:

hi from the dystopian future

A post shared by Jillian 🔔 (@queefape) on

alt text

Link to birth chart on astrolabe.com

Main placements for my post:

  • Sun - Pisces
  • Moon - Virgo
  • Rising - Sagittarius

API

instagram API

Written on March 7, 2018

Meditation #2: Paper Memory Paper Meaning

alt text Paper Memory Paper Meaning

I was interested in the prompt ‘what can a card be?’ and also how we attribute meaning to tarot cards based on imagery and conventional understandings.

jQuery Flip plugin

link to json file I created to store info on ‘cards’

full github repo

In the future, I would like to add more ‘cards’ and maybe add functionality for other users to add their own ‘cards’ and memories. I’m unsure if there is more meaning in using your own papers and memories (personal relevance) or using a pool of all users’ memories (conventionalized meanings).

Written on February 22, 2018

Meditation #1: Electronic skincare routine

alt text I worked with Lin Zhang on this project. Our concept started with thinking about skincare as a ritual.

Concept

Strident skincare practicers spend a lot of time researching new products, a lot of money purchasing these products (most of which are expensive to luxury priced), and then large sections of time everyday using the products itself. With the popularization of the Korean 10 step skincare routine, people may spend over an hour every morning and every night treating their skin. My friend spends at least 2 hours getting ready for her day and ending her day with a multiple step skincare routine and never skips a day. We found this important as users chose to start their day and end their day with this routine. It’s also important that there are multiple steps; the order in which the products are used matters.

However, what makes skincare a ritual is the self care and emotional aspect. Products are advertised loaded with buzzwords such as “hydrating treatment made with pure honey for a unique texture that instantly melts into the skin, delivering 6 hours of supreme nourishment while improving elasticity” for a face mask. But who knows if those advertised effects are actually happening to that degree after use? From personal experience, I may notice slight differences after using a product (my face is more moisturized after using a sheet mask) but the specific advertised effects for that mask were not realized (pore cleaning and shrinking). But I still continue to use facemasks since I enjoy the 40 minutes I spend decompressing with it on. I feel like I’m taking care of myself by doing this and I know the difference after I have, even if others don’t.

We were also inspired by Glossier and this article about the brand in reallifemag. This article states that Glossier is a brand that exists in images. When you use the product, you recall all the instagram posts of naturally beautiful girls and aesthetic product shots you have seen. There is also an online sharing and community aspect to skincare; though largely coopted by advertising, users share with other users new products and routines to try. Throughout the internet, you often see “drop your skincare routine!!”. Skincare is a ritual because the steps and components are largely the same throughout all its users.

“The feature is not the product itself, which promises not to do too much, but the experience of interacting with makeup: the process of its application, the feeling of having applied it, the understanding of the difference between before and after”

If the product is the experience of interacting with the product and not the skincare itself, why not create a completely ‘digital’ skincare brand? So, our concept for an electronic ritual is an electronic skincare routine. We created a product that is not actually skincare but follows the basic tenents of skincare as a ritual: starting and ending day, steps matter, emotional aspect, community.

We created 3 objects and a website to explain this electronic ritual.

Shinier website

alt text

Project Documentation

The product is based on lighttherapy skincare products such as this Neutrogena light therapy mask. We programed ATtiny85s to create a pulsing led and connected a switch.

Breadboarding alt text

Soldered on perf board alt text

The enclosure is a glass jar that was spray painted frosted and a lid that was spray painted white. alt text alt text alt text

Video showing light pulsing

Written on February 8, 2018