[ITP: ConnDev & SoftRob] Lungs II

This is a continuation of my previous blog post.

Connected Devices

API Calls

So I have been really stuck on getting the AirNow API calls to work. In office hours we tried the “SimpleGet” sketch from the ArduinoHttpClient library and a get request to “www.airnowapi.org” returns status code -2 meaning there was an error with communication to the API. When I type curl -L ‘https://www.airnow.gov’ the command works as expected returning the html of the page in my computer’s terminal. Typing curl -L ‘https://www.airnowapi.org’ works too!

curl -L ‘www.airnowapi.org/aq/observation/latLong/current/?format=application/json&latitude=40.6924&longitude=-73.9875&date=2023-04-04T00-0000&distance=15&API_KEY={apikey} returns an API response with the AQI data in the terminal as well which is super perplexing. Using that example sketch I also learned that I am able to make SSL connections and send https requests which I thought I wasn’t able to do before.

At one point I was getting a 302 error which means a redirect was happening. I looked to this Tom example to write a function to redirect the request to the correct server address but that did not end up working either because it doesn’t seem to find the new temp server and I don’t really know enough about http requests to know what it’s looking for either…



So I GIVE UP with AirNow! I started with the Weatherbit API but after getting a free key I found that it costs $475/mo if I want to get air quality data, so no go. I found the OpenWeather API which has free current air quality data. Winner! I modified the “DweetGet” sketch and can read the full API response from the Arduino serial monitor, yahoo! The API responds on the pollutants outlined in the table below.

I’m now trying to make sense of the values it is responding with. When I open my Weather App on my iPhone I see that the air quality in Mesa, AZ is 47 which is “good” and the AirNow dashboard reads 45, so that lines up pretty well. The API calls on my Arduino say the AQI is 3…

Looking at the API documentation it shows that the AQI is on scale from 1 to 5, 3 being moderate air quality. Moving forward I can either use this 1 to 5 number or understand what the other chemical pollutants mean in terms of air quality and how I want to use them in the “breathing” of my piece.

Soft Robotics

New materials:

  • 3.5mm brass tubing

  • Zip ties

  • Stuffing

  • Latex gloves

  • Vinyl fabric

Vinyl Airbag test

Subtracted volume test

Added coke bottle volume test

I added a coke bottle in line with the inflation pump in hopes of getting the lung to inflate faster. If the pump is constantly pumping air into the bottle it should act as compressed air when opening the valve and should make the rate of air flow much faster. Even with all the time I put into constructing the Coke bottle bong, this didn’t prove to be a good solution because the tube parts were too leaky.

Vinyl lung test

I cut this lung shape out of the heat-sealing vinyl fabric. So far it seems like the most reliable and straightforward solution to making “breathing” lungs.