A single row of 3,648 pixels isn’t a conventional camera, but getting that row to deliver usable measurements is a substantial part of a scanning-imaging experiment. Esben Rossel’s Linear CCD module on Hackaday.io pairs a TCD1304 sensor with an STM32 microcontroller, leaving a computer or optional Raspberry Pi to set integration time and display the data. The project was developed as part of Rossel’s Otter DIY Raman Spectrometer; its appeal for photography lies in the sensor interface, not in a finished camera system.
Created on February 23, 2016, the project has supplied log excerpts extending through August 26, 2023. Those updates show how much the usefulness of a sensor can change without replacing the sensor itself: better communication and software made the same line of pixels easier to watch and work with.
Hardware timers handle the awkward pulses
The TCD1304 needs three coordinated signals: a master clock, a shift-gate pulse and an integration-clear-gate pulse. Their timing governs exposure and the transfer of pixel charges into the sensor’s readout register. Some of the required delays are measured in hundreds of nanoseconds—not a job to leave to a desktop application.
In the original Nucleo F401RE implementation, STM32 hardware timers generate those signals. Once configured, they don’t require the processor to keep toggling pins in software. The user still has to choose compatible periods: Rossel specifies that the integration-clear-gate period must be a multiple of the shift-gate period.
With the project’s default 2 MHz master clock, pixel values emerge at 500,000 per second. The microcontroller’s ADC performs 12-bit conversions, and DMA moves those readings into a 16-bit array. Another DMA-assisted transfer can send the data to a Raspberry Pi over SPI; a UART route through the Nucleo’s ST-link connection supports a regular computer instead.
There’s also a small but important interpretive wrinkle: the output runs backwards from an intuitive brightness scale. Rossel gives roughly 3 V for a dark pixel and 1.5 V for a bright one. Lower voltage means more light, so a raw trace needs to be read accordingly.
A faster connection makes live view more useful
Sensor clock speed and the rate at which a computer updates its plot are different limits. The project’s later revisions make that distinction tangible.
In the April 8, 2019 live-view update, Rossel reported just over one update per second through the Nucleo F401’s UART path, compared with up to 9.5 Hz using an STM32F103 with direct USB. Moving serial communication into a separate thread also kept the Python GUI responsive during long integrations.
That cheaper F103 “blue pill” version came with a tradeoff: its March 3, 2019 firmware description limits integration time to 82 ms. It wasn’t simply an interchangeable faster connection for every measurement.
The latest supplied entry, dated August 26, 2023, describes rewritten firmware for the STM32F401 “black pill.” Rossel reported live-view rates above 10 Hz, against 1.4 Hz for the UART firmware. That version uses low-level drivers for timers, ADC, DMA and GPIO, with HAL handling the USB virtual COM port. It’s a reported improvement in live-view cadence, not evidence of a complete scanning camera running at that rate.
A scanning camera still needs more than a working sensor
People following the project explicitly asked about assembling photographs from successive lines during motion. In a May 14, 2017 reply, Rossel considered that plausible and recommended the Raspberry Pi connection to reduce transfer time. He also flagged the TCD1304’s 8 × 200 µm pixels: these are long rectangles, not square picture elements.
For a camera experiment, that geometry makes the relationship between optics, scan movement and line spacing important. Simply stacking the measurements into an image would not, by itself, establish correct proportions or equal detail in both directions. The visible discussion proposes the application; it doesn’t demonstrate a completed camera.
Rossel directs builders to the TCD1304 project site for firmware, software and updated instructions. The useful starting decision is to match a board and firmware version to the exposure time and transfer rate the experiment needs. For photography, the next milestone is then concrete: coordinate movement with line acquisition and test image proportions. This module tackles the precise electrical timing; the scanning mechanism must supply the spatial timing.
Source: Linear CCD module