128 × 64 LEDS · ESP32-S3 · LUA

Oceanarium

A window into a big public aquarium, the size of a bookshelf. Over a hundred kinds of sea life live their own lives in it: they come and go, hide, hunt and sleep. The light in the water changes with the real time of day.

The oceanarium at noon: shoals of yellow fish, a shark in open water, a coral reef and sun shafts

12:00Noon on the panel, at its real pace of 15 frames a second. No fish here follows a script.

Every animal on its own

This is not a cartoon on a loop. Every animal has a little program of its own that decides where to swim next, which part of the tank to keep to, and when it is time to leave. Reef fish circle the corals, rays and tuna cross the open water, crabs and lobsters walk the sand.

When a shark goes through, the small fish dash into the reef and the ball of sardines opens round it. The big visitors come out of the blue depth as shadows first and take their colour as they come nearer, because water at a distance is haze.

A presence radar sees when somebody is in the room. The curious ones (a grouper, a Napoleon wrasse, batfish, a turtle, the pufferfish, the octopus) swim to the glass where you stand and turn to look at you. Wave your hand quickly and the small fish hide, the pufferfish blows up into a ball, and the garden eels pull back into the sand.

A day in the tank

The light follows the panel's clock. At noon the water is blue, with sun shafts and dancing light on the sand. In the evening it turns violet. At night it is dark blue, lit only by the moon and the jellies, and plankton sparks where a fish darts. The night creatures come out: a whitetip shark, soldierfish, lobsters, the octopus.

Day
DAYSun shafts and light on the sand
Evening with the tank lights on
EVENINGThe tank lights are on
Night: glowing jellies and sparks of plankton
NIGHTGlowing jellies, sparking plankton

How a fish is born

There is not a single ready-made picture on the screen. Everything, from a striped butterflyfish to a whale shark, is drawn by the program from a description. Each kind has a body shape (12 of them: spindle, disc, ball, box, shark…), colours for the back, the flank and the belly, a pattern (20 kinds: bars, spots, a mask, a net, rimmed scales), fins, a tail and an eye.

  1. Draw a pose once. The first time a fish is in a new position (another size, a turn, a beat of the tail), the program draws it dot by dot and gives it volume: lighter on top, darker at the edges, a sheen on the flank.
  2. Cut it out like a stamp. The finished pose is cut out of the screen and kept. For this we gave the panel's firmware two new abilities, px.grab and px.blit.
  3. Stamp it 15 times a second. From then on the fish is put on the screen in one move, like a stamp: mirrored when it swims the other way, smaller, darker and bluer when it is far. A thousand poses instead of a thousand drawings.

The button

All it takes is one button: the knob on the panel, or OK on the remote.

One press. The tank lights on or off.

Two quick presses. A whole day in five minutes, to watch the light change.

Three quick presses. Back to the real time.

In numbers

All measured on the panel itself, or in its exact copy on a computer.

119kinds of sea life
134 KBof Lua, 2,878 lines and 118 functions
8,192LEDs (128 × 64), each of any colour
15 fpsframes a second, each drawn in 37–47 ms
≈680,000Lua instructions a second by day: about 45,000 a frame
410 nsan instruction on the tiny ESP32-S3 processor, as measured
1,000,000instructions at start: the whole reef is cut out in 1–2 seconds
22reef pieces, 7 of them swaying
239arrivals in 10 minutes by day, 69 different kinds, up to 53 at once
1,354poses in memory after 10 minutes, 370 KB of pictures in all
≈0.5 MBof memory in use of the 4 MB an effect may have
≈30 minfrom "Go!" to the first fish on the real panel

Who lives there

Reef fish · 65

A clownfish in its anemone, blue and yellow tangs, a Moorish idol, butterflyfish, angelfish, a lionfish, a pufferfish, a boxfish, triggerfish, a parrotfish, a Napoleon wrasse, a grouper, batfish, shoals of fusiliers and snappers.

Sharks · 11

A whale shark, a great hammerhead, blacktip and whitetip reef sharks, a grey reef shark, a sand tiger, a zebra shark, a nurse shark, an epaulette shark, a sawfish and a guitarfish.

Rays and a flounder · 5

A manta, a spotted eagle ray, stingrays on the sand and a peacock flounder.

Jellies · 6

A moon jelly, a sea nettle, a lion's mane, a purple-striped jelly, a fried egg jelly and a rainbow comb jelly.

Cephalopods · 6

An octopus and a blue-ringed octopus, cuttlefish, squid and a nautilus.

Crustaceans · 6

A spiny lobster, a lobster, crabs, a cleaner shrimp and a rainbow mantis shrimp.

Turtles and seahorses · 6

A green turtle, a hawksbill, a loggerhead, two seahorses and a leafy seadragon.

On the bottom and in shoals · 14

Sea stars, urchins, a sea cucumber, feather stars, a moray in its hole, garden eels, a ball of sardines and a river of anchovies.

Six moments of a day on the panel: morning, noon, dusk, evening with the lights on, night, dawn

Six moments of one day: 10:30, 13:00, 19:40, 21:30, 02:00, 06:40.