{"id":13676282,"url":"https://github.com/pimoroni/mlx90640-library","last_synced_at":"2025-04-29T03:30:48.457Z","repository":{"id":34609307,"uuid":"138606894","full_name":"pimoroni/mlx90640-library","owner":"pimoroni","description":"Python library for the MLX90640 thermal camera","archived":false,"fork":true,"pushed_at":"2024-07-15T21:08:59.000Z","size":2890,"stargazers_count":137,"open_issues_count":8,"forks_count":86,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-20T14:18:49.085Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://shop.pimoroni.com/products/mlx90640-thermal-camera-breakout","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"melexis/mlx90640-library","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pimoroni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-25T14:33:26.000Z","updated_at":"2025-04-17T18:36:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pimoroni/mlx90640-library","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pimoroni%2Fmlx90640-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pimoroni%2Fmlx90640-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pimoroni%2Fmlx90640-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pimoroni%2Fmlx90640-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pimoroni","download_url":"https://codeload.github.com/pimoroni/mlx90640-library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251426738,"owners_count":21587642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T13:00:21.616Z","updated_at":"2025-04-29T03:30:46.882Z","avatar_url":"https://github.com/pimoroni.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# mlx90640-library\n\nThis Python wrapper of the Melexis MLX90640 library was written for use with the Raspberry Pi and our [MLX90640 breakout](https://shop.pimoroni.com/products/mlx90640-thermal-camera-breakout). While you are free to use this software with whatever combination of device you choose, we unfortunately lack the resources to test and support any other combinations.\n\n** Warning: ** We have reason to believe that using this library in conjunction with a Jetson Nano could damage your device, please see: https://github.com/pimoroni/mlx90640-library/issues/38\n\n## Raspberry Pi Users\n\n** EXPERIMENTAL **\n\nThis port uses either generic Linux I2C or the  bcm2835 library.\nUpon building, the mode is set with the I2C_MODE property, i.e. `make I2C_MODE=LINUX` or `make I2C_MODE=RPI`. The default is LINUX, without the need for the bcm2835 library or root access.\n\n### Generic Linux I2C Mode\n\nMake sure the Linux I2C dev library is installed:\n\n```text\nsudo apt-get install libi2c-dev\n```\n\nTo get the best out of your sensor you should modify `/boot/config.txt` and change your I2C baudrate.\n\nThe fastest rate recommended for compatibility with other sensors is 400kHz. This is compatible with SMBus devices:\n\n```text\ndtparam=i2c1_baudrate=400000\n```\n\nThis will give you a framerate of - at most - 8FPS.\n\nIf you're just using the MLX90640 and, for example, the 1.12\" OLED, you can safely use 1MHz:\n\n```text\ndtparam=i2c1_baudrate=1000000\n```\n\nThis will give you a framerate of - at most - 32FPS.\n\nNow build the MLX90640 library and examples in LINUX I2C mode:\n\n```text\nmake clean\nmake I2C_MODE=LINUX\n```\n\n### BCM2835 Library Mode\n\nTo use the bcm2835 library, install like so:\n\n\n```text\nmake bcm2835\n```\n\nOr, step by step:\n\n```text\nwget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.55.tar.gz\ntar xvfz bcm2835-1.55.tar.gz\ncd bcm2835-1.55\n./configure\nmake\nsudo make install\n```\n\n### Dependencies\n\nlibav for `video` example:\n\n```text\nsudo apt-get install libavutil-dev libavcodec-dev libavformat-dev\n```\n\nSDL2 for `sdlscale` example:\n\n```text\nsudo apt install libsdl2-dev\n```\n\n# Building\n\nAfter installing the dependencies, you can build the library. Build-modes are:\n\n* `make` or `make all`: build the library and all dependencies. Default is to use standard linux I2C-Drivers, specify Raspberry Pi driver with `make I2C_MODE=RPI`\n* `make examples`: only build examples, see below\n* `sudo make install`: install libraries and headers into `$PREFIX`, default is `/usr/local`\n\nAfterwards you can run the examples or build the python binding, see readme in the subfolder.\nIf you built the examples or library using the native bcm2835 I2C-Driver, you need to run all applications and examples as root.\nHence, `sudo examples/\u003cexampleame\u003e` for one of the examples listed below, or without `sudo` when using the standard Linux driver.\n\n# Examples\n## fbuf\n\n```\nmake examples/fbuf\nsudo examples/fbuf\n```\n\nThis example uses direct-to-framebuffer rendering and black-blue-green-yellow-red-purple-white false colouring.\n\nIf you have issues with the output image, set \"`IMAGE_SCALE`\" to a smaller number.\n\n## interp\n\n```\nmake examples/interp\nsudo examples/interp\n```\n\nThis example uses direct-to-framebuffer rendering and black-blue-green-yellow-red-purple-white false colouring.\n\nIt also has 2x bicubic resize filter.\n\nIf you have issues with the output image, set \"`IMAGE_SCALE`\" to a smaller number.\n\n## test\n\n```\nmake examples/test\nsudo examples/test\n```\n\nThis example draws out to the console using ANSI colours and the full block char.\n\nTo see the actual temperature values, change \"`FMT_STRING`\" from the block char to the float format.\n\n## step\n\n```\nmake examples/step\nsudo examples/step\n```\n\nAttempt to run in step by step mode (experimental)\n\n## sdlscale\n\nDisplays the MLX90640 sensor full-screen using hardware acceleration in SDL2.\n\nHit Spacebar to change from aspect-ratio correct to full-screen-stretched modes.\n\nHit Escape to exit.\n\n```\nmake examples/sdlscale\nsudo examples/sdlscale\n```\n\nRequires SDL2 libraries:\n\n```\nsudo apt install libsdl2-dev\n```\n\nOn Raspbian Lite you may wish to build SDL2 from source with X support disabled to avoid pulling in ~200MB of dependencies. Before configuring/compiling ensure you have `libudev-dev` installed for input support.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpimoroni%2Fmlx90640-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpimoroni%2Fmlx90640-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpimoroni%2Fmlx90640-library/lists"}