This project presents a simple demo of TCD1304AP CCD linear array sensor readout. TCD1304AP is high sensitivity CCD sensor with an array of 3648 light sensitive pixels. This CCD sensor generates analog output and it can be easily connected to microcontroller (MCU) using only few interface lines and minimal to none additional components. However, data rate at analog output is relatively high so it is wise to use more powerful or higher performance MCU with high operating frequency. TCD1304AP CCD sensor can be used for building spectrometers, bar code scanners, range finders, etc.
In this demo project mini-32 for PIC32MZ small development board from Mikroelektronika is used for sensor readout. This board has a high-performance PIC32MZ EF series MCU which is fully supported by the MPLAB® Harmony integrated software framework. More precisely board contains PIC32MZ1024EFH064 MCU with 1MB flash, 512KB SRAM memory, core performance of up to 200 MHz and number of peripheral options. In addition to the mini-32 for PIC32MZ, OPA340PA rail-to-rail operation amplifier is used for sensor analog signal conditioning.
Firmware provided below is built using MPLAB Harmony framework. Firmware is built around timer modules using only few lines of code (in image gallery below oscilloscope screenshots of important signals obtained during development are provided). Upon power up MCU starts data acquisition from TCD1304AP sensor. Acquired data can be transferred to PC using USB peripheral configured in CDC mode (COM port emulator with 256000 baud rate). If “GET” string is received by MCU, data transfer is initiated. Using “SET” command followed by 4 bytes sensor integration time, vertical resolution (number of bits per pixel) and number of measurement points (pixels) can be set. First two bytes represent integration time (valid range 1-65535), third byte represents horizontal resolution (valid 0-5), while fourth byte is vertical resolution (valid range 0-3). For acquired sensor data visualization and configuration LabVIEW virtual instrument is provided below.
Demo project is built using following ecosystem: