element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
BeagleBoard
  • Products
  • Dev Tools
  • Single-Board Computers
  • BeagleBoard
  • More
  • Cancel
BeagleBoard
Blog BBB - Building a thermal imaging camera
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join BeagleBoard to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: shabaz
  • Date Created: 7 Jun 2013 8:36 PM Date Created
  • Views 2619 views
  • Likes 3 likes
  • Comments 10 comments
  • beaglebone_black
  • bb_black
  • beagle_bone_black
Related
Recommended

BBB - Building a thermal imaging camera

shabaz
shabaz
7 Jun 2013

Introduction

This was a quick, fun exercise, to build a complete thermal camera using the Beaglebone Black, a small LCD and a thermal array sensor.

It was really more of a consolidation, combining some earlier experiements.

 

The setup

The image here shows the entire assembly, capturing an image of my hand (taken from about 1 foot away. It was hard to take a photo at the same time!).

 

image

The final code is attached. The information on each sub-section is at these links:

Thermal array circuit

I2C interface code (either compile it, or just copy the libi2cfunc.a file to /usr/lib, and the i2cfunc.h file to /usr/include )

1.8inch LCD display

Image scaling (or use NEON functionality)

PRU information (you will need to install the PRU assembler if you want to make changes - if you don't, you can use the pre-assembled .bin file in the zip file).

 

The attached code is not tidy, but it works. It could be optimised a lot, I made no effort to do this. Currently the image updates at about 1Hz, but this could be improved many times. Many conversions are done that could be simplified.

Edit: It looks like actually the whole process is occurring at many tens of Hz, but the LCD updates at about once per second; this looks like a limitation of the LCD display (the update over the serial interface is occurring rapidly, but internally it presumably only updates once per sec. An alternative display is required!).

Edit 2: It turned out that the LCD was fine; the thermal sensor was set to internally update at 1Hz, regardless of the readout speed. The version 2 code attached has it now set to 16Hz in ir.c, but possibly 4Hz or 8Hz would be sufficient and give higher accuracy.

Compiling and running the code

Here is how to use the code:

 

First, make sure the I2C library is installed as mentioned above.

 

Then, copy the attached code into any folder, unzip and then follow one of these two steps:

 

1. If you have not installed the PRU assembler:

make partclean;make ir_app; make dtfrag

 

 

2. If you have installed the PRU assembler:

make clean;make

 

 

Copy the generated .dtbo file to the /lib/firmware folder.

 

Then, type the following (it could be placed in a startup script when the board has booted):

export SLOTS=/sys/devices/bone_capemgr.9/slots

echo cape-bone-lcd18 > $SLOTS

cat $SLOTS

 

 

The code can now be run by typing:

./ir_app

 

To generate video the code was modified (v3 code) to accept a file prefix.

./ir_app img

 

This will generate files beginning with img, i.e.

img00000.png, img00001.png, etc.

 

Then, they can be converted into a video using:

avconv -i img%05d.png -b:v 1000k test.mp4

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Another video (the temperature to color conversion had a bug in the earlier video, fixed in the v3 code):

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Here is another photo, this time of a tub of icecream.

image

This is holding an ice lolly on a stick:

image

Other ideas

It would be nice to be able to retrieve the images via a PC, either stream the images, or to have a web server to access them, or just dump files in a folder for now. I didn't get a chance to try any of these.

If I get time I might build this into an enclosure, as a permanent project (powering the the entire thing from a Li-Ion battery that connects on the board (Olimex BATTERY-LIPO1400mAh fits, if you buy the right connector).

Attachments:
You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image
You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image
ir_code_v3.zip
  • Sign in to reply

Top Comments

  • shabaz
    shabaz over 9 years ago +1
    Just noticed that the awesome Grid-EYE sensors from Panasonic are now in stock! Finally cheap thermal vision : ) Anyone planning to try them out?
  • balearicdynamics
    balearicdynamics over 9 years ago in reply to shabaz

    Hey shabaz,

     

    in this period (the reason there was no updates for the Meditech project, that is anyway going ahead) I am working on the fund-finding for the project next step image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 9 years ago in reply to balearicdynamics

    Hi Enrico,

     

    That was a great idea!! Interesting suggestion for monitoring patient temperature / illnesses.

    Very tempted to order one, although experimentation with it may have to wait a few weeks : (

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 9 years ago in reply to shabaz

    Sure it's for Meditech one of the ideal probes suspended from the initial project due the high costs of these cameras / sensors.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 9 years ago

    Just noticed that the awesome Grid-EYE sensors from Panasonic are now in stock!

    Finally cheap thermal vision : )

    Anyone planning to try them out?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Nitin_Bhaskar
    Nitin_Bhaskar over 11 years ago

    Hi Shabaz,

     

    Really useful project. Will try it out. Thanks for posting.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube