For the past few months, I've checked the Citizen app for the new regional Coronavirus numbers around 8 pm every day, like clockwork. I wondered if there was a ridiculously less efficient—but more spicy— way to see how many people have died from COVID-19 in my area over the past 24 hours. Who asked for this? Nobody. Who genuinely needs this? Not a soul. Did I spend several hours figuring out how SOQL queries worked so that I could get this running? Yes. Yes I did.Webhook
I used an API from the City of Chicago website for this project. All of the information needed is shown above. You do not need an API key. The most important component is the URL; this is what took me forever. I figured out how to get the total number of deaths from only the most recent date by putting the data in descending order by date and limiting the number of returned rows to 1.Math Stuff!
This is my scratch work for finding the number of degrees needed "per death". It is used in line 27 of my code to find the value of "maxPos". This specific math works off of two assumptions: 1) that you are using a 180 degree digital servo, and 2) that your winch pulley has an inner diameter of 1.497 inches. If the latter isn't true, the arc length formula (s = 2πr (θ / 360)) should help. Divide half of your circumference by whatever your data maximum is (mine is 50) and plug the values into this equation to find θ.Original Enclosure Sketch
My plan was to have a 2 * 2 * 3" box made out of balsa wood, with a detached bottom piece that would allow me to adjust my hardware if need be. The servo (with a winch attached) would be inside the box, with any wires going through a small hole in the back panel. A small indicator attached to a piece of string would go through the front slit, with the pulley pulling it up and down according to that day's death numbers.
However, one look at the finished box and I knew there was no way on god's green earth that even a servo, let alone an entire pulley system, would fit inside the thing. In my defense, I was binging Fleabag when I drew the design, so my mind was obviously focused on much more important things. Anyways, I worked with what I had and decided to attach the servo to the outside.Servo Attached to Box
Overall, I'm relatively proud of how this turned out. The main downfall of this project was that I was limited to materials that I had at home, which resulted in a concept that was significantly better than the finished product. If I ever get the chance to revisit this with a higher budget and better resources, it would be really cool.