DIY-Thermocam: A low-cost thermal imager based on the FLIR Lepton sensor
diy-thermocam.net
diy-thermocam.net
A Flir ONE (2nd Gen) does almost the same, for about half the price. But again, not as hackable.
So while a bunch of people here might suggest that the price is very high, or the capabilities can easily be matched, it's a bit of a mixed bag. If you just want to see some thermal images, and you already have a smartphone, a Flir ONE might be for you. If you need a dedicated ruggedised hand-held cameras, get one of the ones from Flir. Anything beyond that is probably either too expensive or not as easy to integrate with what you need, and that's where this DIY comes in; easy to do whatever you want to, and good enough to outperform whatever else is on the market, but it will still cost money.
Edit: There is a PURETHERMAL-M which apparently is a USB interface board for the lepton module, so if someone wanted to hack around with a slightly less useful kit, but for a lower price, that's an option too. It does require a host system to control it, so it's not like you can use it as a 'handheld' like this DIY project.
For example with the open serial protocol of the DIY-Thermocam, you can build your own software applications in Python, Typescript, etc. to cover use-cases that are not part of any standalone solution (https://www.diy-thermocam.net/docs/serial/).
And if you are familiar with Arduino microcontrollers, you can change the firmware as you wish and extend it with new capabilities as well (https://github.com/maxritter/diy-thermocam/tree/master/firmw...).
The predecessor of this device was called "Cheap-Thermocam" (https://web.archive.org/web/20121128040746/http://www.cheap-...) and it used a single-spot MLX90614 sensor to create a thermal image by combining the measurements.
Although the project is now 10 years old, there is a good writeup if anybody wants to build it: https://www.instructables.com/Thermal-Camera/
Context matters and thermal imaging is very expensive usually.
Not only is it cheaper, on paper it's also much better:
- 45 mK vs 50 mK thermal sensitivity
- ±2 °C or ±2% vs ±10°C or ±10% accuracy
- 256x192 vs 160x120 resolution
- 25 vs 8.7Hz framerate
- -20 to 550 °C vs -10 to 450 °C range
The kicker is that (being European) I can't even get a FLIR equivalent to some of these specs, as they would violate ITAR export restrictions.Ended up going for the £4k FLIR camera (not my money tbf). On the plus side I didn't even know about the 9fps thing at the time and they didn't ask me about it, but we still got a 25fps camera. Not exactly sure how that happened.
Both are used for diagnostics of electronics, so the resolution and framerate make a noticeable difference here. On top of that mine boots up and is ready to go in under 5 seconds, while the FLIR takes close to a minute to get ready for some reason.
For a lot of uses that doesn't really matter tbf. IIRC in the FLIR software you can disable the periodic self calibration they do (which is quite annoying). Maybe that would improve startup time.
Somewhat off-topic, but if you want to get into thermal imaging for super cheap (albeit at a lower resolution again), you can get a compact FLIR kit from M5stack for $79 that's ready to use as soon as you charge it, but also freely hackable.
https://shop.m5stack.com/collections/m5stack-new-arrival/pro...
Adafruit’s breakout sounds interesting, like enough for a homemade AIM9
This sensor contains a 24x32 array of IR thermal sensors. When connected to your microcontroller (or Raspberry Pi) it will return an array of 768 individual infrared temperature readings over I2C. . . . This version has a wide 110°x70° field of view we also have a version with a narrower 55°x35° field of view. . . This version has a wide 110°x70° field of view we also have a version with a narrower 55°x35° field of view
https://www.adafruit.com/product/4469?gclid=Cj0KCQjwmN2iBhCr...
Early AIM9 explained: https://medium.com/@OpenSeason/1946-germany-has-been-defeate...
https://store.groupgets.com/products/tcam-mini-rev4-wireless...
You buy FLIR because they're well made, reliable products. Same reason people spend the money on Fluke. I'm not sure you can necessarily say the support is better for consumers because they mostly cater to OEMs, but the camera cores are (mostly) very well documented and software support is good.
I have seen some good documents, but they are mostly tailored to OEMs as well. It also depends on what you want to do. I've been trying to get a lepton streaming video to a TFT screen using an ESP32. Resources are scares. If you hit a problem, you're basically on your own.
For other people's benefit, from the FLIR website:
In general, thermal cameras operating at 60 fps and/or 30 fps (NTSC) or 50 / 25 fps (PAL) video rates are export-controlled by the U.S. government.
The FLIR OEM camera modules - including Tau2 640 (both 60 and 30 fps), Tau2 336 — are classified as dual-use items and require export licenses from the U.S. Department of Commerce.
The FLIR Vue and Vue Pro (640 and 336) are also dual-use.
Boson 640 (60/30 fps) and Boson 320, are controlled to the ITAR, and require export licenses from the U.S. Department of State prior to delivery outside of the U.S. or Canada.
The U.S. government allows thermal cameras with frame rates less that 9 fps to be exported without a license. This is why FLIR offers thermal cameras with "fast video" and "slow video" options.
The most common such system is Autoliv NV3, which is using the same sensor as Tau2/Flir E4/E8 (~320x256px). The original processing electronics does have protection preventing the use of it without car's ECU (though it's already broke), but the sensor interface is reverse engineered. Due to the age of the vehicles and the fact that the protective window in front of the lens is easily damaged, the modules can be bought relatively cheaply (I got mine for ~150EUR).
I made a breakout board for the sensor and have a more-or-less working nmigen gateware (using glasgow): https://github.com/festlv/isc0901b0-breakout
I don't have it fully working yet, as the sensor requires bias values to be sent for each pixel and Glasgow didn't have enough on-board memory to store them, and the thermal image without correct bias values is more or less unusable (many pixels are underexposed/overexposed).
I have hardware ready for ECP5 development board with enough onboard RAM but life got in the way, so it's still sitting in the pile of unfinished projects :/
There's also next generation (Autoliv NV4 == Veoneer NiVi4) which is based on 640x512 Boson sensor, though there is a lot less information about it.
It gives private persons, educational institutes and companies access to a portable, affordable and customizable thermal imaging platform that is based on open-source software and hardware. It is constructed as a self-assembly solution, that can be build at home by only using some standard tools.
There are various applications like finding heat leaks in the insulation of buildings, the analysis of electrical or mechanical components, the detection of persons / animals or even mounting it on a drone and recording continuous or time-lapse images.
The device has a large ecosystem of software around it, that allows to extend the functionalities of the device beyond the firmware itself. You can use the Thermal Analysis Software to edit raw data files on your PC and save them in various file formats. In addition to that, the Thermal Live Viewer can stream live thermal images to your PC, change settings on the fly and record images or videos. The Thermal Data Viewer provides another way of editing raw files, and with the Video Converter you can convert series of captures images to movie files.
The Device Firmware provides a lot of functionalities, that can be accessed over the 3.2" TFT LCD touch screen. Flashing the firmware is easy and can be done without any programming knowledge on any operating system over the command line interface. Once the Thermocam is connected to the PC, it will show up as a mass storage device and allows you to transfer thermal images from or to the device.
The DIY-Thermocam offers a wide range of features, like adding temperature points, changing temperature range limits, displaying hot or cold temperatures only, saving single images or a series of images (video or timelapse) to the integrated storage, changing the color scheme, etc. It can also communicate to the PC over the USB serial protocol, in order to stream thermal images or change settings remotely.
In case you want to extend the existing featureset with your own functionality, that's possible too. The firmware of the DIY-Thermocam is completely open-source and written in C/C++. Just download Visual Studio Code and the PlatformIO extension, and you are ready to go!
It looks like in an earlier version you had a visible camera as well, what was the choice in removing it?
I take it the device does not present itself as a web cam?
You are right, Version 2 had a visual camera. However, the alignment between LWIR sensor and visual camera was never perfect and most people only used the thermal image feature OR they took photos with a smartphone and combined it in the Thermal Analysis Software (ThermoVision) on the PC later on. That's why I decided to remove the visual camera for V3 to reduce building complexity and costs.
> The DIY-Thermocam V3 Kit from GroupGets contains all required parts to build the device:
One has to scroll below the image to see a suggestion that the FLIR sensor and breakout board are not included in the kit.
The groupgets page is more clear, but even there one has to scroll to very far down before one finds:
> The DIY-Thermocam V3 self-assembly KIT contains all required components excluding the FLIR Lepton 2.5/3.5 and the Lepton Breakout Board V2.
When I started reading the "Building" page, my interpretation of "all required parts to build the device" is that all (meaning every last one) parts necessary are contained in the kit. Finding the wording just after the large photo of "in case you do not already have ..." seemed odd, as it was hinting at "all" not really meaning "all", but not making such meaning clear. Only the groupgets page clarified that "all" did not in fact mean all, and even then took some scrolling to find that clarification.
I suggest you reword the first sentence of the "Building" page to read:
> The DIY-Thermocam V3 Kit from GroupGets contains all required parts excluding the FLIR Lepton 2.5/3.5 and the Lepton Breakout Board V2 to build the device:
silicon's bandgap of 1.1 electron volts corresponds to about a 1100-nm wavelength; is that the minimum photon energy a cmos sensor can detect?
if i did this calculation right, the spectral radiance at 1100nm should be a couple million times dimmer than the 700nm radiance at the draper point
You have: h c / boltzmann 700 nm 300 K
You want:
Definition: 68.513185
You have: h c / boltzmann 2000 nm 300 K
You want:
Definition: 23.979615
You have: h c / boltzmann 700 nm tempC(525)
You want:
Definition: 25.751996
You have: h c / boltzmann 1100 nm 300 K
You want:
Definition: 43.599299
You have: exp(43.6-25.8)
You want:
Definition: 53757836
11³/7³ is about 4 and 54/4 is 'a couple' to meso it's not literally impossible to detect but it seems like you would probably need special conditions like a light-tight darkroom or a thermal emitter switching on and off at a particular known frequency for millions of cycles
A physicist once emailed me to say that it's possible to pick up NIR emissions from a soldering iron, but only in a dark room.
Beyond the sensor limitations, MWIR and LWIR require special optics, because regular glass is opaque to them. The last time I looked into it, the glass was usually germanium-based.
One can do some neat stuff with actual thermal imaging. I was lucky enough to get a FLIR E4 when they could have the firmware replaced to turn them into an E8. 320x240 resolution is still pretty low, but having seen the difference between that and the stock 160x120, I'd not want to use a sensor with a resolution any lower than 320x240 or so.
[1] Scroll way down to the "Stovetop Bokeh (Stove on Medium-High)" section of https://www.beneaththewaves.net/Photography/Thermal_versus_N...
or you can use mirrors
being restricted to ~visible spectrum is a design goal for a camera, since we expect it to produce images that look like what we see. Your usual camera sensor will see a bit further into infrared than humans do (hence why cameras usually contain a filter filtering that out), but not so far that it is in any way useful for things that aren't burning hot. E.g. with cheap digital cameras with bad filters you might see the coals of campfire being slightly tinted wrong, because those get hot enough to be visible, but everything else is not affected, and you'd think a camera was bad if it were
[0] quite what is "forward looking" about them I don't know
The name’s just stuck around since.
Old sensors worked like side-scanning sonar, where the image is built up one row at a time as your vehicle moves forward. Forward looking means you can just point it somewhere and take a 2D picture.
The visible detectors are kind of a lucky accident, that the visible spectrum is within the range that can be detected by a silicon sensor. Therefore, visible sensors are cheap and easy to make thanks to silicon IC technology. Sensors that detect IR beyond about 1 micron wavelength (the bandgap of silicon, where it becomes transparent) have to be made out of more "exotic" materials that are also more expensive. The problem might be surmountable, but fewer people want to set up and optimize "fabs" for those materials.
The problem with detecting heat with silicon is that the intensity is extremely low, and the amount of background radiation high. Getting a temperature measurement that isn't corrupted by other effects is going to be difficult.
> it would seem a bit weird to me if they just happened to be restricted to exactly the same part of the spectrum as our eyes as a hardware limitation.
That's a feature, for the leica m8 sensor "sees" UV and IR, as a result you need to use a UV/IR filter on your lens otherwise you get weird colors and blurrier images (since UV/visible light/IR all focus at different plans)
https://www.35mmc.com/14/02/2016/leica-m8-infrared-cut-filte...
Bought one of these for work (HIKmicro, 160x120/19200pixel) for ~$300. It works, it's quite good compared to any thermal camera I played with 5+ years ago (even the fancy ones).
https://www.amazon.com/HIKMICRO-Resolution-Portable-4%C2%B0F...
It's important to note that camera sensor tech has been advancing quite rapidly these past two decades.
this is a bit like 'i made a working, drivable car from scratch using only basic hand tools, raw materials, and a 2005 honda civic' or 'i built my own operating system around the linux kernel'
https://github.com/google/skywater-pdk
One could make an array of thermopiles, like the hacker that made their own imager out of discrete diodes (digiOBSCURA) . But each pixel would cost $7.
https://www.digikey.com/en/products/detail/excelitas-technol...
One might be able to make an array of thermistors (possibly with active cooling using a peltier) like the diycamera (digiOBSCURA) below. Might be an application of combining many RC oscillators in a tree and recovering the signal with an FFT. I have a gut feeling this is possible, but haven't show it. Isn't this the same as or similar to your keyboard multiplexer design?
https://www.digikey.com/en/products/detail/panasonic-electro...
https://github.com/IdleHandsProject/diycamera (digiOBSCURA)
One could experiment with microbolometers on tinytapeout. https://elicit.org/search?q=cmos+microbolometer
i was thinking of directly measuring rc fall times for the keyboard multiplexer rather than running free oscillators
relaxation oscillators will give you a lot of harmonics, might be good or bad
Above is a seminar on analog layout designed to target Tiny Tapeout that went over Magic (by Jonathan Edwards) and Klayout (Thomas Perry). Sky130 and tinytapeout can do analog, but most of the tools and the examples are digital based.
https://i.imgur.com/NespRr4.png
https://www.klayout.de/forum/discussion/1879/video-demo-of-a...
i thought the google shuttle program connected your design to the outside world through some kind of digital bullshit
With Tiny Tapeout the levels of inception increase, we must go deeper and you get 8 bits in and 8 out and the designs are daisy chained. Purely for experimentation. 1000 logic cells or whatever else you can fit in the space.
(Note, there are a couple of moments that are very NSFW.)
Also, this video is 8 years old now.
I did get it working (but choppy) on a Pi Zero. I might be able to get it working smoothly if I wanted to trim down some of the other processes and prioritize this one. But the ESP32 should have faster start up.
I guess what I'm saying is be prepared for headaches if you want a truly DIY or really cheap lepton project.
I wish this tech would come down a bit so it would enable a whole new range of applications that weren't possible before due to the price.
But I assume the chinese parts at least will continue to become cheaper, although afaik they are currently not as available as individual parts vs complete devices.
This is a great exercise in building stuff for yourself but not affordable at all.
The thousand of dollars cameras you refer to have very high resolutions which are really not the use case for the curious maker that would be interested in such a project.
But I agree that the price might be too steep for the curious maker who does not have a serious use-case that satisfies the investment on the long run
This is still a great project for a lot of educational use cases e.g. thinking of universities and high schools who want to envolve students in the build process.
https://www.melexis.com/en/product/MLX90640/Far-Infrared-The...