Computer Sciencefor Theatre & Technical Direction

ReferenceParts and prices

What Arduino, ESP32 and Raspberry Pi actually do on a stage

Nobody buys a microcontroller. They buy a thing that has to happen at 21:47. Which board, what it costs, what it is bad at, and three worked effects with the parts list and the failure mode written down.

Nobody buys a microcontroller. They buy a thing that has to happen at 21:47, and the board is whichever one makes that thing cheap, repeatable and safe. Choosing it is a five minute decision if you know what each one is bad at, and a two week decision if you do not.

This page is the reference behind Class 5 and behind most capstones. It is deliberately concrete: what the board is, what it costs in the band you should expect, what it is good at, what it will embarrass you with, and a worked effect you could actually build.

Prices are bands, in HKD, for planning only. They move, they differ between a distributor and a market stall in Sham Shui Po, and the number in a tender has to be a quotation rather than a memory. The bands are here so you can tell a fifty dollar decision from a five thousand dollar one, which is the part that actually changes a design.


The four questions, applied to a board#

Before the part number, four questions. They are the same four from Class 1, pointed at hardware.

  1. What has to happen, and by when? A relay closing within 20 ms of a cue is a different machine from a projection that has to be frame-locked. Write the deadline down as a number.
  2. What does it do on every pass? A board with one job forever is a microcontroller. A board that is also serving files, decoding video and running a desktop is a computer, and it will occasionally be late.
  3. What does it assume? Mains that never dips. A network that is always there. An operator who presses go once. Name each assumption, because each one is a fault you have not written down yet.
  4. What does it do when it is alone? Power up with no network. Lose the cue mid-move. Get the same trigger twice in 40 ms. This is the question that separates a prop from a product.

The three families#

Arduino (AVR)ESP32Raspberry Pi
Typical boardUno R3, Nano, Mega 2560ESP32-WROOM devkit, ESP32-S3Pi 4, Pi 5, Pi Zero 2 W
Band, board onlyHK$40–260HK$35–120HK$300–900
Clock16 MHz, one core240 MHz, two cores1.5–2.4 GHz, four cores
RAM2–8 KB320–512 KB1–8 GB
BootMillisecondsMilliseconds20–40 seconds
NetworkingAdd a shieldWi-Fi and Bluetooth built inEthernet and Wi-Fi, full stack
Timing you can promiseMicroseconds, repeatableMicroseconds on core 1 if you keep Wi-Fi on core 0Milliseconds, usually, never guaranteed
Pulling the powerFineFineCan corrupt the card
Analogue in10-bit, decent12-bit, noisy and non-linear near the railsNone without an add-on
Video, audio, filesNoNoYes, that is the point
LanguageC++, some MicroPythonC++/Arduino, ESP-IDF, MicroPythonAnything
The one sentenceOne job, forever, on timeOne job, on time, on the networkA small computer that happens to have pins

The decision, in one line each. If it must be on time, it is a microcontroller. If it must be on time and on the network, it is an ESP32. If it must play media, hold files, or talk to something that expects a computer, it is a Pi, and you give the timing-critical part to a microcontroller sitting next to it.

The pairing is not a compromise, it is the normal answer. Almost every good rig on this page is a Pi doing the talking and a microcontroller doing the moving, over a serial link. Each does the thing it cannot be beaten at, and neither is asked to do the thing it is bad at.


Arduino: one job, forever#

An 8-bit microcontroller on a board with a USB socket and a bootloader. That is the entire product, and its value is that it is boring: the same sketch on the same board does the same thing in the same number of microseconds, in 2015 and in 2026.

Where it wins. Anything where lateness is the failure. A trigger that must fire within a millisecond of a contact closing. A stepper that must not lose a step. A safety interlock you can read the whole of in one sitting.

Where it embarrasses you. Two kilobytes of RAM. A string library will silently eat it and the board will start rebooting in a pattern that looks like a hardware fault and is not. Anything involving a network needs a shield, a library, and a week you did not budget.

The failure that will catch you. delay(). It is in every example sketch and it stops the board doing anything else, including reading the stop button. Class 5 spends 35 minutes on this and the coding lab has it as an exercise, because it is the single most common bug in theatre firmware.

Worked effect: the letter that catches fire#

A prop letter is dropped into a brazier. Two seconds later a flicker starts, builds for four seconds, holds, then dies over eight.

PartBand
Arduino NanoHK$40–90
IRLZ44N logic-level MOSFET ×3HK$25
12 V 5 A supplyHK$120–200
Warm white and amber LED strip, 1 mHK$60–120
Microswitch in the brazier rimHK$15
Enclosure, terminals, sleevingHK$150

Total in the band of HK$450–650, one evening to build, one to make reliable.

The logic is the whole job. A flicker is not random: it is two noise sources at different rates summed and clamped, because real fire has a slow body and a fast edge. Random per frame looks like a fault. The fade calculator gives you the PWM frequency that will not beat against a camera, which matters the moment somebody films it for marketing.

What it does when it is alone. On power-up, off. On a second trigger while running, ignore for half a second, then restart: an actor who fumbles the drop must not get a double flare. On loss of the trigger wire, off, because a floating input reads as noise and noise reads as fire.


ESP32: on time, and on the network#

Two cores at 240 MHz, Wi-Fi and Bluetooth on the die, for less than an Arduino. It is the board that made networked props ordinary.

Where it wins. Anything wireless that has to be on time. A prop that must respond to a cue with no cable to it. Art-Net or sACN straight into a pixel string. A battery-powered costume piece with 100 pixels and a radio.

The two-core rule, which is the whole craft of using it. Wi-Fi and its stack live on core 0 and they are not deterministic: the radio will occasionally take milliseconds and give you no warning. Pin your timing-critical work to core 1 and it stays microsecond-clean. Ignore this and you get a board that works in the office and stutters in a room with four hundred phones in it.

Where it embarrasses you. The ADC is genuinely poor: non-linear near both rails and noisy enough that a fader will jitter unless you average it. Wi-Fi in a full house is a different medium from Wi-Fi in a rehearsal room, and a costume piece that worked in tech can drop out on press night for reasons no logic analyser will show you. If it matters, it is on a wire.

Worked effect: forty wireless pixel batons#

Forty performers, each with a 30-pixel baton, all changing colour together on a cue from the desk.

PartBand, each
ESP32 devkitHK$35–90
30 × WS2812B on a stripHK$40–80
18650 cell, holder and protectionHK$60–110
Boost or buck to 5 V, 2 AHK$40
Tube, diffuser, end capsHK$80–150

About HK$260–470 each, so forty is in the band of HK$10 000–19 000 plus your labour, against a five-figure hire for the nearest commercial equivalent. That comparison is the real content of this example: sometimes building is right, and the way you know is arithmetic rather than enthusiasm.

The design decisions that make or break it.

  • Broadcast, do not unicast. Forty unicast streams is forty times the airtime. One multicast or broadcast frame is one. sACN is multicast for exactly this reason.
  • Send state, not events. "Everybody go red now" repeated ten times a second recovers from a lost packet on its own. "Change to red" sent once does not, and the one baton that missed it is the one the audience watches.
  • Decide what a lost radio means, per cue. Hold the last colour, or fade to a safe amber over two seconds, or go dark. All three are correct in some show. Choosing none of them is not.
  • Battery is a show-length problem. Measure the current at the brightness you will actually use, divide, and add a third. Then charge them in a labelled rack, because the failure on this rig is never the code.

Raspberry Pi: a small computer that happens to have pins#

A full Linux computer. Treat it as one: it boots, it has a filesystem that corrupts, it gets updates that change behaviour, and it has no idea your cue is in 40 ms.

Where it wins. Media playback. Talking protocols that assume a computer: OSC, HTTP, MQTT, NDI, Art-Net at scale. Holding a show file. Being the thing that a designer can SSH into and change.

Where it embarrasses you. Boot time, in front of an audience. Filesystem corruption after the power is pulled, which in a theatre is every night unless you stop it. Timing: a Pi will do the right thing 999 times and be 40 ms late on the thousandth, and 40 ms late is a visible miss on a lighting bump.

The three things that make a Pi show-safe, and they are not optional:

  1. Read-only root. raspi-config has an overlay filesystem option. Turn it on. The card stops being writable, so pulling the power stops being a risk. Logs go to RAM or to a network drive.
  2. A watchdog. The hardware watchdog reboots the board if the software stops petting it. A Pi that reboots itself in 25 seconds is better than a Pi that is quietly hung.
  3. Fixed everything. Static IP. No automatic updates. A pinned OS image, imaged once, cloned to every card, and a copy of that image in the show folder. "It works on mine" is a sentence about a Pi that was not built this way.

Worked effect: the show-control box that is not a product#

A Pi 4 that listens for OSC from the lighting desk, plays four video files to a projector, sends timecode to sound, and closes two relays.

PartBand
Pi 4, 4 GBHK$500–800
Industrial SD card or SSD on USBHK$120–400
PoE or 5 V 3 A supplyHK$120–260
Relay board, opto-isolatedHK$60
Case, panel mount connectorsHK$300–600

HK$1 100–2 100 against a commercial show controller starting around HK$25 000. And here is the honest half: the commercial box comes with support, a warranty, a signed off failure mode, and somebody to blame at 23:40. Yours comes with you. That is the decision, and it is a producer's decision as much as a technical one. Class 4 and the systems page are where it gets argued properly.


ESP32 against Pi, on the question that actually decides it#

The thing you are buildingBoardWhy
A cue-triggered pyro-safe relayArduino or ESP32Deterministic, no OS, no boot
Wireless costume pixelsESP32Radio on the die, timing on core 1
A prop that plays a 20 second videoPiIt has a video decoder and a filesystem
Art-Net to 8 universes of pixelsESP32 for 4, Pi or dedicated node beyondAirtime and CPU, not principle
Reading 12 buttons on a set pieceArduinoIt is a shift register and a loop
Turning a stepper on a cue, to a positionArduino or ESP32, never a Pi aloneMissed steps are the failure and Linux misses steps
A touchscreen for the DSMPiIt is a computer with a screen
An interactive install running for six monthsPi, read-only, with a watchdogNothing else survives being ignored
Anything that could hurt somebodyNone of them, aloneHardware interlock first, board second

The last row is not a joke and it is not a disclaimer. A microcontroller is allowed to make an effect happen. It is never the thing between a performer and a machine that can hurt them. The emergency stop is a hardwired circuit that removes power and asks no processor for permission, and Electronics for Theatre Class 15 is the four hours on how that circuit is built.


What each one costs you in time, which is the number nobody quotes#

ArduinoESP32Pi
First blink10 minutes20 minutes40 minutes, most of it imaging
First useful effectAn eveningAn eveningA day
Making it survive a runA dayTwo days, most of it radioThree days, most of it Linux
Handing it to somebody elseAn hourAn hourHalf a day, because there is an OS to describe

The last row is the one that gets forgotten in a schedule and then costs a weekend. A build is not finished when it works; it is finished when the next person can run it. That is the capstone standard, and it is on the handover card.


Going deeperMicroPython, CircuitPython, and when not to#

Both boards run Python. It is genuinely pleasant: no compile step, a REPL over serial, and a student who learned Python in Class 2 can be doing something on hardware in ten minutes.

The trade you are making. Interpreted Python on an ESP32 gives you tens of microseconds of jitter where C++ gives you sub-microsecond. For a fade, a relay or a sensor read, that is invisible. For bit-banged WS2812 timing, a stepper at speed, or anything measuring a pulse width, it is the difference between working and flickering.

Use it when the board is doing logic and talking, and the timing is measured in milliseconds. Do not use it when the timing is the point.

The same argument, one layer up, decides between writing your own show controller and buying one, and that is the systems page.


Numbers from this page#

NumberValueWhy it matters
Arduino Uno RAM2 KBA few long strings will exhaust it and the symptom looks like hardware
ESP32 clock240 MHz, two coresPin timing to core 1, leave Wi-Fi on core 0
Pi boot20–40 sNever in a cue, always before the house opens
WS2812 frame, 170 pixels~5.1 msThe reason a universe is 512 slots and a long string is slow
One DMX frame~23 ms at full 51244 Hz maximum, and your loop has to fit inside it
Safe loop budget at 30 Hz33 msAnything blocking longer than this is a missed cue
Typical relay bounce1–10 msDebounce in firmware or count one press as three
5 V pixel current, full white~60 mA each170 pixels is 10 A, and that is a power design not a USB cable

Where this goes next#

  • Class 5 is the four hours where you build one of these and measure it.
  • The model box is the project that puts all three families in one rig at 1:25 scale.
  • The systems page is the same decision at product scale: buy it, or build it.
  • Electronics for Theatre is sixty four hours below the connector, and it is where the power design on this page actually gets taught.