Build Sheets

01 · Brief

Fuel calibration is a logic puzzle on paper and three dials on the console. Solving the puzzle tells the players how many pixels each NeoPixel ring should show. Turning a pot lights that ring up to the matching count, so the players can see exactly what they are dialling in.

When all three rings sit at the right count, the Uno fires the relay and the second maglock drops. The box behind it holds the loose jumper wires, the schematic cards, and the physical key for the control panel wiring game up next.

Like the games before it, this one runs on its own board with no link to the Pi. The switch, pots, the rings, and the relay are all the Uno needs. The players aren’t able to interact with the puzzle until the correct time in the game because the key they need to enable the controls isn’t available until they solve the prior puzzle. Key switches are a lot of fun to use in real life!

02 · System

KEY SWITCH9 V RAIL5 V RAIL12 V PSURELAYMAGLOCK→ UNO
UNOPOTS ×3RINGS ×3→ RELAY

03 · Source

Escape_Game_Final_FuelMix.ino

#define PIN_RING_BLUE   5

// Define the pins for the potentiometers
#define POT_PIN_RED     A0
#define POT_PIN_GREEN   A1
#define POT_PIN_BLUE    A2

// Create NeoPixel objects for each ring
Adafruit_NeoPixel ringRed = Adafruit_NeoPixel(NUM_LEDS, PIN_RING_RED, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel ringGreen = Adafruit_NeoPixel(NUM_LEDS, PIN_RING_GREEN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel ringBlue = Adafruit_NeoPixel(NUM_LEDS, PIN_RING_BLUE, NEO_GRB + NEO_KHZ800);

const byte relayPin = 11;
byte switchPin = 12;
int numLedsRed;
int numLedsGreen;
int numLedsBlue;
int potValueRed;
int potValueGreen;
int potValueBlue;

// Has the puzzle been solved?
bool isSolved = false;
bool relayTriggered = false;
//const byte solution[3] = [3,6,8];

void checkSolution() {
 if (numLedsRed == 6 && numLedsGreen == 3 && numLedsBlue ==8 && relayTriggered == false){
    isSolved = true;
    Serial.println("solved");
    digitalWrite(relayPin, HIGH);
    delay(200);
    digitalWrite(relayPin, LOW);
    relayTriggered = true;
      if (isSolved == true){
        delay(3000);
        ringRed.clear();
        ringGreen.clear();
        ringBlue.clear();
      };

  };
  isSolved = false;
}

void setup() {
  Serial.begin(9600);
  
  // Initialize the NeoPixel rings
  ringRed.begin();
  ringGreen.begin();
  ringBlue.begin();

  // Set the brightness (optional)
  ringRed.setBrightness(50);
  ringGreen.setBrightness(50);
  ringBlue.setBrightness(50);

  // Clear the rings
  ringRed.show();
  ringGreen.show();
  ringBlue.show();

  pinMode(switchPin, INPUT_PULLUP);
  pinMode(relayPin, OUTPUT);
  digitalWrite(relayPin, LOW);

}

void loop() {
  // Read the potentiometer values
  potValueRed = analogRead(POT_PIN_RED);
  potValueGreen = analogRead(POT_PIN_GREEN);
  potValueBlue = analogRead(POT_PIN_BLUE);

  // Map the potentiometer values to the number of LEDs (1 to 12)
  numLedsRed = map(potValueRed, 0, 1023, 1, NUM_LEDS);
  Serial.println(numLedsRed);
  numLedsGreen = map(potValueGreen, 0, 1023, 1, NUM_LEDS);
  Serial.println(numLedsGreen);
  numLedsBlue = map(potValueBlue, 0, 1023, 1, NUM_LEDS);
  Serial.println(numLedsBlue);


  // Update the rings with the mapped values
    if (digitalRead(switchPin) == LOW){
  updateRing(ringRed, numLedsRed, 255, 0, 0);  // Red ring
  updateRing(ringGreen, numLedsGreen, 0, 255, 0);  // Green ring
  updateRing(ringBlue, numLedsBlue, 0, 0, 255);  // Blue ring
  delay(50);  // Small delay to smooth out the changes
  }
Lines 10–100 of 116 · Full source →

04 · Lessons

This game required me to write my own logic puzzle, which was harder than I thought. I had to test it a few times to be sure that only one solution could exist with the given variables.