Raspberry Pi temperature profile using LabVIEW

Connected to my Raspberry Pi is a DS18B20 temperature sensor which I have mounted inside the case roughly above the processor. I wanted to map the temperature profile inside the case and have a visual representation of it. To do this I joined up a Python script, an SQLite3 database and LabVIEW.

I only have one temperature sensor connected and the RasPi doesn’t run very warm so this image is rather exaggerated. I’ll explain a bit more later.
So I started off by writing a Python script that runs on my RasPi. It measures the temperature and then logs it to a SQLite3 database that I store in a shared folder on a mounted USB flash drive. I have accelerometer data in the database too, but that will be added a bit later.Raspberry Pi temperature profile using LabVIEW
That is all that happens on the RasPi. Next I wrote a LabVIEW program that queries the database over the network to get all the data. I need to do a bit of work on my query to just return the last line of data but that I’ll add in future versions.
To query the SQLite3 database, I used the this toolkit which works really well and is super simple to get set up. Once I have the temperature, I need to display it on in user interface. This is where Sensor Mapping Express VI comes in really handy.
All you need to do is point to your .stl file and select where you want to the temperature sensors to sit on the RasPi. I used this model which I converted using Google SketchUp. This is where I had to use four dummy senors to be able to show the temperature difference. I have set the outside 4 sensors to 0 degrees Celsius and only sensor 0 is getting the temperature from the database. With more sensors this can be made a lot more accurate. As I said earlier, this is just to prove a concept for now.
Every 100ms I query the database, build an array with the temperature data and then apply it to the Sensor Mapping Express VI. The temperature profile then changes according to the surface temperature of the RasPi.Raspberry Pi temperature profile using LabVIEW schematic
Here are the colours that I used for my mapping:
Temperature vs Colour mapping:
0 Celsius R-0 G-0 B-255
21.25 Celsius R-0 G-255 B-255
42.5 Celsius R-0 G-255 B-0
63.75 Celsius R-255 G-255 B-0
85 Celsius R-255 G-0 B-0
I have already connected up an ADXL345 accelerometer which is acquiring tilt and pitch values, so my next step is to be able to move the  model in LabVIEW as I move my physical RasPi.


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:

Leave a Comment

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

Scroll to Top