Comments: FLIR Lepton Hookup Guide

Pages

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • Member #987711 / about 8 years ago / 5

    For others that have problems, look at this webpage https://groupgets.com/blog/posts/8-installation-guide-for-pure-breakout-board-on-raspberry-pi-2. Problems that I had was that in the tutorial on sparkfun, it tells you to put the CS pin in the 26th position. This is incorrect it must be in the 24th position. Another update is to move to leptonSDKEmb32PUB file from the raspberrypi_libs to the raspberrypi_video. Another thing I found that may or may not make a difference is the new folders that qmake && make creates in raspberrypi_video. These folders have files that may need to be under the raspberrypi_video file.

    • Thanks for the tip. I have added some of these notes into the tutorial.

    • Member #1274128 / about 7 years ago / 1

      Had I read the comments immediately, I would have saved a lot of work.

  • Member #1363320 / about 7 years ago / 2

    Would this code run for the Lepton 3 as well? As far as I can tell the V1.4 breakout is compatible. Thanks for any help!

    • Member #1364950 / about 7 years ago / 1

      Were you able to get it working with Lepton 3? I can't seem to get rid of the red square.

  • -------------------- Tech Support Tips/Troubleshooting/Common Issues --------------------

    Breakout Board Dimensions

    The FLiR Lepton's Breakout Board Dimensions are:

    width = ~25.11 mm
    
    length = ~24.10 mm
    
    length (with pins) = ~30.21 mm
    
    depth (not including pins) = ~11.20mm
    

    Here is an image of the dimensions:

    https://raw.githubusercontent.com/SparkfunTechSupport/Dimensional-diagrams/master/KIT-13233/13233%20FLiR%20dimensions.jpg

    Heat Signatures through Clear Acrylic?

    I tested a case out using a clear acrylic, FLiR attached to Raspberry Pi, and a Peltier Cooler. The FLiR sensor only is able to detect temperature gradients on the surface of the material. The FLiR sensor will not be able to see any heat signatures behind the acrylic. However, if you are heating the acrylic material sufficiently (like I did with the hot side of a Peltier Cooler), this will transfer heat to the other side facing the FLiR sensor. The FLiR sensor will pick up the heat as soon as enough heat has been transferred to the other side.

    ** Changing Window Size**

    If you want to change the window size, follow these instructions => http://www.appropedia.org/How_to_install_FLIR_Lepton_Thermal_Camera_and_applications_on_Raspberry_Pi#Video_size in order to change the .../LeptonModule-master/raspberrypi_video/main.cpp file in lines 21, 36, and 41:

    myWidget -> setGeometry(400, 300, 340, 290);
    .
    .
    .
    myLabel.setGeometry(10, 10, 320, 240);
    .
    .
    .
    button1->setGeometry(320/2-50, 290-35, 100, 30);
    

    to 2.5x the size of the original :

    myWidget -> setGeometry(100, 100, 850, 725); // window position coordinates, video pixel size
    .
    .
    .
    myLabel.setGeometry(10, 10, 850, 600); // ..., pixel size of the image
    .
    .
    .
    button1->setGeometry(850/2-50, 725-35, 100, 30); // button position coordinates, ...
    

    The window was bigger but the image was still pixelated after re-making the files and opening the program.

    Update in GitHub Repository has Changed the "leptonSDKEmb32PUB" directory

    It looks like the directories have changed for the leptonSDKEmb32PUB folder [ https://github.com/groupgets/LeptonModule/tree/master/software ] so this tutorial is slightly outdated. You will need to go to the directory ".../downloads/LeptonModule-master/software/raspberrypi_libs/leptonSDKEmb32PUB" in order to make the files. Once you go to the ".../raspberrypi_video” directory, you would still use the qmake && make command to make the executable.

    Arduino and FLiR Lepton

    SparkFun has only tested the FLiR Lepton with the Raspberry Pi. The documentation linked in the product page for the FLiR Lepton module has some example code for an Arduino => https://github.com/groupgets/LeptonModule/blob/master/software/arduino_i2c/Lepton.ino . The note under the GitHub repository by "Pure Engineering" states that:

    This example shows how to read the i2c ports using an Arduino. Note that most Arduino hardware does not have enough memory to buffer the thermal image. 80602 = 9600 bytes. Some of the Arm based units will work.
    

    Based on this information, I do not believe that the Arduino Uno with the Atmega328P microcontroller is powerful enough to stream a thermal image like the Raspberry Pi example. This is due to a limitation of the ATmega328P microcontroller and the FLiR Lepton's requirements [ https://forum.arduino.cc/index.php?topic=266361.0 , https://groups.google.com/forum/#!searchin/flir-lepton/arduino$20uno%7Csort:relevance/flir-lepton/itC5lotSkNY/6Y88KwLWGQAJ , and http://www.pureengineering.com/projects/lepton ] . You can probably get it working with an ARM based microcontroller (like the STM32 microcontroller listed in the GitHub example code or an Arduino Due) or a single board computer (like the Raspberry Pi, BBB, etc).

    Doing a search online, it looks like someone was able to get an Arduino Due to work using the FLiR Lepton camera and MatLab [ https://groups.google.com/forum/#!topic/flir-lepton/JJVf4crDpYw ]. The Arduino Due code [ https://github.com/josepbordesjove/FLiR-lepton ] processes the data from the FLiR Lepton and passes it to your serial terminal. To view the thermal images, you would need to take that data and display it using MatLab. This seems pretty tedious. I recommend using a Raspberry Pi, which is more reliable compared to using it with the Arduino Due.

    Additional Resources

    Here is a good link for setting up the RPi2 with the FLIR, and the RPI2 workaround for ‘red box’ https://medium.com/@groupgetscom/visual-installation-guide-for-pure-lepton-breakout-board-on-raspberry-pi-2b-3b13a3e0e17d

    This is “The Frank solution”. it’s the widely accepted and Pure endorsed fix for the “red box” error on Rpi1 (b+&b) https://groups.google.com/forum/#!topic/flir-lepton/GWHD1KMVYaE

    Here is a monster sized guide for tweaking and tuning your FLIR http://www.appropedia.org/How_to_install_FLIR_Lepton_Thermal_Camera_and_applications_on_Raspberry_Pi

  • Member #1603867 / about 4 years ago * / 1

    Just in case anyone was having the same issue as me where the x-axis seemed flipped (right to left movement) I add this code to the part in LeptonThread.cpp where the pixel color is set. It now seems more natural.

    //Update the UI with the new temperature info
        QString s;
        s.sprintf("%.2f F", tempF + 5.0);
        emit updateRadiometry(s);
        int x = 0;  //added
        int columnnew = 0; //added
        for(int i=0;i<FRAME_SIZE_UINT16;i++) {
            if(i % PACKET_SIZE_UINT16 < 2) {
                continue;
            }
    
            value = (frameBuffer[i] - minValue) * scale;
            const int *colormap = colormap_ironblack;
            color = qRgb(colormap[3*value], colormap[3*value+1], colormap[3*value+2]);
            column = (i % PACKET_SIZE_UINT16 ) - 2;
            columnnew = column + 80 - x; //added
            row = i / PACKET_SIZE_UINT16;
            myImage.setPixel(columnnew, row, color);
            x = x + 2; //added
            if(x == 160) //added
            {  //added
                x = 0;  //added
            }  //added
        }
    
        //Draw crosshairs in the middle of the image
    

  • Member #567676 / about 6 years ago / 1

    I am getting: "Error - Could not open SPI device: No such file or directory Segmentation fault" I have a RPi3B and have enabled I2C and SPI. I ran "sudo apt-get install qt4-dev-tools" successfully (as far as I can tell). I unzipped the file to my desktop and followed Bramble's instruction in a comment below: "The SDK has been moved to software/raspberrypi_libs/leptonSDKEmb32PUB, so you will have to cd into this directory and run make. Then you can navigate to raspberrypi_video and run qmake && make". When I run "sudo ./raspberrypi_video" (still in the raspberrypi_video directory) is when I get the error above. I tired moving the CS pin to 24 instead of 26 as I saw mentioned. Google searches on the error mention a kernel. Something here I need to be doing?

    It seems changes have been made to the code and there is no longer a proper walk through anywhere. I have found the installation guide for RPi2 on the groupgets site but it seems to use pylepton which says it requires a pycam which I do not have. I just want to see the thermal output without overlay. It looked much more straight forward when I spent the money on the hardware and now it almost looks unsupported and I have a paperweight.

  • Member #1172257 / about 7 years ago / 1

    Has anyone gotten this to work with the newer Lepton 3.0? It starts up, flashes where I can see some heat images, freezes and the cli says "done reading, resets: 'rando number'"

    Is there a setting somewhere to adjust to work with this HW?

  • Member #757566 / about 7 years ago / 1

    To echo some previous comments -- Line 26 in LeptonThread.cpp in the raspberrypi_video directory has a call to SpiOpenPort(0), which I believe points to pin 24 and not 26. To fix the red square, folks can either shift from pin 26 to 24, or else change the port called from SpiOpenPort (full disclosure, I haven't tried changing that). I shifted to pin 24 and my camera is running beautifully.

  • Elspin / about 8 years ago * / 1

    On my raspberry pi 3 and raspbian with pixel, my raspi-config has the option for i2c/spi under a header that is not on your diagram called "interfacing options" rather than the advanced options on your image

    Whole thing still didn't work though. Red square, no video feed, pulling and replacing module did nothing.

  • Member #858727 / about 8 years ago / 1

    Hello, I want to ask about some technical problem. I already make the flir camera works on raspi but it just work a few seconds then it goes freeze. Can anyone explain mehow to make it work again?

    P.S: I already change some pins as many guides told me many times, but still not work again.

  • Member #823962 / about 8 years ago / 1

    Anyone know if it's possible to use the FLIR Lepton module with Raspberry Pi 3 with Windows 10 IoT? I'm a little new to the area so any advice would be greatly appreciated! :)

  • Member #728224 / about 8 years ago / 1

    I've followed these steps carefully, including unplugging and replacing the module, and I still can't get past the red box. I've checked my wiring a million times. I've been extremely careful to follow ESD precautions, always wearing my anti-static wristband so I really doubt it's fried. I noticed in the console I never see "done reading, resets." Can anyone offer any help? Thanks.

    • Member #542165 / about 7 years ago / 1

      Did you ever figure this out? I am in the EXACT same position. Thanks, David

  • Member #771578 / about 9 years ago / 1

    My coworkers and I are trying to hook up our raspberry pi 2 and the Lepton module together using this guide. Seeing as none of us have ever used a raspberry pi this tutorial has been a wonderful. However we got all the way through to running the qmake function and now we are getting a repeating message saying: "/usr/bin/qmake -o Makefile raspberrypi_video.[rp make: Warning : File 'raspberrypi_vide.pro' has modification time 20610025 s in the future" and counting down every second. Since most people seem to have this camera up and running in less than 20 minutes I'm wondering why ours is estimating it will take about 7 months to finish. Any ideas or advice would be very welcome. Thanks for the help.

  • jpkelly / about 9 years ago / 1

    The instructions say : "First, we need to “make” the Lepton SDK, so cd into the “LeptonSDKEmb32PUB” directory and run make." But I cant find the LeptonSDKEmb32PUB directory.

    • Bramble / about 9 years ago / 2

      The SDK has been moved to software/raspberrypi_libs/leptonSDKEmb32PUB, so you will have to cd into this directory and run make. Then you can navigate to raspberrypi_video and run qmake && make.

      • Member #244899 / about 6 years ago / 1

        i was able to run "make" but when i went to cd raspberrypi_video to run "qmake && make" it says "bash: qmake: command not found".

        I'm banging my head against the desk. Anyone have any insight? I'm relative newcomer to pi.

        • Bramble / about 6 years ago / 1

          make invokes the g++ compiler, and compiles an executable from C++ source code according to the contents of the Makefile in your current folder. qmake is a utility that similarly generates makefiles according to a .pro file, and comes with Qt - if you are unfamiliar with Qt, it is basically a C++ SDK that adds GUI programming, signals & slots, and much more to C++. So check it out!

          I have not looked at this project for a long time, so my code may be outdated, but I have a file called raspberrypi_video.pro in the folder software/raspberrypi_video. If you have this file, but are unable to run qmake, you probably don't have Qt installed, so I would look into installing Qt on Raspbian. This should be pretty straight forward with some googling.

  • Member #161873 / about 9 years ago / 1

    "Microbolometers are made up of materials which change resistance as they’re heated up by infrared radiation.">>"Microbolometers are made up of materials which change resistance as their temperature changes." It doesn't matter what kind of radiation changes their temp, and they change resistance when they're cooled too. The second form avoids misleading people into thinking that only infrared changes their resistance, and that they must be heated somehow to be read. Of course there's an IR-passing filter on the camera, but that is separate from the microbolometer. I only make this comment because I often see people, even my fellow physics teachers, make mistaken claims about infrared and energy transfer. "By measuring this resistance, you can determine the temperature of the object that emitted the radiation..." This claim is more complex to correct, because it misleads the reader under multiple scenarios: As an extreme example, point the camera at the sky...The microbolometer will be heated or cooled according to the sum of radiation from the volume, the cone, of air and space it "sees," not a single object. This effect can be generalized to many more terrestrial situations involving aerosols. As another extreme example, point the camera at shiny metal...The microbolometer will be more affected by radiation reflected by the object than the object itself. This effect can be generalized, to some degree, to all non-matte-black-in-IR objects, in fact all solid objects. This guide overall is very interesting and helpful. You might note which versions of software you are using, especially for Raspberry Pi, as that seems to be important. -Your friend in education at EnergyTeachers.org

  • Member #680711 / about 10 years ago / 1

    Are there any links on how to import the video capture into openCV on the raspberry pi?

  • guruflorida / about 10 years ago / 1

    Thank you! Very good tutorial. I was running in about 15 minutes.


If you've found an issue with this tutorial content, please send us your feedback!