element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sensors Projects
  • Challenges & Projects
  • Project14
  • Sensors Projects
  • More
  • Cancel
Sensors Projects
Blog Spectrography using the epc901 High Speed Line Image Sensor
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Sensors Projects to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fmilburn
  • Date Created: 11 Nov 2020 1:41 AM Date Created
  • Views 10900 views
  • Likes 14 likes
  • Comments 40 comments
  • sensorsch
  • nucleo-l496zg
  • led
  • camera
  • spectrograph
  • spectroscope
  • cfl
  • espros
  • epc901
Related
Recommended

Spectrography using the epc901 High Speed Line Image Sensor

fmilburn
fmilburn
11 Nov 2020

We present a new camera board, firmware, software, and spectroscope of our own design using the ESPROS epc901 CCD line image sensor.

image

Background

 

In a recent Element14 blog The Planck Constant and the Relationship of Frequency to Photon Energy I estimated the peak emission wavelength of LEDs with an inexpensive spectroscope.  The instrument resolution was poor and relied on subjective measurements made by eye.  This resulted in an interest to develop an improved instrument.  After seeing the post my friend Adrian told me of his desire to develop a camera and asked if I wanted to collaborate on an improved design.  Of course I did!

 

Over the past two months we have developed a comprehensive design based on the ESPROS epc901 CCD line image sensor with the following features:

  • Relatively inexpensive $24 sensor and low overall cost
  • 1024 monochrome pixel resolution
  • High sensitivity
  • High frame rate
  • Easily programmed ARM Cortex-M4 STM32L496ZG-P Evaluation Board
  • Full featured firmware with Python user interface
  • Optional Arduino form factor shield
  • Multiple applications, including spectrometry
  • Resolution of 1 nm or better in visible and infrared spectrum
  • Hardware License: CERN Open Hardware License V2 – Permissive
  • Software License: MIT License

 

Assembly of the camera board does involve reflow of the 2x16 0.5 mm pitch BGA image sensor which appears quite fragile.  With care, several boards were assembled using a stainless steel solder stencil and an unmodified toaster oven.  The spectroscope is a straight forward design but does require a 3D printer.

 

Below we give additional information on the hardware, software, and various experiments done to date.

 

Camera Breakout Board

image

The KiCad project for the epc901 breakout board can be found here.

 

In addition to the image sensor and related passives, the breakout board also integrates an ADC.  The footprint and firmware are compatible with the Texas Instruments ADCS7476 and Analog Devices AD7476 which are 1 MSPS 12-bit ADCs with SPI-like interface.

Connection to the board is through a DIL 0.1 header.

The breakout board has space and mounting holes for a lens holder. The spacing between the mounting holes is 20mm. For full coverage, the lens should support 1/2.3" or larger sensors.

For our prototypes, we chose a M12 metal lens holder w/ 20mm hole spacing and a 25mm M12 lens for 1/2" sensors. In the US, a wide selection of lens holders and lenses can be found at M12 Lenses Inc.

Camera Adapter Board

image

The adapter board was designed in KiCad and the files can be found here.  It follows the Arduino Shield standard and could be mounted on any compatible microcontroller. The firmware was developed for the ST Microelectronics NUCLEO-L496ZGNUCLEO-L496ZG development board and would have to be adapted to other microcontrollers.

 

ST NUCLEO-L496ZG Firmware

The firmware for the NUCLEO-L496ZG used to control the epc901 breakout board is located here. The firmware was developed and built with the latest version of STM32CubeIDE (version 1.4.2 as of October 2020).

 

The firmware exposes a command shell over serial. The parameters of the serial connection are 115200 8N1.

A partial list of command capabilities include…

  • Help for all the commands
  • Direct register reads and writes
  • Reset of microcontroller, camera settings, and sensor
  • Set exposure time
  • Start and abort capture
  • Read from frame buffer
  • Configure burst captures
  • Enable / disable and control triggers

 

The complete list of commands and detailed capabilities can be found in the Github README.md file for the project and is not repeated here in order to avoid multiple locations that might require maintenance.

 

Python Library

 

There is a comprehensive and easy to use Python library that wraps the shell of the firmware into an easy to use API.

 

from epc901camera import Camera
camera = Camera()
camera.open("my serial port")
camera.setExposure(1000)
camera.capture()

pixels = camera.getPixels()
camera.close()

 

Three example scripts are provided for demonstrating interaction with the breakout board:

  • live.py displays output of the image sensor in real time
  • snap.py captures one image
  • burst.py captures a series of images in a burst

 

See the documentation for additional information on the command line arguments used in the Python examples.

Spectroscope

 

The prototype spectroscope has five major components: tube, diffraction grating, entrance slits, camera with lens, and base.

image

The spectrometer tube shown in Slide 1 has an internal baffle to block incoming light and slots on the ends to hold the diffraction grating and the sliding stainless steel plate with the optical slits.  We have experimented with length and the tube shown is well suited to observations in the visible spectrum. It is approximately 180 mm in length from the diffraction grating to the slits. A shorter tube allows a wider spectral field of view with the lens we are using.

 

The tubes were designed in Fusion 360 and printed on an Anycubic I3 Mega printer using black PLA filament.  The STL files are available here for those who would like to print their own.

image

We used a 1000 lines/mm linear diffraction grating in a 35 mm photographic slide type mount which are widely available on Amazon, eBay, and from educational vendors. A package of ten can be bought for $10 USD.  Higher quality glass slides are also available.

image

Our design for the optical slits as shown on Slide 3 was laser cut into a stainless steel slide by OSH Stencils, a US based company that fabricates stencils for applying solder to PCB boards. The slits are 0.5, 0.25, 0.1, 0.05, and 0.0254 millimeters in width.

image

The camera is shown above mounted on the breakout board which is then attached to the adapter board and the microcontroller.  As previously mentioned we are using 25mm M12 fens for 1/2" sensors that has worked well for capturing images in the visible and near visible spectrum.

image

The wooden base in Slide 5 was constructed for easy camera alignment and to hold the components securely.  The camera and diffraction grating can be further shielded from extraneous light with cloth or paper during use.

 

Usage: Setting up the Spectroscope

 

The following video demonstrates how to align the camera with the spectroscope, focus, and expose frames.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Usage: Calibrating the Spectroscope

 

In this video the method for calibrating the x axis of the spectroscope in the visible range with a compact fluorescent lamp (CFL) is demonstrated.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Usage: Determining Peak LED Wavelength

 

The following video demonstrates how to measure the peak wavelength of a LED and compares it to the manufacturer’s datasheet.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Usage: LED Wavelength with Varied Forward Voltage

 

This experiment illustrates how the wavelength of a blue LED varies with the forward current through the LED.  In a previous element14 Blog that used LEDs to estimate the value of Planck’s constant this behavior was identified as an issue but the apparatus to do an evaluation was not available.

 

Below we determine how a blue Lite-On LTL2V3TBS3KS behaves as the current is increased.  For this experiment we used a Tenma 72-2685Tenma 72-2685 bench power supply to supply a constant voltage, a Tenma 72-1020Tenma 72-1020 bench multimeter to measure current, and the epc901 spectroscope.

 

Before beginning the experiment the spectroscope is calibrated and the LED arranged so that it is axially aligned with the slit in the spectroscope.  As measurements are taken the exposure is adjusted for the peak brightness to land at approximately 2000 – this allows the resulting spectrograms to be aligned and compared easily.  We started the measurements at 2.6V which resulted in a forward current of 2.5 mA. The following procedure was then used:

  1. Save the spectrogram and record the forward voltage, forward current, and peak wavelength
  2. Adjust the forward voltage up by 50 mV
  3. Adjust the exposure to give 2000 counts
  4. Return to step 1 if the forward current is less than the LED max current (or the LED burns out)

 

The results are shown in the graph below.

image

The range shown in the graph is 2.5 mA (Vf = 2.6 V) to 28.4 mA (Vf = 3.1 V) at 100 mV intervals.  The peak wavelength shifted from 474 nm to 471 nm over this range, a 3 nm shift.  As a comparison, Maxim shows a 472 nm to 469.7 nm shift (2.3 nm) in the plot of an unspecified blue LED in their application note 3070.

 

Usage: High Speed Analysis of a CFL Lamp

 

In this experiment the high-speed capabilities of the epc901 are demonstrated by examining the flicker and changing emissions from the phosphor of a compact fluorescent lamp (CFL). The experiment was inspired by a YouTube video from the commercial spectrometer manufacturer Ocean Insight.

 

A CFL works by driving an electric current through Argon with a small amount of Mercury inside the tube. The resultant ultraviolet light excites the coating on the tube (called phosphor) and emits visible light.  There are numerous variations in the CFLs manufactured over the years.  Some newer ones may have ballast refresh rates on the order of 10 kHz or greater and depending on the ballast the experiment described here would not work show the same effect with them. 

 

Our lamp has a very discernible 120 Hz frequency as a result of the 60 Hz frequency of AC mains in the United States as shown in the short video below. This animation was created by capturing a burst of 100 images in 150 milliseconds, resulting in approximately 5.5 spectrograms per 120 Hz cycle.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Three of the stronger emission lines visible in the spectrogram of a CFL come from Mercury and Europium and that is what is examined in the plot below.

image

There is a delay in the emissions of Europium compared to the two emission lines from Mercury.  If the strength of the emissions as recorded by the camera for Europium 611.6 nm are plotted against that of Mercury 546.5 nm we see that the two are “out of phase” or stated differently the Europium lags behind Mercury:

image

We theorize that the phosphor continues to glow for some period after the peak Mercury ultraviolet emission drops and then lags behind as the Mercury emissions increases.

 

Summary

 

We have demonstrated a camera board complete with firmware and easy to use software that performs comparably to instruments costing in the $1000 range and can be built for less than $100.  The camera features a high frame rate in the hundreds of frames per second. Resolution is sufficient to achieve 1 nm detail in our spectroscope with calibration.  The instrument is easy to calibrate and the software allows powerful analysis.  While our demonstrations were specific to spectroscopy the camera might also be used for reading bar codes, scanning, determining linear position, and so on.

 

The design, fabrication, firmware, and software files are linked below and have lenient licenses.

 

This was a joint project with the largest contribution coming from my friend Adrian.  He did the real work in hardware design and assembly, and completed the software development in just a few weeks.  Incredible!  We have enjoyed the project and believe the camera has enthusiast, educational, and practical product application.

 

Do you have ideas for other uses?  All comments appreciated!

 

Links

epc901, ESPROS Photonics Corporation: https://www.espros.com/photonics/epc901/

Hardware and software repository of our project: https://github.com/astuder/epc901

  • Sign in to reply

Top Comments

  • astuder
    astuder over 4 years ago in reply to shabaz +6
    Here you go: I used the trigger function of the firmware to record the spectrum of the CFL during turn on (cold lamp), while running (after warming up for a while), and during turn off. Below the plots…
  • shabaz
    shabaz over 4 years ago in reply to astuder +5
    That's perfect, thanks! Just some initial playing with it.. can clearly see the 120 Hz output light ripple. I'm going to look for other ways to display it a bit better : )
  • shabaz
    shabaz over 4 years ago in reply to astuder +5
    I had a bit more of a play with the data today, this was the normal 2D plot plus the waterfall: Then I tried looking at the log of the data, as a basic attempt to look closer in the noise. One interesting…
  • JWageM
    JWageM 10 months ago

    Nice project! Where/how can I order the circuit boards (the adapter board and the breakoutboard)? 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • MinhNguyen_xOrbita
    MinhNguyen_xOrbita over 1 year ago

    Hey Frank, super interesting project. I know it's been a while since you posted but I was actually thinking of building one of these. I think an interesting application is using it to identify the physical properties of objects. Maybe coding the sensor to recognize certain wavelengths being a specific material.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • astuder
    astuder over 2 years ago in reply to Richard_D

    Sorry for the late response.

    Besides the limitation of the sensor, the max frame rate is a function of the resolution (1024 pixels, less with binning) and the speed of the ADC you use. Our project uses a cheap 1 MSPS ADC, so at full resolution it's limited to a frame rate of approx. 970 Hz (1MSPS / 1024 pixels). For 47 kHz at 1024 pixels you'd need a 50 MSPS ADC, plus an MCU that can handle the amount of data.

    Also note to achieve higher frame rates, exposure times have to be very short (~20us or less for 47 kHz), which means you need a lot of light. In addition, higher read out speed seems to significantly impact the sensor's SNR, see section 3.6, table 2 in the datasheet.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Richard_D
    Richard_D over 2 years ago

    Hi fmilburn,thank your team desgin and share EPC901 spectrometer ,this great project for me.I am repeating this project. I want to know whether the frame rate of epc901 can really reach 47khz (FPS) mentioned in the data manual, which is very important to me. Thank you

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • astuder
    astuder over 4 years ago in reply to shabaz

    Beautiful plots! Thanks for sharing the code. Looks a lot simpler than using Matplotlib. image

     

    I turned the lamp on with the switch on a cheap power strip, so there may be some switch bouncing. On the other hand, the deep dip seems to align with the subsequent 120 Hz cycles.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube