Skip to content

An Arduino scale that was used as part of a puzzle in an escape room

License

Notifications You must be signed in to change notification settings

Nydauron/info418-escaperoom-scale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arduino Escaperoom Scale

An Arduino scale that was used as part of a puzzle in an escape room. This scale and code is actively used in the Museum of the Grand Prairie's escape room as part of the Kelly's tavern puzzle.

Setup

  1. Install PlatformIO (VSCode has an extension)
  2. Clone repo
  3. Build
    • If using VSCode, click bottom nav with check mark OR go to left nav > PlatformIO > Project Tasks > uno > General > Build
    • If using CLI, run pio run
    • Note: the dependencies should download when you try to build for the first time

How the code works

LED Color Key

Here are some terms that will be referred when defining colors:

  • Blinking indicates the LED will toggle on and off at a consistent interval
  • Solid indicates that the LED will remain the same brightness
  • Flashing means the LED will fade in and out at a consistent interval

Definition of colors:

  • Blinking Red - The submitted weight is wrong
  • Green - Used when the submitted weight is correct and when the scale is ready after setup
  • Solid Blue - Used to notify the user when you press and release the button, it will zero the scale
  • Flashing Blue - Scale is actively zeroing
  • Solid Orange - Used to notify the user when you press and release the button, it will read whatever weight value is on the scale
  • Flashing Orange - The scale is actively reading a submitted weight value
  • Violet - Used for when the button is pressed during setup
  • Solid White - Used when the machine initially turns on and when it is currently waiting for a weight submission

High-level Walkthrough

On initial setup, the scale will go through steps for calibration. The scale will first tare and measure in the expected weight value. The scale then idles until it receives a button press symbolizing that the user wants to input a weight submission. It then tares and then measures the weight supplied, and if the weight matches the original measurement, it triggers a release solenoid to unlock a box. Otherwise, the scale blinks red to indicate the wrong weight was submitted.

The Design Process

In the original design of the scale, the scale had no button to signal user input, but rather it would detect a change in weight to determine if a user was submitting a new weight. Theoretically, this made sense, but applicably, this ended up being a disaster for one primary reason:

Loadcells naturally tend to creep/drift. Loadcell drift is the rate of change on the voltage output that a loadcell experiences after it is turned on. This is typically due to temperature change, including but not limited to heat generated by the loadcell and ambient temperature changes. In most vast majority of cases for loadcells and scales, they are used for only a short duration (< 3 minutes) before they are either tared or turned off. In my original case, the scale would have to be on from initial setup until the escapees solve the puzzle, and given that the puzzle was in Act 2 of 3, that would be about 20 minutes.

During testing I would notice that the loadcell would give me inconsistent readings. After some time, there even were cases where the loadcell would start spitting out high variance values even when there was nothing on the scale.

Eventually, I added a button that was simply in charge of taring the machine. However, this still did not solve the issue. I was getting readings off by 2-10g which was much greater than the ±1.0g of tolerance I had built-in to the weights.

It finally became rather clear that potentially leaving the loadcell on for an extended period of time was potentially my issue. n fact, what ended up being the solution was to simply turn off the loadcell, and then only turn it on once the button was pressed. This scenario essentially made it identical to the initial setup process when the machine is plugged in. With that change, the scale was be able to detect the correct weight consistently. Even weights that totaled ±2.0g than the correct weight were rejected. Amazing!

During playtesting, I noted to add some quality of life additions to unlock the box when the puzzle has been solved in the case where the box doesn't properly unlatch or the box gets locked back up again due to user error.