Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| notes:taking-a-picture [2026/11/30 06:16] – Add taking a picture sam | notes:taking-a-picture [2026/11/30 07:35] (current) – [Improvements for Version 2] sam | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| I recently took a class in PCB design. For my final project, I decided to take a picture with the ESPROS EPC901, which is a 1024x1 pixel CCD image sensor which you can buy in single quantities from DigiKey. | I recently took a class in PCB design. For my final project, I decided to take a picture with the ESPROS EPC901, which is a 1024x1 pixel CCD image sensor which you can buy in single quantities from DigiKey. | ||
| - | {{camera-images: | + | {{notes: |
| + | |||
| + | <WRAP lo> | ||
| + | The EPC901 has a tiny and extremely lightweight BGA package. | ||
| + | </ | ||
| The image sensor is unusual since it has a single column of pixels (as opposed to the image sensor in, say, your cell-phone which has a 2-D matrix of pixels). The aspect ratio of the sensor made me think of [[https:// | The image sensor is unusual since it has a single column of pixels (as opposed to the image sensor in, say, your cell-phone which has a 2-D matrix of pixels). The aspect ratio of the sensor made me think of [[https:// | ||
| Line 9: | Line 13: | ||
| In fact, you don't need a special camera to create a strip photograph. I produced the following image by taking a video with my cell-phone camera and using a Python script to overlap the video frames such that each frame has been shifted by the speed of the train divided by the frame rate. | In fact, you don't need a special camera to create a strip photograph. I produced the following image by taking a video with my cell-phone camera and using a Python script to overlap the video frames such that each frame has been shifted by the speed of the train divided by the frame rate. | ||
| - | {{camera-images: | + | {{notes: |
| There' | There' | ||
| Line 15: | Line 19: | ||
| To keep things as simple as possible, I decided to use a pinhole to project the image onto the image sensor. A motor will be used to rotate the image sensor and the pinhole through the scene while the image sensor continuously captures pictures. Once the capture is complete, the individual columns can be concatenated to form the final image. | To keep things as simple as possible, I decided to use a pinhole to project the image onto the image sensor. A motor will be used to rotate the image sensor and the pinhole through the scene while the image sensor continuously captures pictures. Once the capture is complete, the individual columns can be concatenated to form the final image. | ||
| - | {{camera-images: | + | {{notes: |
| + | |||
| + | <WRAP lo> | ||
| + | The sensor and optic rotate through the scene, capturing a series of images which are horizontally concatenated to form the final image. | ||
| + | </ | ||
| ===== Hardware Design ===== | ===== Hardware Design ===== | ||
| Line 25: | Line 33: | ||
| The EPC901 can be configured both by pull-up/ | The EPC901 can be configured both by pull-up/ | ||
| - | {{camera-images: | + | {{notes: |
| + | |||
| + | <WRAP lo> | ||
| + | The main hardware components of the camera. | ||
| + | </ | ||
| Most of the inputs to the EPC901 are easy to drive via the SAMD21. There are lots of pins, but only '' | Most of the inputs to the EPC901 are easy to drive via the SAMD21. There are lots of pins, but only '' | ||
| Line 33: | Line 45: | ||
| The time to read an image is limited by the microcontroller' | The time to read an image is limited by the microcontroller' | ||
| - | {{camera-images: | + | {{notes: |
| + | |||
| + | <WRAP lo> | ||
| + | The image sensor is attached to a daughter board by FFC cable so that it can rotate during image acquisition. (A pinhole and additional light-blocking tinfoil covers the sensor during normal operation.) | ||
| + | </ | ||
| The microcontroller is also limited by its onboard RAM. A monochrome 1024x1024 image with 8 bits per pixel is 1 MiB – already too much to statically allocate in the SAMD21' | The microcontroller is also limited by its onboard RAM. A monochrome 1024x1024 image with 8 bits per pixel is 1 MiB – already too much to statically allocate in the SAMD21' | ||
| Line 47: | Line 63: | ||
| The 5-way button pad is used to adjust the camera' | The 5-way button pad is used to adjust the camera' | ||
| - | {{camera-images: | + | {{notes: |
| + | |||
| + | <WRAP lo> | ||
| + | The main board of the camera with LCD at center and the 5-axis button pad on the upper right. | ||
| + | </ | ||
| ===== Software Design ===== | ===== Software Design ===== | ||
| Line 104: | Line 124: | ||
| The below is the most successful image I acquired with the line camera: | The below is the most successful image I acquired with the line camera: | ||
| - | {{camera-images: | + | {{notes: |
| + | |||
| + | <WRAP lo> | ||
| + | An image through a four-pane window, looking onto the roof of another building with a large tree next to a smaller, more distant tree in the background. | ||
| + | </ | ||
| The image has several flaws, the most noticeable of which are probably the random black pixels. I believe these are due to SRAM write errors caused by poor adherence to the chip's timing requirements, | The image has several flaws, the most noticeable of which are probably the random black pixels. I believe these are due to SRAM write errors caused by poor adherence to the chip's timing requirements, | ||
| Line 110: | Line 134: | ||
| The main issue with the image (in my opinion), however, is that it's not a panorama. In fact, the above image is just a thin vertical slice of the camera' | The main issue with the image (in my opinion), however, is that it's not a panorama. In fact, the above image is just a thin vertical slice of the camera' | ||
| - | ==== The Motor Issue ==== | + | ==== A Motor Issue ==== |
| + | |||
| + | {{notes: | ||
| + | |||
| + | <WRAP lo> | ||
| + | On the left, the camera after a larger motor had been added. Compare right, the motor controller under a microscope, and with my thumb. | ||
| + | </ | ||
| - | {{camera-images: | + | In order to capture a frame, the image sensor needs to sweep across the scene. To do this, the camera uses a motor which spins the sensor on its axis. The duration of this spin needs to be //slow// enough that the image sensor has time to capture sufficient frames to form a complete image. If the motor is too fast, the angular resolution will be small because not enough frames were captured for every degree of motion. If the motor is too slow, we won't capture a wide angle, but we'll have high angular resolution. |
| I used a tiny geared DC motor to spin the sensor. This tiny motor wasn't geared down as much as was probably necessary, and so the image sensor made a speedy sweep across the scene during each acquisition. Sampling as fast as possible, it was not possible to capture more than a fraction of the scene. | I used a tiny geared DC motor to spin the sensor. This tiny motor wasn't geared down as much as was probably necessary, and so the image sensor made a speedy sweep across the scene during each acquisition. Sampling as fast as possible, it was not possible to capture more than a fraction of the scene. | ||
| Line 125: | Line 155: | ||
| * The motor issue could be solved by sampling faster. The SAMD21 is a little under-powered for the task of sampling from the EPC901. A better design might include a stand-alone ADC with faster sample rate, and a microcontroller which can handle the increased data rate. Of course, there is a limit to how much faster we can sample, because we still need to allow time to expose the image sensor on each frame. | * The motor issue could be solved by sampling faster. The SAMD21 is a little under-powered for the task of sampling from the EPC901. A better design might include a stand-alone ADC with faster sample rate, and a microcontroller which can handle the increased data rate. Of course, there is a limit to how much faster we can sample, because we still need to allow time to expose the image sensor on each frame. | ||
| - | * The motor issue could also be solved by choosing a more appropriate motor, or by doing away the motor altogether. One attractive | + | * The motor issue could also be solved by choosing a more appropriate motor, or by doing away the motor altogether. One solution is to use a purely mechanical system, probably involving a spring and a damper, to rotate the sensor, and potentially an encoder to compensate for any nonlinearities in the motion. The motor and its controller are the most power hungry components of the system, and big contributors to noise, so removing them would simplify things. |
| - | Secondly, the user interface could be somewhat | + | Secondly, the user interface could be improved. I' |