Using Parallax TSL1401-DB Linescan Camera Module For Line Detection
Using Parallax TSL1401-DB Linescan Camera Module For Line Detection
Using Parallax TSL1401-DB Linescan Camera Module For Line Detection
Contents
1 Introduction 1 Introduction.................................................................1
This application note explains how the Parallax TSL1401-DB 2 Camera signal interpretation.......................................2
camera works and how it can be used for the specific 3 Signal processing........................................................3
application of following a line for the Smart Car Race 4 Software/Driver description........................................5
competition. This document includes tips and refers to the
5 AO signal processing implementation........................8
example code on how to process the signal from the camera on
the MPC5604B microcontroller (MCU); the example code can 6 Conclusion................................................................16
be downloaded as AN4244SW from https://
www.freescale.com. The Parallax TSL1401-DB LineScan
Camera Module consist of a CMOS linear sensor of 128 pixel
array and a mounted lens of 7.9 mm, these provide a field of
view equal to the subject distance. Some of the advantages of
using this camera are the following:
• Simple and easy to use
• Frequency of capture can be manipulated by the user
• Enough definition for line following application
• Removable and interchangeable lens for different
resolutions
Expander Daughter board-to-SIP” or the “Parallax Stamp 2pe Daughter board Extension Cable” was found. These were
found as the easiest to use from https://www.parallax.com.
NOTE
Rev 0 of this application note provides only the drivers as explained in the example code. A complete
example using these drivers will be provided in the next revision of the application note.
Using Parallax TSL1401-DB Linescan Camera Module for line detection, Rev. 0, 01/2011
2 Freescale Semiconductor, Inc.
Signal processing
Because the camera is using a linear sensor it is impossible to gain a full view of the panorama in a single shot, therefore it
only takes one line of the full panorama as shown in the next image. Here, the line to be captured is completely dependent on
the distance to the lens as shown in Figure 2. Finally this image is released in an analog signal as shown in Figure 3.
3 Signal processing
For normal operation of the camera, the user needs to take care of the following signals only:
• CK (clock)
• SI (serial input)
• AO (analog output)
Using Parallax TSL1401-DB Linescan Camera Module for line detection, Rev. 0, 01/2011
Freescale Semiconductor, Inc. 3
Signal processing
Using Parallax TSL1401-DB Linescan Camera Module for line detection, Rev. 0, 01/2011
4 Freescale Semiconductor, Inc.
Software/Driver description
4 Software/Driver description
SI and CK input pulse implementation
Generation of SI and CK input pulses is implemented through Driver_Linear_Cam.c.
Using Parallax TSL1401-DB Linescan Camera Module for line detection, Rev. 0, 01/2011
Freescale Semiconductor, Inc. 5
Software/Driver description
Using Parallax TSL1401-DB Linescan Camera Module for line detection, Rev. 0, 01/2011
6 Freescale Semiconductor, Inc.
Software/Driver description
It is possible to change the lens of the camera. To search for the correct lens look for them as “Board camera lens” you will
find the angle of view is measured in millimeters, which corresponds to the focal length. The angle of view depends on the
focal length and the image plane (Figure 9); for the Parallax image sensor the image plane is of 1/3” so be sure to take this
last number in count while making your decision.
Using Parallax TSL1401-DB Linescan Camera Module for line detection, Rev. 0, 01/2011
Freescale Semiconductor, Inc. 7
AO signal processing implementation
Using Parallax TSL1401-DB Linescan Camera Module for line detection, Rev. 0, 01/2011
8 Freescale Semiconductor, Inc.
AO signal processing implementation
Using Parallax TSL1401-DB Linescan Camera Module for line detection, Rev. 0, 01/2011
Freescale Semiconductor, Inc. 9
AO signal processing implementation
Using Parallax TSL1401-DB Linescan Camera Module for line detection, Rev. 0, 01/2011
10 Freescale Semiconductor, Inc.
AO signal processing implementation
To obtain the values of line width and position of the line for the high level algorithm it is necessary to call functions
u16_LineWidth() and u16_Center(). These are just return functions for the u16LineWidth and the u16Center variables.
Table 5. Advantage and disadvantage of external filtering and eMIOS IPWM
Advantage Disadvantage
Fast and easy process for the MCU Needs external analog processing
ADC module is free for other applications Have many calibration conflicts
Using Parallax TSL1401-DB Linescan Camera Module for line detection, Rev. 0, 01/2011
Freescale Semiconductor, Inc. 11
AO signal processing implementation
Figure 10. Processing with ADC and CTU the AO input signal
Using Parallax TSL1401-DB Linescan Camera Module for line detection, Rev. 0, 01/2011
12 Freescale Semiconductor, Inc.
AO signal processing implementation
Using Parallax TSL1401-DB Linescan Camera Module for line detection, Rev. 0, 01/2011
Freescale Semiconductor, Inc. 13
AO signal processing implementation
Using Parallax TSL1401-DB Linescan Camera Module for line detection, Rev. 0, 01/2011
14 Freescale Semiconductor, Inc.
AO signal processing implementation
Using Parallax TSL1401-DB Linescan Camera Module for line detection, Rev. 0, 01/2011
Freescale Semiconductor, Inc. 15
Conclusion
6 Conclusion
As mentioned before, the first implemented method has two advantages and two disadvantages; from these, calibration is a
big issue as light (used as reference) is a variable dependant on the environment. So, bad illumination, shadows, etc, will be
factors that make this task difficult. On the other hand, if the user can fix this calibration issue, the advantages make this
method the best option. The second method is more comfortable because external processing is not necessary and will not
face calibration issues. The only problem is the use of the ADC which means throughput is added to the application; this can
pose a problem depending on the rest of the tasks and sensing stuff the user may require for other processes. Based on the
above implementations and after using the camera signal processing feature of MPC5604B MCU, the user can notice the
huge capabilities this family of microcontrollers offers.
Using Parallax TSL1401-DB Linescan Camera Module for line detection, Rev. 0, 01/2011
16 Freescale Semiconductor, Inc.
How to Reach Us: Information in this document is provided solely to enable system and sofware
implementers to use Freescale Semiconductors products. There are no express or implied
Home Page: copyright licenses granted hereunder to design or fabricate any integrated circuits or
www.freescale.com integrated circuits based on the information in this document.
Freescale Semiconductor reserves the right to make changes without further notice to any
Web Support: products herein. Freescale Semiconductor makes no warranty, representation, or
http://www.freescale.com/support guarantee regarding the suitability of its products for any particular purpose, nor does
Freescale Semiconductor assume any liability arising out of the application or use of any
USA/Europe or Locations Not Listed: product or circuit, and specifically disclaims any liability, including without limitation
Freescale Semiconductor consequential or incidental damages. "Typical" parameters that may be provided in
Technical Information Center, EL516 Freescale Semiconductor data sheets and/or specifications can and do vary in different
applications and actual performance may vary over time. All operating parameters,
2100 East Elliot Road
including "Typicals", must be validated for each customer application by customer's
Tempe, Arizona 85284 technical experts. Freescale Semiconductor does not convey any license under its patent
+1-800-521-6274 or +1-480-768-2130 rights nor the rights of others. Freescale Semiconductor products are not designed,
www.freescale.com/support intended, or authorized for use as components in systems intended for surgical implant
into the body, or other applications intended to support or sustain life, or for any other
Europe, Middle East, and Africa: application in which failure of the Freescale Semiconductor product could create a
Freescale Halbleiter Deutschland GmbH situation where personal injury or death may occur. Should Buyer purchase or use
Technical Information Center Freescale Semiconductor products for any such unintended or unauthorized application,
Buyer shall indemnify Freescale Semiconductor and its officers, employees, subsidiaries,
Schatzbogen 7 affiliates, and distributors harmless against all claims, costs, damages, and expenses, and
81829 Muenchen, Germany reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury
+44 1296 380 456 (English) or death associated with such unintended or unauthorized use, even if such claims alleges
+46 8 52200080 (English) that Freescale Semiconductor was negligent regarding the design or manufacture of
the part.
+49 89 92103 559 (German)
+33 1 69 35 48 48 (French) RoHS-compliant and/or Pb-free versions of Freescale products have the functionality and
electrical characteristics as their non-RoHS-complaint and/or non-Pb-free counterparts.
www.freescale.com/support
For further information, see http://www.freescale.com or contact your Freescale
Japan: sales representative.
Freescale Semiconductor Japan Ltd. For information on Freescale's Environmental Products program, go to
Headquarters http://www.freescale.com/epp.
ARCO Tower 15F Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc.
1-8-1, Shimo-Meguro, Meguro-ku, All other product or service names are the property of their respective owners.
Tokyo 153-0064 © 2011 Freescale Semiconductor, Inc.
Japan
0120 191014 or +81 3 5437 9125
support.japan@freescale.com
Asia/Pacific:
Freescale Semiconductor China Ltd.
Exchange Building 23F
No. 118 Jianguo Road
Chaoyang District
Beijing 100022
China
+86 10 5879 8000
support.asia@freescale.com