Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



30 Commits

Repository files navigation

State Machine

Treating the Design Studio as one grand Moore Machine, exposing outputs to users and mentors.

input/ (Pure Input)


Magnet holder for cylinder magnet


See Lesson 8 for instructions on Digital Reed Switch sensor usage. Uses magnetic field to determine whether door is open.


Ultimaker http request API in Python written for the Design Studio. Might run into issues with firmware upgrades that invalidate currently available request APIs.

Not listed

machine/ (Input + Output)


Schematic of I/O circuitry

KiCad project with a schematic for the state machine's circuitry. To export updated schematic to SVG, select "Plot schematic" from menu.


Build Status

Physical presence of the state machine in the Design Studio. Bundles sensory inputs into a JSON and sends them to public-endpoint/ over a websocket at / (root) route


Build Status (link won't show anything, doesn't serve any actual HTTP stuff)

Websockets server that routes data from the poller-pi to sign/ and site-overrides/ clients. Runs on Heroku, protected behind Cloudflare.

The below documentation is a general description of what's important. There's more specific documentation in the code itself.

  • input
    • / (root) route
      • Receives JSON updates from poller-pi/
    • Vanderbilt Stadium WeatherSTEM for current weather
      • sometimes returns gibberish, only displayed if there is a degrees symbol in it
    • Google Sheet containing mentor shifts
  • output
    • /sign route
      • Serves open status to sign/ clients
    • /printers route
      • Serves printer images to site-overrides/ clients
    • /hours route
      • Serves calculated hours for the Design Studio
  • logic (
    • input-dependent
      1. Receive update from poller-pi. If no update received within 30s, proceed with an update containing empty state.
      2. Check if update actually changes the state.
      3. If so, send the updated states to clients connected to output endpoints. Else, do nothing.
      4. Repeat
    • output-dependent
      • client joins
        1. Send current state
        2. Add to keep-alive list
      • client leaves
        1. Remove from keep-alive list
      • keep alive (needed to stop Heroku from dropping long-running connections)
        1. Send current state to all clients every 50s

output/ (Pure Output)

- Live Printer Feeds
- Live Sign Status
- Live Hours
- Current Schedule


Netlify Status

React single-page progressive web app served by Netlify. Displays whether open, mentors if open, weather, and time.

Two outputs:

  • Sign as an iframe on
  • Fullscreen Chromium tab in Kiosk Mode on Raspberry Pi connected to two monitors
    • This is the same pi as poller-pi/ and driver-pi/


Netlify Status

Affects main site,

Originally written by @yunyu, various visual improvements/fixes to the Design Studio Wordpress website including but not limited to:

  • Add printer live feeds
  • Add status sign
  • Add dynamic hours
  • Hide unfriendly youtube video & Vanderbilt social media links
  • Make Wordpress theme column-sizes expand/contract properly on desktop and mobile


Client of public-endpoint at /sign route that runs on the Pi. Drives MOSFET gate pin to HIGH to activate relay. Changes synchronously with sign/.


T9AS1D12-5 SPST 5VDC Relay used to switch 120VAC for the traditional open sign above the door.

  • Switches black cable connection
  • White and green are connected directly


N-type Signal MOSFET that hooks GND on the Raspberry Pi to the relay. 3.3V I/O pins are not powerful enough to drive the relay so this is needed to do the heavy lifting.


Code and Designs for the Design Studio as a State Machine (Sign, Realtime Sign Status + Printer Feeds, and Scheduler)







No releases published


No packages published