DIY / Build your own camera ambilight

Build your own camera ambilight

TV on the wall, behind it the wall glows pink and violet to match the picture
Test shot with the camera prototype, September 2020

This guide takes you from the parts to a working ambilight. A small camera films the TV and works out the colours at the edge of the picture. An LED controller uses them to light an LED strip behind the TV and, if you like, Philips Hue lights as well. Because the camera sees the finished picture, it works with any source: smart TV apps, console, receiver or projector.

Status: this guide describes firmware 0.5.234 of 2 December 2026 and the new AmbiBack interface. I tested the firmware on my own hardware; the modes and the colour test work. Automatic corner detection and Philips Hue straight from the firmware are not yet confirmed on hardware, and the interface has so far only been tested with simulated devices. I have not yet rebuilt the whole setup from start to finish with this version. Expect differences and let me know where you get stuck. There is no product support.

How it works

Flow: the TV shows the picture, the M5Stack Timer Camera X films it and sends the colours over Wi-Fi to the Atom Lite. The Atom Lite passes them on GPIO 26 to the LED strip and, optionally, via Hue Entertainment to Philips Hue.
How the colours travel

For Hue alone you still need the Atom Lite, just without an LED strip.

What you need

CameraM5Stack Timer Camera X, plus a USB-C cable and a USB charger
LED controllerM5Stack Atom Lite. Do not take the AtomS3 Lite, there is no firmware for it.
LED stripWS2812B at 5 V, for example with 60 LEDs per metre, up to 255 LEDs
Power5 V power supply sized for the number of LEDs (rule of thumb below)
ConnectionsGrove cable for the Atom Lite, lever connectors (WAGO 221), LED connectors
OptionalPhilips Hue Bridge and Hue lights, 3D-printed holders for camera and Atom Lite
For the setupa computer with Chrome, Edge or Opera, a USB data cable, a 2.4 GHz Wi-Fi network and a phone or computer on the same network

Specific products are on the parts list, cases and holders in the 3D print files.

How many LEDs? Measure the sides of the back about 3 to 5 cm inside the edge. At 60 LEDs per metre, a 55-inch TV with a back of about 1.15 × 0.6 m needs around 69 LEDs at the top and 36 on each side. You can leave out the bottom if a stand sits there.

Power: a WS2812B LED draws up to about 60 mA at full white, so 150 LEDs need up to 9 A. Choose the power supply accordingly and feed long strips at several points. The camera gets its own USB charger.

1. Flash the camera

The quickest way is the AmbiBack Web Flasher, right in the browser. If you want to build the firmware yourself, use the AmbiBack USB Flasher for Windows.

AmbiBack Web Flasher with device selection and firmware 0.5.234
The Web Flasher with all device types
  1. Connect the camera to the computer with a USB data cable.
  2. Open the Web Flasher and pick the device AmbiBack M5Stack Camera Timer X (Norm/Wide) OV3660.
  3. Keep the newest version, press Install firmware and choose the USB port.
  4. After flashing the camera restarts. Enter your Wi-Fi name and password. The ESP32 only works with 2.4 GHz networks.
  5. Note the address the Web Flasher shows once the camera is online. Otherwise you find it in your router's device list.

If the camera does not respond while flashing, some camera boards need boot mode by hand. How that works is on the Web Flasher page.

2. Flash the Atom Lite

Same as for the camera, only with the device AmbiBack M5Stack Atom Lite. Set up Wi-Fi straight away here too and note the address. Then disconnect the Atom Lite from the computer.

3. Connect the LED strip

  1. Unplug the power supply.
  2. Stick the strip all the way round the back. It starts at one corner, and the arrows on the strip point away from the start. Remember the corner and the direction.
  3. Wire it as shown in the table. The Atom Lite also takes its power from the 5 V supply, and ground is shared by all.
+5 Vpower supply, LED strip and Atom Lite
GNDpower supply, LED strip and Atom Lite, shared
LED dataGPIO 26, the yellow wire of the Grove connector, to the data input of the strip
Atom Lite in the printed holder, wired with GND, LED data on GPIO 26 and plus 5 volts
Photo from the prototype: Atom Lite with WAGO connectors

The firmware sends the colours in GRB order, as usual for WS2812B. There is no setting for other orders.

4. Set the LED layout on the Atom Lite

  1. Switch on the power supply and open http://<atom-address>/ui in the browser. The device loads the full AmbiBack interface and connects with no further input. http://<address>/ is the simple page served by the device, which also works without internet.
  2. The wizard starts by itself the first time. Give the device a name, for example “Living room LEDs”.
  3. In the LEDs step enter the number of LEDs at the top and on the side, tap sides without LEDs and tap the corner where the strip starts.
  4. Check sides lights the sides white one after the other. If the wrong side lights up, the corner or the direction is wrong.
  5. In the Target step keep This device drives the LEDs. Finish with the Colour test: the LEDs must light up in the colour you pick.
LED layout on the drawn TV
LED layout on the Atom Lite

5. Place the camera

Camera in its holder on a shelf, connected with a USB-C cable
Camera prototype in the ball mount (tidied up with AI)

6. Connect the camera to the Atom Lite

  1. Open http://<camera-address>/ui. The wizard starts with the name again, for example “Living room camera”.
  2. If the picture is upside down or mirrored, correct it in the Camera step. Do not let it find the corners yet.
  3. In the Target step pick the Atom Lite. The camera looks for other AmbiBack devices on the network. It then shows Sends to and the name of the Atom Lite. Later you find this under TV → Connection → Colours go to.
  4. Set the mode under Light to Camera.

On the camera's simple page this is Camera → Send to with the button Search LED controllers. UDP is fine as the connection.

7. Set the corners of the TV

For the camera to know where the picture is, it needs the four corners of the screen.

Camera picture with the four corners of the TV
Camera picture with corners in the AmbiBack interface
Web page served by the AmbiBack device with camera picture, corner points and the corner detection button
The same on the simple page served by the device

Screenshots use a simulated device. Automatic corner detection is not yet confirmed on hardware.

If the search reports that the TV is not completely visible, realign the camera. Swapped sides point to a wrong start corner or direction in step 4.

8. Add Philips Hue (optional)

Hue runs through the Atom Lite. The firmware uses the Hue Entertainment API and creates its own entertainment area “AmbiBack” with the device ID.

  1. Open the interface of the Atom Lite from the device (http://<atom-address>/ui). From the HTTPS address on GitHub the browser often cannot talk to the Bridge.
  2. Under Device → Philips Hue enter the address of the Bridge or let it search.
  3. Press the round button on the Bridge and tap Pair within 30 seconds.
  4. Pick the lights and tap, for each light, which picture area it takes its colour from, for example left and right for two light bars beside the TV.
Philips Hue lights grouped by room
Hue lights by room (simulated device)

Philips Hue straight from the firmware is not yet confirmed on hardware. So far AmbiBack PC has been tested with a real Hue Bridge.

9. Fine-tuning

White balanceunder TV → Picture and exposure. Default, Cloudy and Sunny usually fit.
Flickerset flicker detection to 50 Hz if the room light flickers
Frame rate20 to 50 frames per second. More looks smoother.
Brightness and coloursunder Light: brightness, luminance, gain, colour strength and motion

The page on the AmbiBack interface explains the individual settings.

Problems

The Web Flasher finds no portTry another USB data cable and another port, on Windows install the CP210x or CH340 driver. More on the Web Flasher page.
The device does not join Wi-FiCheck name and password. Only 2.4 GHz networks work.
The LEDs stay darkCheck the arrow direction of the strip, data on GPIO 26, shared ground of power supply, strip and Atom Lite.
Wrong coloursThe strip must be a WS2812B or compatible (GRB order).
“Select the LED controller first”Set the camera's target first (step 6), then let it find the corners.
The light runs the wrong wayCorrect the start corner or direction on the Atom Lite and repeat Check sides.
Hue pairing failsOpen the interface from the device instead of GitHub, press the button on the Bridge and pair within 30 seconds.

Security: LED and mode control stay open on the local network, and the transfer is not encrypted. Only run the devices on a trusted network. More on the firmware page.

Join in

You rebuilt the setup? Every report helps, even “it works”. Write to me or report bugs on GitHub.