Mastering the FLIR Lepton: A Complete Guide to Harnessing its Power
Table of Contents
- Introduction
- Understanding the Lepton Team and its Role
- Connecting the Lepton to a Physical Device
- Working with the Lepton's Protocols
- Plugging in and Wiring the Lepton
- Real-Time Computing with the Lepton
- Working with the 80 by 60 Lepton
- Radiometric Calibration of the Lepton
- Automatic Gain Control and Colorization
- Using the Lepton SDK
- Important Commands and Features
- Tips and Tricks for Working with the Lepton
Introduction
Welcome to the guide on working with the Lepton team and harnessing the power of the Lepton technology. In this article, we will explore various aspects of the Lepton system, including its protocols, wiring, real-time computing capabilities, colorization, calibration, and more. Whether you are a hacker, developer, or simply curious about this cutting-edge technology, this comprehensive guide will provide you with all the information you need to get started with the Lepton.
Understanding the Lepton Team and its Role
The Lepton team has been at the forefront of developing tools and firmware for the Lepton for several years. Their expertise in this area has been invaluable in creating a seamless experience for users. With a focus on mobile integration, the team has been working tirelessly to ensure the smooth running of the Lepton SDKs. This collaboration between the Lepton and mobile teams has resulted in powerful and efficient software tools that enhance the overall functionality of the Lepton.
Connecting the Lepton to a Physical Device
When it comes to connecting the Lepton to a physical device, there are two protocols that you need to implement: AI2C (Commanded Control) and SPY (Video). To facilitate this, a breakout board with all the necessary pins is recommended. Wiring the Lepton is a straightforward process, with the Raspberry Pi often used as the host and the Lepton as the slave. However, it is important to note that the Lepton is a real-time computing system, requiring frames to be pulled from it within a specific timeframe. Failure to do so can result in sync issues, which can be resolved using the ship selector spike lock and resync commands.
Working with the Lepton's Protocols
The Lepton supports two protocols: AI2C and SPY. AI2C is used for command and control only, while SPY is utilized for video transmission. The 80 by 60 Lepton is a popular choice for hackers, and data sent over SPY is in 16-bit format that represents 4 pixels. However, it is important to note that the actual data is 14 bits, ranging from 0 to 2^16-1 (83). When pulling frames from the Lepton, the required bandwidth is approximately 9600 bytes per frame, which is manageable for most applications.
Plugging in and Wiring the Lepton
To physically connect the Lepton to a device, you will need to follow a straightforward wiring process. The Raspberry Pi is commonly used as the host, and the Lepton is connected as the slave. Using the breakout board that includes all the necessary pins, simply plug in the Lepton and ensure that the wiring is correct. This simple process allows for easy integration and ensures a smooth connection between the Lepton and the host device.
Real-Time Computing with the Lepton
The Lepton is a real-time computing system, meaning that frames need to be pulled from it within a specific timeframe. Failure to do so can result in synchronization issues. To prevent this, it is recommended to use the ship selector spike lock command for one Second and then resync. By adhering to the timing requirements, you can ensure a consistent and reliable performance from the Lepton.
Working with the 80 by 60 Lepton
For hackers and developers, the 80 by 60 Lepton offers a range of possibilities. With data sent over SPY in a 16-bit format, representing 4 pixels, it is important to understand the bandwidth requirements. Each frame requires approximately 9600 bytes, which is relatively manageable for most applications. This compact and versatile Lepton variant opens up new opportunities for creative and innovative projects.
Radiometric Calibration of the Lepton
One important aspect to consider when working with the Lepton is radiometric calibration. The Lepton is not radiometrically calibrated by default, meaning that additional steps need to be taken to obtain real temperature values. This process involves using a blackbody and calibrating it across various temperatures. By performing curve fitting and creating a Lookup table, you can accurately obtain temperature values from the Lepton. While this process can be time-consuming, it is essential for obtaining reliable and accurate temperature measurements.
Automatic Gain Control and Colorization
Automatic Gain Control (AGC) and colorization are critical aspects of working with the Lepton. AGC ensures that the grayscale values from the 14-bit data are appropriately mapped to the 8-bit color space. This is achieved by finding the minimum and maximum values in the scene and dividing them by 255 to create buckets or color lookup tables. These lookup tables provide mappings from the 14-bit data to specific shades or colors. The Lepton SDK includes predefined lookup tables, making it easy to implement AGC and colorization in your projects.
Using the Lepton SDK
The Lepton SDK is a powerful tool for working with the Lepton. It utilizes the AI2C protocol and offers a range of commands and features. One crucial command to be familiar with is the flat field command. This command closes the shutter and performs non-uniformity correction, effectively removing noise from the scene. The flat field command is essential for obtaining clean and accurate images with the Lepton. While there are additional commands and features available, the flat field command is often sufficient for most projects.
Important Commands and Features
In addition to the flat field command, the Lepton SDK offers various other commands and features that can enhance your experience with the Lepton. These include but are not limited to temperature calibration, AGC management, and electrical parameter configuration. The Raspberry Pi code includes many of these functionalities, making it easy to implement them in your projects. Whether you are a beginner or an experienced developer, the Lepton SDK provides a wide range of tools and capabilities to explore.
Tips and Tricks for Working with the Lepton
To ensure a smooth and efficient experience with the Lepton, here are a few tips and tricks to keep in mind:
- When using the Lepton with a Raspberry Pi, it is recommended to use the breakout board to simplify the wiring process.
- If you do not have a shuttered Lepton and you run the flat field command, be aware that it may create a Ghost image. This can occur if you are standing in front of the Lepton during the calibration process.
- Calibration of the Lepton requires a uniform black body that allows for temperature control. Without proper calibration, accurate temperature measurements cannot be obtained.
- The Lepton SDK offers a wide range of functionalities, but for most projects, the flat field command is sufficient. However, if you require additional features or commands, the Lepton team is available to assist you.
With these tips and tricks, you can optimize your workflow and make the most out of your Lepton experience. Whether you are a hobbyist or a professional, these recommendations will help you achieve the best results with the Lepton.
FAQ
Q: How do I calibrate the Lepton?
A: Calibrating the Lepton involves using a blackbody and performing curve fitting across multiple temperatures. This process can be complex and time-consuming. For detailed instructions, the Lepton team has a comprehensive document that covers the calibration process.
Q: Do I need a uniform black body for calibration?
A: Yes, a uniform black body that allows for temperature control is required for calibration. Without a properly calibrated black body, accurate temperature measurements cannot be obtained.
Q: Does the Lepton SDK include AGC functionality?
A: Yes, the Lepton SDK includes AGC functionality. By applying automatic gain control, you can achieve optimal grayscale to color mapping, enhancing the visual quality of the images captured by the Lepton.
Q: Are there any resources available for lookup tables and color mappings?
A: Yes, the Lepton SDK provides predefined lookup tables that map specific values to shades or colors. These lookup tables can be accessed through the SDK and used in your projects without the need for manual mapping.
Q: Can I use the Lepton without the SDK?
A: Yes, it is possible to use the Lepton without the SDK. The SDK offers additional functionalities and commands, but for basic frame acquisition, the SDK is not necessary. If you prefer to work with raw frames, you can directly access the Lepton via the appropriate protocols.
Q: Can I connect the Lepton without using the breakout board?
A: While it is technically possible to connect the Lepton without the breakout board, it is highly recommended to use the breakout board for easier integration. If you choose to connect the Lepton directly, ensure that you provide a 25 MHz clock with a crystal oscillator.
Highlights
- Learn how to connect the Lepton to a physical device using AI2C and SPY protocols.
- Understand the importance of real-time computing with the Lepton and how to avoid synchronization issues.
- Discover the capabilities of the 80 by 60 Lepton for hackers and developers.
- Explore the process of radiometric calibration to obtain accurate temperature measurements.
- Implement automatic gain control and colorization to enhance the visual quality of Lepton images.
- Get familiar with the Lepton SDK and its powerful features, including the flat field command.
- Benefit from tips and tricks for working with the Lepton to optimize your workflow.
Resources: