💡 Electron Parade

Welcome to Project 44. You’ve spent weeks mastering Shift Registers and writing clean, object-oriented code. You’ve built practical, useful things like a Smart Plant Monitor. Now, it’s time to throw all of that productivity in the trash and build something utterly, magnificently useless.

Behold the Useless Machine.

If you aren’t familiar, a Useless Machine is a box with a single switch. When you flip the switch ON, a little arm pops out of the box, flips the switch back OFF, and retreats back inside. That’s it. That is its entire purpose in the universe. It is the physical embodiment of existential dread, and it is hilarious.

If you’ve ever spent 12 hours debugging spaghetti code only to realize you forgot a semicolon, the Useless Machine understands your pain. It is the spirit animal of every maker who has ever let the magic blue smoke escape.

Let’s build one.

Useless Machine

What You’ll Need

Unlike our Face Recognition Lock, the parts list for this is mercifully simple:

Arduino Nano for Useless Machine

The Concept

We are basically wiring a toggle switch to one of the Nano’s digital input pins. When the Arduino detects the pin go HIGH (you flipped it), it triggers a sequence:

  1. Servo 1 opens the lid of the box.
  2. Servo 2 extends a tiny plastic finger.
  3. The finger pushes the toggle switch back to LOW.
  4. Servo 2 retracts.
  5. Servo 1 closes the lid.

The Wiring

  1. Connect the middle pin of your toggle switch to D2 on the Nano.
  2. Connect one of the outer pins of the toggle switch to 5V.
  3. Wire a 10k pull-down resistor from D2 to GND (so the pin doesn’t float—see Lesson 114).
  4. Connect the signal wire of the Lid Servo to D9.
  5. Connect the signal wire of the Finger Servo to D10.
  6. Power both servos from the 5V and GND pins (or use an external 5V power supply if your servos twitch—check our Jittering Servos Troubleshooting Guide).

The Code

#include <Servo.h>

Servo lidServo;
Servo fingerServo;

const int switchPin = 2;

// Adjust these angles based on your physical box
const int lidClosed = 0;
const int lidOpen = 90;
const int fingerHidden = 0;
const int fingerPush = 120;

void setup() {
  pinMode(switchPin, INPUT);
  lidServo.attach(9);
  fingerServo.attach(10);
  
  lidServo.write(lidClosed);
  fingerServo.write(fingerHidden);
}

void loop() {
  if (digitalRead(switchPin) == HIGH) {
    delay(200); // Dramatic pause
    
    lidServo.write(lidOpen);
    delay(300); // Wait for lid to open
    
    fingerServo.write(fingerPush);
    delay(300); // Wait for finger to push the switch
    
    fingerServo.write(fingerHidden);
    delay(300); // Wait for finger to retract
    
    lidServo.write(lidClosed);
    delay(500); // Reset
  }
}

The Build

The hardest part of this project isn’t the code; it’s the physical construction. You need to position the “finger” servo so that its swing arc perfectly intersects with the toggle switch. Hot glue is your best friend here.

Once you have it working, you can start programming “attitudes.” Add random delays, make the lid open slowly, or make the finger twitch hesitantly before flipping the switch. It’s useless, but it’s yours.

Have fun wasting time!