Because the PiTFT Resistive Touch screen requires modifications to the Raspbian kernel, it is STRONGLY suggested to start fresh with the pre-built Raspbian Jessie image from Adafruit. This already contains all the necessary drivers for the PiTFT screen.
With FLIR’s Lepton thermal imager in conjunction with a Raspberry Pi Camera. It will also provide some troubleshooting tips, as well as some example code to help you start hacking.
Note that this is going to be a “headless” installation, thus will not be using the Raspbian GUI. You will be using the linux command-line to configure and program the Raspberry. The easiest way to access is to set up SSH and WiFi or Ethernet connectivity and use a remote terminal program like Putty.
The below instructions are taken from Adafruit PiTFT tutorial at the URL below. If you have difficulties or want to see the full instructions please visit the Adafruit tutorial FAQ.
PiTFT Installation Steps
1) Download the piTFT Raspian Jessie Lite from Adafruit to a PC:
2) Install this image on a 4GB or larger SD card. If you need help here, check out instructions at
3) Insert the micro SD card into the Pi. But do not turn on yet.
4) Before installing the piTFT onto the Pi, plug the 40 pin GPIO Cable into the back of the piTFT.
BE SURE to position the GRAY line mark on the cable on PIN 1 of the piTFT male connector. Note that there are two connectors on the PiTFT module; a female connector that plugs into the Raspberry Pi, and a male connector that this cable connects to.
This will be used to connect the Thermal Camera module later.
(Actually, you only need 4 wires to connect the camera, but due to dimensions, it’s easiest to just use this ready-made cable as is.)
5) Now plug in the PiTFT onto the Raspberry Pi itself. Again, look at the photos to see which way it should go. (gray to pin 1)
6) Verify that the GRAY line mark on the GPIO cable is positioned as shown.
Now you are ready to test the PiTFT and Raspberry Pi. (The IR Thermal Sensor will be installed later).
7) Connect a USB keyboard into one of the Raspi ports. (No mouse is needed). This will make it easier to initially log in and find the IP address that is assigned. Otherwise, you’ll need to check your router for the IP assignment.
8) For network connectivity, the easiest is just plug in an Ethernet cable, though you can set up WiFi manually via wpa_supplicant.conf if you prefer.
Note that once the IR camera is completed, you won’t need networking, so wifi isn’t needed.
9) Connect 5V power and let your pi boot. If all goes well, after a few seconds, the PiTFT screen should show boot messages and then a login prompt.
If you do not see any display, verify your connection (bent pins?), power supply and SD card are all good. Also see the Adafruit FAQ
10) Login & passwd are the default “pi” “raspberry”.
11) Locate the IP address using $ ifconfig –a
Now you can remotely log in using SSH Putty using pi@YOUR_IP_ADDRESS
You can unplug the keyboard once you successfully ssh in.
(Remote access is only needed just to make it easier to complete the setup, not for normal use.)
12) Update your package manager: $ sudo apt-get update
IMPORTANT NOTE! Do NOT run “apt-get upgrade” or “rpi-update”!
This would overwrite the custom Adafruit kernel needed to run the PiTFT. If you do, probably easiest is to just start over. Or consult the Adafruit FAQ above.
This Pi will not be accessible from the Internet, so security patches aren’t as critical.
(If paranoid, just turn off WiFi and only use Ethernet cable.)
Portable Raspberry Pi AMG8833 Grid-Eye IR Thermal Camera
version 0.8.2 - 2017-12-03
Overview
The Adafruit AMG8833 IR Thermal Camera board can provide a “FLIR™”-like imaging camera at about 1/10th the price of previous IR Thermal imaging units. Of course, the resolution and sensitivity are not as high as more advanced cameras, but hey, for $39 it’s a great deal.
Note that IR Thermal Cameras are NOT the same as NOIR cameras. The former uses only the heat given off by the object being imaged, while the latter requires an infrared light source such as IR LEDs to illuminate the object.
With this project, I took the excellent Adafruit tutorial Raspberry Pi Thermal Camera by Dean Miller and added extra functionality to the software and hardware.
The PiTFT display uses Adafruit's custom Linux Kernel. (See below) This project only needs the Jessie Lite-based PiTFT Resitive Image, as it does not use the GUI.
New features:
- Safely shutdown/power up Raspberry
- Automatically runs software at powerup
- Battery Powered for portability
- Uses PiTFT GPIO buttons
- Sensitivity controls
- Screen snapshots
- Potential for future additions
See Full Instructions in the RaspiThermalCam.pdf document
Zero Owners: A Raspberry Pi Zero can be used instead of a Pi 3, sacrificing speed. See the subdirectory RaspiThermalCam/Zero for details.
Requirements (summary)
NOTE: This project assumes the user has set up their Raspberry Pi using the Adafruit tutorial mentioned above, thus consists of:
- Adafruit AMG8833 IR Thermal Camera Breakout ID 3538
- It also specifically requires the Adafruit PiTFT Plus 2.8' 320x240 screen to be installed and running.
- Download Jessie Lite-based PiTFT image
- PiTFT Plus 2.8' TFT 320x240 Touch Screen ID 2298
- Currently uses also:
- Raspberry Pi 3, 4GB or larger micro SD card
- 5V power supply, wiring, cables, etc.
- It DOES NOT require the Cobbler as mentioned, but does need a cable to connect the camera. I suggest:
- Adafruit 40 Pin GPIO Cable ID 1988
- Adafruit 2X20 Pin IDC Box Header ID 1993
Extras
- Faceplate and case for PiTFT and Raspberry Pi 3 ID 2807
- 5V external USB Battery (such as external cellphone rechargeable) with 2 amp output
- Box to hold battery, computer and camera
Installation
You MUST have the Adafruit tutorial version installed and working before using this. This project just replaces the Adafruit thermalcam.py with a new python program. IT WILL NOT WORK OTHERWISE.
Also, it expects the assembled version of the Adafruit 2.8' 320x240 PiTFT Plus screen otherwise the screen layout will NOT ALIGN and the GPIO buttons will NOT FUNCTION as expected. The Raspbian GUI is NOT NEEDED, so uses their custom Jessie Lite.
The camera should be facing forward, like a digital camera: LCD screen towards you and camera towards (hot) object.
- Log into the Raspberry Pi with SSH or keyboard (defaults to 'pi/raspberry')
- Download and install the enhanced thermal program:
Once rebooted, you should see the new PiEyeR screen. See Troubleshooting if needed.
The 4 buttons on the TFT screen have been re-mapped to GPIO functions as shown:
- Safely Shutdown/Start up Raspberry (Does not remove 5V power, must be done usually via the 5V USB battery on/off switch)
- Increase Sensitivity (while in Camera Mode)
- Decrease Sensitivity (while in Camera Mode)
- Start/Stop Camera Mode
Snapshot
Due to a bug in the Python SDL library, the touch screen doesn’t currently work with PyGame software. So I used the tslib and a small custom C program to detect screen touches.
To take a screenshot of a thermal image, just touch anywhere on the touch screen. The screen will flash to let you know an image has been taken.Images are saved to the /home/pi/snapshot subdirectory as PNG files. These can be transferred to your PC using:
Mac/Linux:$ scp pi@YOUR_IP_ADDRESS :/home/pi/snapshot/*.png .
Windows:Use WinSCP program https://winscp.net/eng/download.phpConnect using SFTP with user name pi and Host name YOUR_IP_ADDRESSNavigate to snapshot folder and select and download to your PC.
3D Print Case (early version)
The stl/ subdirectory contains 3D Printed front case parts for the camera. See the PDF document for details.
Future
- Switch to using Raspberry Pi Zero W for lower cost & power/smaller size
- Add new mode button features for middle buttons
- Get pygame Touch Screen working for PiTFT
Troubleshooting
I don't see any new screen, only the boot messages and login.
Did you run the ./install.sh script?Try running $ crontab -l and see if you see a @reboot line:
You did set up your Pi Thermal Camera as detailed in the Adafruit tutorial
I get a python error messageMost likely there is a missing python package. The last line of the Python error should say what is missing. Try Googling that message.Else, leave an Issue here at Github.
My screen is mangled up, but the buttons seem to workAre you using the PiTFT Plus 2.8' 320x240 screen?
My buttons don't work or are on the bottom not side of the PiTFTYou have a different screen. If you have GPIO buttons on botton of TFT, you can try remapping them in the raspitherm.py program.
The Touchscreen doesn't workBugs in the SDL software used by pygame make for inconsistent operation of the touch screen. We have to wait for a better solution. This program doesn't use the touch, just buttons.
My Camera screen is all BLUE or all REDPress the Sensitivity buttons (middle two) to increase/decrease sensitivity
My Camera doesn't workTry manually running tools/thermal_cam.py program. This is the same program from Adafruit with no modifications.You may need to kill the raspitherm.py program first by editing the crontab:
What can I see with it?Find a cat. They glow hot!So do water heaters!