With the sketch successfully uploaded and running, what appears on the screen? If the sensor isn't connected properly, a red message will appear saying the MLX90640 is not detected, and everything halts. But if the hardware is working, look for a screen full of features like this.
The picture in the middle is the nifty part, radiant heat converted into a color image. At 32x24 pixels, only coarse details can be discerned, but they can reveal a lot. The other features on the screen provide more information.
In the left border is a frame counter, which counts the number of image frames displayed since the last restart of the sketch. It was a performance diagnostic that's still part of the program.
In the right border are small status icons that indicate what the sketch is doing from moment to moment.
- A battery level indicator shows when battery power is running low. It doesn't indicate charging status, however.
- An orange camera icon appears when temperature data is transferring from the sensor to the processor.
- A green SD card icon appears as image data is written to flash storage.
- A snowflake icon indicates when an image freeze is active.
Three numbers below the image display three temperatures copied straight from the sensor data. The coldest temperature detected in the image is shown on the left, the hottest on the right, and the temperature of the center pixel is in the middle. The locations of these temperatures can be indicated in the image by three small green crosses.
A small strip showing the color palette from cold to hot lies below the numbers, and below this are the function labels for buttons B and A.
Buttons B and A are to the right of the screen, and can perform more than one function. It's button A that can capture a thermal image and save it into flash storage as a tiny gray BMP file with embedded temperature data, like this one.
Depending on its user setting, the button can capture single images, or start and stop recording BMP image sequences, or simply freeze the display without capturing anything.
The sketch tries to test for flash availability, and will gray out the button label if it detects flash storage as unavailable, but it's not a sophisticated system. Do pay attention to storage space. Each BMP consumes over 2K, and the sketch can't recall or delete them. That can happen only when your controller is USB connected to a full-size computer.
From the camera view screen, button B brings up the settings menu. Give it a press and see what appears.
The menu screen looks sort of like this image, but not quite. That's because the full menu doesn't fit on the small screen. No problem, since the menu automatically scrolls as you click button B to advance the highlight bar down the list. Any setting you wish to change can be done by advancing the bar to the item and clicking button A. These are the settings you can change.
- Display last capture - If any thermal image data has been captured to flash storage, the last image stored can be momentarily re-shown on screen. If no image has been captured since the latest restart, a generic gradient gets displayed.
- Scale - On screen temperatures can be shown in Fahrenheit or Celsius.
- Rt button - The right button triggers the capture of images from the camera screen to flash storage. You can set it to capture single images, to record image sequences, or to freeze the live image without storing it.
- Palette - Controls which of several false-color palettes will be used to paint the live thermal image. The palettes are described further in the Putting it in Motion section.
- Temp range - The colors in your image, what temperatures do they really represent? You can choose. Auto-range changes with each frame, adjusting the colors to span the coldest to hottest pixels detected. Standard fixes the color range from 50F to 90F, a range the high-priced thermal cameras use. Cool/warm is good for imaging your warm-blooded friends in the cool outdoors. Warm/warmer is similar, but is better for the warmer indoors. Hot spots can help sense if something's getting dangerously warm. Fire & ice barely senses everyday temperatures, extremes only.
- Markers - The small crosses in the image can be made invisible.
- Image - Forward is normal. Mirrored flips the image if you want a backwards-facing selfie camera.
- Frame rate - Control the exposure time per frame. Actual frame rates vary due to computing overhead.
- Emissivity and Smoothing - These settings are under development. Check back often.
- Backlight - The LCD screen's backlight can be dimmed for nighttime viewing, or simply to extend battery life.
- Exit menu - We now return you to your regularly scheduled thermal camera.
That's it. Go ahead and experiment with different settings. Get a feel for what your thermal imaging camera can reveal. Capture some images and record some sequences. The data you obtain will give you something to analyze in upcoming chapters, but mainly it's for the fun of discovery.
The next few pages walk through the camera sketch in more detail.