Dark Light

Low-Cost Thermal Cam as an Accessory Device Leave a comment


Thermal cameras or thermal accessories are one of the most essential devices for thermal scanning-based fault detection, thermal throttle analysis, thermal monitoring, or for any other purpose. Thermal screening is also used in monitoring the temperature of furnaces or boilers or analyzing body temperature without physical contact, as in the COVID examination. While the thermal cameras are expensive and their price range starts from 30K to 1 Lakh or higher, some cameras are available as an external accessory for phones. It can be attached and will convert your phone into a thermal camera, but even these accessories can cost up to 30K or higher, which is also quite expensive and we might feel it is an unnecessary investment for basic thermal analysis or thermal screening or to test COVID symptoms. So we have decided why not design a very affordable cost thermal camera accessory for phone use which you can turn any phone into a thermal camera and the price is low as 5K to 6K. This camera can be used to get very basic thermal video and it can be used for many basic tasks like thermal screening, thermal testing analysis, thermal monitoring, etc. The design consists of the following components:

Fig 1


Bill Of Materials 

Note:-The OTG adapter can be used according to the device or phone on which we will be configuring our device. For the iPhone, you need the OTG adapter for the iPhone, and for an Android phone, type-C USB.


First, the body of the device is to be designed in a way that supports and protects the components and device. The thermal sensor and the Raspberry Pi Zero W are used together. The enclosure/case of the device can be designed as per the size of the Raspberry Pi Zero W and make a hole at the bottom of the case to expose the thermal sensor, while a cut for the USM micro OTG outlet can be provided at the top of the case as shown below. ( Refer to Fig. 3)

Fig 3. The device case design


After designing the case, connect the sensor, Raspberry Pi, and OTG as shown in the circuit diagram (refer to Fig 4). If you have an OTG with a micro USB male output, then you can directly connect that micro USB to the Raspberry Pi micro USB input. Or else, you need to cut the wire of the OTG and solder the +ve wire to the 5V pin of the Raspberry Pi, and GND to the GND pin of the Raspberry Pi. For the iPhone, avoid using the soldering process and use the Micro USB male to iPhone male OTG connector. Do check all connections to avoid causing damage to your expensive phone. After connecting the OTG and sensor with the Raspberry Pi, fix the sensor, Raspberry Pi, and OTG adapter inside the designed and 3D printed enclosure. (Refer to Fig 5,6,7).

Fig 4. Connection Diagram
Fig 5. The thermal sensor attached on designed case
Fig 6. Raspberry Pi fixed on 3D printed case
Fig 7. Device after setting and fixing all components


Install the Raspberry Pi with the latest Raspbian OS . Then enable I2C pepherial in Raspberry Pi as the thermal sensor we are using is interfaced on I2C communication, hence to enable the I2C on Raspberry Pi, open terminal and run. 

sudo  raspi-config and then go to advance and interfacing option and enable the I2C and VNC. Now connect the Raspberry Pi to a phone hotspot or WiFi network to which the phone is connected. Next, we need to install a few libraries and modules that help us with interfacing the sensor and getting data from it, as well as viewing that data in video form . So open the linux terminal and run the following command 

sudo pip3 install pygame

sudo pip3 install scipy

sudo pip3 install numpy

sudo pip3 install Adafruit_AMG88xx pip install Adafruit_AMG88xxpip 

After installing the library, import all installed modules in code, then we need to set the max tem and min temperature range to get our AMG sensor read. Set the range between 22 to 45, or even a higher range can be used depending on the requirement and the purpose for which you are using it. If it is used for thermal analysis and the temperature range is greater than 100, then you can set the range according to that . Next, set the pygame window size, the size at which the video output for your thermal camera is obtained, and then we will map the sensor pixel data to red, green, blue, and yellow. 

Let’s understand how the thermal camera works. The thermal camera has a thermal sensor inside many small IR thermal sensors. Each thermal sensor acts as a pixel of the thermal camera and it is in the form of a matrix, so if a good quality, high resolution thermal camera sensor is used, then it consists of very small thermal sensors in the form of pixels. Here, we are using the AMG8833 thermal sensor, so the pixel size is a matrix of 8 X 8 and to get the real time video, we map those pixels, i.e., small sized IR thermal sensor data, with colors like blue to yellow to red, where RED is the max hot color and BLUE is the min coldest colour, and then after the mapping, the thermal image is formed that we see in any thermal camera video.

Fig 8. Code setting the display size and sensor
Fig 9. Testing the thermal camera on phone

Our device is ready after preparing the above code. Now connect the device to the charging port/USB  of your iPhone or Android phone.  Now, install the VNC viewer on the phone or PC on which you want to receive the thermal camera video. Suppose we are converting the iPhone into a thermal camera by attaching it to our device, so we install the VNC viewer on the iPhone, available on the app store. We need to insert the IP address and password of our Raspberry Pi and let the Pi connect to either a phone hotspot or to the same WiFi network that our phone is connected to. Now we run the code that we prepared earlier, and now you can get the real time thermal video. Move your hand near the thermal sensor device or bring  the hot object near the sensor device and you can see the thermal video of any object .

Congrats!! You have just designed the thermal screening attachment accessory

Download Code


Source link

Leave a Reply

Your email address will not be published. Required fields are marked *