Beautiful Photograph of a Robot’s Path Lit by LEDs

A popular photographic trick is to leave the camera’s shutter open in a dark room to create an image illuminated by colored LEDs, lasers, sparklers, and flashlights. Classically, long-exposure subjects include the sun (solargraphy), stars (astrophotography), swinging objects (physiograms), and time-lapse automobiles in traffic. The more recent trend is to show glowing halo traces, light writing, swirls, or magic powers shooting from the hands of a person.

This technique is also applicable to robots, whose indicator LEDs not only produce attractive glowing trails, but can also be analyzed to debug and improve movement algorithms. The example is this article is my recreation of a stunning photograph that Mike Davey took of his line-following robot many years ago.

Sandwich line-following robot long exposure

Sandwich line-following robot long exposure.

The photograph above captures the light trails of a line-following robot driving around a course with straightaways, left turns, and right turns. It was taken in a dark basement, with slight ambient light seeping from the windows so that the white line marking the course would gradually expose. I used a Lumex DMC-GH1 digital camera set to manual mode with a 25 second shutter at ISO 100.

Normally, you want bright lighting and a short shutter to avoid blurring due to movements of the subject. With long-exposure photography you want the very opposite. If the room is too well lit, you'll end up with a worthless blank white picture. You need the room to have just enough light to gradually accumulate in the camera sensor as it bounces off the stationary objects, while bright pinpoint light sources (such as LEDs) are strong enough that even brief activation provides colorful hotspots and streaks.

Some experimentation is necessary to balance shutter speed versus ambient lighting.


Sandwich is a simple line-following robot with a variety of LEDs:

Sandwich modified with Attiny45 microcontroller and blue heartbeat LED

This version of Sandwich had its comparator brains removed and replaced with an Atmel Attiny45 microcontroller. Besides driving the robot, the microcontroller toggles the blue LED between on and off every half a second. Furthermore, the microcontroller was hardcoded to stop the robot after about 12 seconds, so that the robot’s body would be stationary long enough to be exposed in the photo.

Photographic Analysis

Besides being lovely to look at, what does the photograph reveal about the robot?

Long exposure photo of robot with LEDs to indicate circuit behavior

Long exposure photo of robot with LEDs to indicate circuit behavior.

  1. In the straightaways, both motors are powered on, as indicated by both red and green side LEDs being lit.
  2. When turning right, only the left motor is given power, as indicated by the opposite-side LED (green) being lit. If I built a new robot from scratch for this type of photography, I would have put the LEDs on the same side as the motor receiving power.
  3. When turning left, only the right motor is given power, as indicated by the opposite-side LED (red) being lit.
  4. The blue LED is turned on for half a second. The longer the line, the faster the speed. Notice that the blue line isn’t centered, which shows that the robot has veered off a bit.
  5. The blue LED is turned off for half a second. The longer the gap, the faster the speed.
  6. The blue LED line is nicely centered over the white track line, and the red and green LEDs are both lit, indicating excellent centering and straight driving in the straightaways. (The blue line is double length in this photo, because the robot overlapped this section of track before stopping for exposure.)

There are light ghostly blue vapors on the inside and outside of the lines around the tracks. These are the sensor headlight white LEDs. White LEDs are actually blue LEDs with phosphor. Newer white LEDs wouldn’t give off so much of a blue glow.

You can also make out a faint black grid. The course is made of individual tiles (four across and three down). The black lines are the slight gaps and edges between tiles.

Long Exposure Camera Setup

To assist you in making your own open shutter exposures, here is the setup I used:

Long exposure photo setup with camera on tripod

Long exposure photo setup with camera on tripod.

The camera is attached to a tripod facing down on the line-following track. It is absolutely essential that the camera doesn’t move while the shutter is open, or you'll end up with unintentional trails and blurring due to the motion of the camera. No, you can’t hold the camera “really still” in your hands for 30 seconds.

Lumix DMC-GH1 mode dial on manual

Lumix DMC-GH1 mode dial on manual.

Exact instructions for controlling shutter speed will differ from camera to camera. For the Lumex GH1, the mode dial needs to be set to “Shutter Priority” (S) or “Manual” (M) mode. Manual mode includes the ability to control the opening and closing of the shutter manually (called “bulb”), rather than automatically timed.

Lumix GH1 front dial

Lumix GH1 front dial.

When in the correct mode, the actual shutter speed is adjusted with the front dial. Values of one second or longer have a closing curly quote mark (”) instead of “s” for seconds. Values below one second do not have a mark.

Lumix GH1 manual mode 50 second long exposure

Lumix GH1 manual mode 50 second long exposure.

Lumix GH1 manual mode bulb long exposure

Lumix GH1 manual mode bulb long exposure.

Although I ended up using a 25 second timer, the bulb value (B) lets you open the shutter by pressing the shutter button and close it upon release. Of course, your finger is going to get tired continuing to hold the button down to keep the shutter open. Also, you'll end up wiggling the camera unless you use a detached remote shutter control.

Taking the Long-Exposure Picture

The camera will be unable to focus in the dark. Therefore, you need to get the focus set before turning off the lights. With the lights on, I auto-focused the camera on the subject and then switched to manual focus.

Lumix DMC GH1 focus knob on manual

Lumix DMC GH1 focus knob on manual.

Next, I turned off the lights.

I started the robot on the course. When the robot reached the desired location on the bottom straightaway, I pressed and released the remote shutter button. The camera opened the shutter to begin exposing the sensor to the meager ambient lighting, and well as the moving bright LEDs.

After completing a lap, which was about halfway through the camera timer, the robot stopped in place to allow the body to be exposed to the camera sensor. (When creating light writing and other fun images, the human beings with LEDs in their hands never stop moving, to avoid being seen in the final image.) Eventually, the camera timer ended and the shutter automatically closed, preventing further exposure of the sensor to the light.

I didn’t calculate the 25 total seconds and 13 seconds of robot body exposure. Instead, it took several dozen attempts to find the correct timing for these particular conditions. With patience, experimentation, and adjustment, I have no doubt that you'll be generating even more interesting long-exposure photographs!