Scrumbot Animation Scrumbot CAD mock

Link to the project site

This is post 1/2 on the Scrumbot project. Post 2/2 is below.

Last summer my housemate brought home a kitten, named Scrum God, who has been looking a bit pudgy lately. My five housemates and I have very different routines so we attributed the weight gain to accidental overfeeding due to lack of communication. For example, I might feed the cat at 8 AM and a couple hours later another housemate might get up and, noticing that his bowl is empty, feed the cat again.

The easy solution would be to put a sheet of paper and a pen near the bowl and keep a tally of the scoops we feed the cat each day. However, I thought this would be a good opportunity to learn more about IoT and I set out to build a button that would track Scrum’s feeding schedule and communicate it both physically (lights) and virtually (Twitter and website).

Unnecessary and overengineered? Totally. Waste of time? Maybe.

Being the cheap student that I am, I did not want to buy new materials or set up a dedicated server. On the hardware side used an Adafruit Feather HUZZAH ESP8266, an LED, a button and some other bits and pieces I had. The ESP8266 is a cheap Arduino compatible WiFi module which makes it an excellent choice for simple internet-connected projects.

Getting everything wired together, I wrote code for the ESP8266 to light up the LED when the button was pressed, turn off after 4 hours and then begin blinking after 8 hours. The 4-hour period that the LED is on coincides with the 7 AM – 11 AM wakeup time for the house so we know not to feed him again if he had already been fed. After 8 hours the device blinks to remind us to feed the cat (not that it’s really needed, Scrum is a VERY vocal cat).

On the online side, I decided to use AWS Lambda with Amazon API Gateway to handle requests from the ESP8266. AWS Lambda allows functions to be hosted in “the cloud”, removing the need to host a web server, especially for simple applications like these. Initially, I had planned to use the Lambda function to record each feed event to DynamoDB, a NoSQL database by Amazon, creating a feeding history. From there I planned to use the Facebook Messenger Platform to make a bot that would message everyone in the house. However, as I was writing the Lambda function (in Python using Serverless), Facebook was in the middle of its data scandal and had suspended part of it’s platform for developers. I decided instead to post feed updates to a Twitter account instead using Twython. The first tweet the button sent out occurred at 3 AM and I was ecstatic (I woke one of my housemates because I was excited). You can follow the bot at https://twitter.com/ScrumFeedBot!

I’m not a very experienced web developer so I also wanted to build a website around the button with realtime updates as a challenge. Initially I had planned to use DynamoDB to trigger another Lambda function to update the webpage somehow. After doing some research, it appeared that it was possible to use websockets on AWS IoT to allow for realtime website updates. Although a functional solution, it involved dynamically provisioning IAM keys and appeared more complex than it was worth. Instead I decided to use Google Cloud Firestore, another database system, because it has easy-to-implement libraries supporting realtime updates for JavaScript. Hey, why reinvent the wheel right? Another benefit to this solution was that I could use Firebase Hosting for the website, reducing the amount of work I had to do to publish the site. The website is available at https://scrumbot.angelolu.tech/.

The main problems I encountered during this project involved my inexperience working with cloud functions, meaning I spent hours troubleshooting issue such as why my dependencies were not deploying properly or why my POST request was not being interpreted properly. Additionally, being inexperienced with JavaScript made calculating time differences, especially across different time zones, more time consuming than it should have been. If I were to redo this project, I would probably use Google Cloud functions rather than AWS Lambda just to keep everything under one roof.

Currently, the button posts to Twitter, the website and to the house Discord server. In the future I would like to build a Google Assistant action (“Hey Google, ask Scrum Bot when I last fed the cat“) and further develop the website (feed history browsing, additional statistics, full PWA support) and maybe make a fully automated cat feeder. Again, I realize that this project is totally unnecessary and definitely does not solve the problem in the easiest way possible however I think it’s pretty cool and I’ve learned a lot in the process. Thanks for reading my post and let me know if you have any questions or suggestions, I would love to hear them! :)

This is post 2/2 on the Scrumbot project

A while ago I built a device, nicknamed Scrumbot, that tracks our cat’s feeding schedule using an internet connected button that we press when we feed the cat. The button illuminates a LED for 5 hours, indicating that he had already been fed and should not be fed again, no matter how much he meows (he’s a gluttonous a**hole). The button also sends a group message to our house chat and updates the companion web app.

While I’m happy to report that Scrumgod (the cat) has maintained a healthy weight for the past bit, I’ve also noticed a couple issues with the current design:

Issues with previous iteration

  • Lacks time information
    • Outside of fading or blinking the single LED, there is no way of knowing if the cat was fed 20 minutes ago or 2 hours ago
  • Lacks visual appeal
    • Made primarily of cardboard and tape, the design is bulky and not something I would want to prominently display in a room
  • Overall janky electronics
    • All of the connections are either made by twisting wires together (without soldering) or connected via breadboard. In fact, if you shake this prototype enough, it will register as a button press :(

A new prototype

These factors led me to work on new iterations of Scrumbot, settling on two design candidates.

  1. Swinging arm
    • A small servo actuates an arm, swinging one way when the cat is fed and slowly moving the other way as time passes (much like as gas gauge but with time instead of volume).
  2. LED bar
    • A row of LEDs would light up when the cat is fed and extinguish one by one as time passes

A big part of this iteration is to improve the device’s visual appeal. As previously mentioned, this isn’t the most practical solution to the feed-tracking problem. Since this is something that’s not uber practical, it should at least derive value from looking interesting/appealing (like a piece of art?). I believe that these two designs look the most interesting, while also presenting temporal information in a intuitive way that can be checked with a glance.

In the end, I chose to implement option 2, due to it’s solid state design. While I believe option 1 would be more interesting as it incorporates motion, the moving part may be more prone to failure than simple LEDs.

With a shiny new 3D printer at my disposal, I modeled a case for the new iteration on Fusion 360. The LEDs fit within a protruding bar that also acts as a slight diffuser. All of the parts were made of transparent/white ABS and attached using CA glue. For much improved electronic connections and a dramatic reduction in size, I soldered everything to a protoboard. Soldering the LEDs in the half-assembled case turned out to be the most difficult part of this process as I had to be careful not to touch the case while attaching the wires. Clearly improvements to the design are needed for easier case assembly if I do further iterating. Apart from the new lights, wiring and case, I also swapped out the Adafruit Feather HUZZAH for a cheaper generic nodeMCU clone as I wanted the HUZZAH for other projects.

After slapping on a new label, the newest Scrumbot device was completed!

Result

Here’s an animation of the new device mounted to the cabinet above his bowl. New Scrumbot animation

In my opinion this design is much more polished than the previous prototype, an opinion that is shared by my housemates.

For me, this was a lesson in the importance of designing for ease of manufacturing/assembly. Everything fit together quickly and easily in the CAD software but that could not have been further from reality. A moderate amount of sanding was required due to margins for glue and general machine tolerances that were not accounted for.

As always, let me know if you have questions or would like more detailed explanations/diagrams.