Will Whang's Solar Photography Setup Links Custom Camera Boards to a Raspberry Pi Compute Module 4

Using custom open-hardware image sensors and a compact carrier and control board, this impressive creation captures the sun in detail.

ghalfacree
about 1 year ago • Photos & Video / HW101

Developer Will Whang has turned a Raspberry Pi Compute Module 4 system-on-module (SOM) and a pair of chunky CMOS imaging sensors into a solar-tracking camera for capturing stunning shots of eclipses and more.

"Solar imaging has been a passion of mine since my school days. The sight of the mighty sun temporarily obscured, and events like the Venus transit, has always left me in awe," Whang writes. "Whenever I have the chance to explore solar imaging, I’m on the lookout for imaging system to capture these celestial moments. In 2020, during a two-week COVID-19 quarantine at a hotel, I embarked on a project to construct a solar tracking camera."

This unassuming box is the driving force behind a solar camera designed for stunning photography and videography of our nearest celestial neighbor. (📷: Will Whang)

That project took a Raspberry Pi 4 single-board computer and the Raspberry Pi HQ Camera Module — an alternative to the standard Raspberry Pi Camera Module which offers higher resolution captures and support for interchangeable lenses — and turned them into an camera system capable of keeping track of the sun's procession across the sky while capturing images all the while.

For this year's eclipse, though, Whang wanted to upgrade his 2020 system for even better performance — dropping the Raspberry Pi 4 for its system-on-module variant, the compact Raspberry Pi Compute Module 4 (CM4). This mates into a custom-built carrier board, designed to keep the footprint low, which includes four-lane MIPI Display Serial Interface (DSI) and Camera Serial Interface (CSI) connectors — and a CompactFlash Express (CFexpress) board for high-speed storage.

"CFexpress essentially combines PCIe [PCI Express] with 3.3V power and some card insertion signals. It’s relatively straightforward to make it work with [the] CM4 since it functions as a PCIe device," Whang explains. "However, the challenge arises when swapping cards while the system is live. CM4 doesn’t support PCIe hot-swapping. However, a workaround involves unloading the driver in Linux to eject the card, using the insert signal to load the driver, or re-scanning the PCIe device. By incorporating a button to eject the card and connecting the insert signal to CM4, I’ve achieved nearly everything I desired without PCIe hot-plug."

The camera captures stunning images of our sun, in far more detail than was possible with earlier builds. (📷: Will Whang)

A custom controller board with a WCH CH32V003 RISC-V microcontroller takes care of interface work, offering encoders for adjusting the camera's gain and shutter speed, buttons for triggering recordings "and other functions yet to be defined," while also providing an Ethernet plug and Power-over-Ethernet (PoE) support. There's also a real-time clock in the build, and a six-axis gyroscope and accelerometer sensor — "though," Whang admits, " I don't quite remember why I added the latter."

The two boards are housed in a custom-built 3D-printed enclosure along with a choice of two imaging sensors, both upgrades from the Raspberry Pi HQ Camera Module which drove the first-generation build: OneInchEye, built around the Sony IMX283 20-megapixel one-inch sensor; and StarlightEye, which uses the IMX585 eight-megapixel 1/1.2" sensor with improved low-light performance.

On the software side, the libcamera-based Cine Pi is used to record videos as RAW DNG files — hence the need for high-performance storage, courtesy of a CFexpress to M.2 adapter and a pair of high-performance solid-state drives (SSDs.)

The build was used to capture the 2023 partial eclipse — though cloudy weather conspired against Whang. (📹: Will Whang)

All of this is connected to a LUNT LS60MT, a telescope specifically designed for solar observation — and upgraded with a motorized focus system built using a serial-controlled stepper motor. Finally, the whole kit and caboodle is mounted on a commercial motorized mount which is driven using OpenCV — tracking the solar disk from the camera's preview stream and deriving the correction movements required to keep it in-shot.

The full project is written up in detail on Whang's website, along with a discussion on a future upgrade to the Raspberry Pi 5 or a possible Compute Module 5 as and when one is released; Whang has also released the designs for OneInchEye and StarlightEye on GitHub under the permissive MIT license.

ghalfacree

Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.

Latest Articles