This is a project that I have had plans to create since long time ago. But I have been busy with other tasks and projects. Also, I faced some technical challenges in creating the PCB for this project. But finally, that vision to create a PCB and make a project out of it is here.!
I do not want to bore you with reading about this project. But a part of the project may be boring for you to read. But mostly, I will try to make it a easy reading.
First of all, this project is about creating and visualizing heat-map in real-time using real sensors. For this project, I am creating a custom PCB using AMG8833 sensor from Panasonic. The project is also capable of detecting events such as fire or ice colds. There is no AI or ML stuff which makes it simple and easy to run on Tiny Microcontroller devices having small amount of RAM memory. The project can be extended to create a cloud based alert system or add wireless communication. But for now that feature is not included.
PCB creation in KiCadAs we know that KiCad is a free and open-source PCB design tool used by many open-source enthusiast people like me. In early 2025, I had idea to create a PCB with Nordic Semiconductor nRF54L15 SoC. The idea was delaying due to some technical difficulties and creating RF circuit for the first time. But finally, I ordered the PCB with NextPCB.
I also added Panasonic 8x8(64 pixels) IR sensor array for temperature measurements. The sensor can detect temperature in the range of around -15 *C to 125 *C. The sensor is capable of working on both (3.3v & 5v) supply.
For the PCB design I have created a simple schematic with AMG-8833. The sensor is connected over I2C interface with pull-up resistors values in the range of 10K on SCL, SDA and INT pins. Apart from that, the sensor needs some capacitors on power pin for better power stability.
After the schematic is complete the I created the layout design in KiCad by following all the recommendations from the manufacturers such as Nordic Semi and Panasonic.
After creating the layout in KiCad, I have ordered the PCB to NextPCB and I got the final PCB in some days. The expectations v/s reality was quite a match.
Panasonic AMG8833 is a 8x8(64 pixels) IR sensor array for temperature measurements. The sensor can detect temperature from around -15 *C to 125 *C. The sensor is capable of working on both (3.3v & 5v) supply. The values for temperature are 12-bit ( 11+ 1 sign bit ) value.
This temperature sensor is suitable for some tasks and it is not suitable for others. For example, if someone want to detect a human being or detect skin temperature, this sensor may not be the right choice. It may not be accurate at that scale of temperature measurement. But the sensor is good for detecting temperature difference of more than +/-5 *C.
This sensor can be used for following applications
- Fire detection in Industrial/Automotive application
- Freezing temperature detection
- Smart home/ Smart kitchen
After sensor is selected and PCB is ready, creating heat map on LCD was a bit challenging. Specifically, the MCU with less amount of RAM (<256kb) is not that much able to handle the LVGL and update the display frequently. The first thing that I tried was nRF52840-DK along with Adafruit 2.8" display. I connected the sensor over I2C interface and used the LVGL display library. The code compiled correctly and I was able to create a simple 64x64 canvas on the display to visualize the heatmap. This was the point where I realized that is possible to create a heatmap using small MCU like nRF52840.
I tried a simple code in Zephyr and NCS to create a simple heatmap. The following image shows it. The image is updated for the first few seconds and then it was not.
The issue is that there was not enough RAM memory. 256kb is quite low for reading the 8x8 sensor data over I2C and updating the display regularly. The reading of sensor needs buffer with at least 128 bytes and the LVGL buffer itself requires more than 144kb of RAM. Hence, here, I have to make a design decision.
I decided to use Unihiker-K10 development board. This board comes with ESP32-S3 dev module, LCD display and various sensors and RGB LEDs. It also has Mic, camera and I2S speaker. It has more RAM and flash memory that is needed for this project. It is faster than nRF52840 at the cost of more power consumption. But it would be suitable for this project. I can use I2C grove connector to connect the AMG8833 sensor on my custom PCB.
The connection between the Unihiker and the customs PCB with AMG8833 is simple. I am using I2C interface to connect the sensor to Unihiker. The following image explains it all.
(Note : I have used Zephyr RTOS and NCS for nRF52840-DK already and have attached that code to the attachments)
There are several choices here to program the Unihiker-K10 development board. Basically, all we need is support for ESP32-S3, a display driver and I2C device support. For this project I have decided to use Micropython interface. I may have used ESP-IDF or Zephyr RTOS but in that case it may take time for the development and for simplicity and to save time I decided to use Micropython. Also, Micropython is official supported by DFRobot for Unihiker-K10 platform. They have library for display and other sensors on board.
To install the Micropython on K10, you can follow the official wiki page of DFRobot.
After installing the firmware next step was to create a code to read the sensor data. I am going to attach the full code in the attachment, but I will explain few important bits here as well.
In the following micro python code, I am first using import to import the required modules. Then I am setting the Pins for the ESP32 connected to the sensor over I2C and the speed of I2C is set to 400khz.
The next thing is to set the sensor in a mode that it can send the values over I2C interface regularly. For that I am using a Normal mode and setting the FPS rate to 10. This will give us faster update intervals needed for the heatmap to look real.
In the while loop, I am doing a burst read to read the sensor data. Then I am also doing some bit manipulations to correctly create the sign(+/-) of the data. This is all that is required to configure the sensor.
from machine import Pin, I2C
import time
# Configure I2C pins and frequency
# Adjust 'scl' and 'sda' pins according to your board
i2c = I2C(0, scl=Pin(48), sda=Pin(47), freq=400000)
# Normal mode
i2c.writeto_mem(0x68, 0x00, bytes([0x00]))
time.sleep(0.5)
# Initial Reset
i2c.writeto_mem(0x68, 0x01, bytes([0x3F]))
time.sleep(0.5)
# 10 FPS setting
i2c.writeto_mem(0x68, 0x02, bytes([0x00]))
time.sleep(0.5)
while(True):
data = i2c.readfrom_mem(0x68, 0x80, 128)
count = 0
time.sleep(0.2)
print('\n')
print('New Frame')
incre = 0
for i in range(0, 127, 2):
count += 1
temp = ((data[i+1] << 8 | data[i]) & 0xFFF)
if(temp & 0x800):
temp -= 0x1000
temperature = (temp) * 0.25
disp_data[incre]=temperature
incre += 1For the display interface I am using simple code to update the display with the correct sensor values that we have read above. It is required to scale the display correctly to have good visuals. I am using a rectangle with size of 24 pixels each to make it larger and much visible. For example, the 8x8 values are each displayed with 24 pixels (x, y) rectangle.
from unihiker_k10 import screen, rgb
import lvgl as lv
raws = 8
cols = 8
cell_size = 24
for row in range(raws):
for col in range(cols):
r, g, b = value_to_color_nm(disp_data[i])
i+=1
x0 = col * cell_size
y0 = row * cell_size
screen.draw_rect(x0+20, y0+70, cell_size, cell_size, r << 16 | g << 8 | b, r << 16 | g << 8 | b)
screen.draw_text(text="MAX: "+str(max_temp)+" C",x=20,y=2,font_size=24,color=0xFF0000)
screen.draw_text(text="MIN: "+str(min_temp)+" C",x=20,y=25,font_size=24,color=0xFF0000)
screen.show_draw()
# Create a screen
scr = lv.screen_active()
time.sleep(0.5)Finaly, there is a code to calculate the Max/Min temperature and display it on the screen. Also, the LED is RED if the temperature is above some threshold and it is blue if temperature is below some threshold.
max_temp = max(disp_data)
min_temp = min(disp_data)
if(max_temp > 50):
rgb.write(num = 0, R=255,G=0,B=0)
rgb.write(num = 1, R=255,G=0,B=0)
rgb.write(num = 2, R=255,G=0,B=0)
elif(min_temp < 5):
rgb.write(num = 0, R=0,G=0,B=255)
rgb.write(num = 1, R=0,G=0,B=255)
rgb.write(num = 2, R=0,G=0,B=255)
else:
rgb.clear()VideoConclusionFor this project I was able to create a nice heat map on a simple display. The commercial products for such devices are quite expensive. I was able to create a small device like that, it's my pleasure. Also, I am able to share my work with you is also my pleasure. I would also like to thank Hackster.io for providing us the platform to share our work.
This project can be extended in several possible ways. One of them could be to add more AMG8833 sensors to have higher resolutions. But as I told it is cheaper than the commercially available products. One more thing that someone could do is add some connectivity options such as WiFi, cellular and a cloud based alert system.
Note 1: In the BOM I have added one Grove AMG8833, that is for simplicity, I am using a AMG8833 from my customs PCB.
Note 2: I had some issues uploading my files, such as .zip file containing my NCS project for nRF52, But I think it will be solved and there would be a way to add some project files.



_4YUDWziWQ8.png?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)
Comments