You may have noticed that the values from the Temperature block tend to raise quite quickly and after a while, the readings are off from the actual ambient temperature. The reason for this behaviour is that blocks naturally warm up while operating and this affects the sensor inside of the Temperature Block. If your block is attached directly under or over your WiFi block, the readings may vary more drastically. This guide will show you a simple way to compensate the readings using the Logic Maker, and how to display the compensated value using a Widget. This guide assumes your Temperature block is already connected and visible from your menu list. If you don’t know how to do this, please check the Using The Temperature Block article.
NOTE: You will use a non-default widget in this guide. If you don’t know how to install widgets please read the How To Install Virtual Blocks And Widgets guide.
- Make sure your Temperature block hasn’t been used for at least 20 minutes, and it has been sitting in the area you want to measure. Power it up and add it to the canvas. Now, bring up the Data Feed by clicking on the canvas icon:
- The Data Feed will show you the current temperature. This reading is very important because it's the actual temperature of your environment before the heat coming from the other blocks start to affect the measurements. Write it down somewhere since you will need it later.
- Leave the block powered up and working for at least 15 minutes or until the readings stabilize, in the area you want to measure. Open the block's Logic Maker by clicking the middle action button:
- Inside of the Logic maker, add an INPUT, ADDITION and OUTPUT Gates. Connect them up as shown below:
- To work out what value you should write in the ADDITION Gate, use the Data Feed (‘Cmd+I’ on MacOS and ‘Ctrl+I’ on Windows) to check the current (uncompensated) temperature coming from the block and compare this value with the one displayed when you first connected the block. For instance, if the original temperature was 19.13 degrees and the current temperature is 31.13, type “-12” in the ADDITION Gate (19.13 - 31.13 = -12).
The logic is simple, when the Temperature block produces new readings, the ADDITION Gate subtracts -12 to the Celsius value and sends the result to the OUTPUT Gate which is the one that makes this value available to Widgets. - Give a name to your OUTPUT Gate and press the Apply button to save your changes. Press Cmd+D on MacOS and Ctrl+D on Windows to switch to the ‘Dashboard’ view. You can alternatively close the Logic Maker and click on the ‘Dashboard’ button located at the top of the window:
- In the Dashboard add a ‘Numeric Display’ widget. If you don’t see it in your list and don’t know how to add it, please read the Installing Virtual Blocks article:
- Open the Properties Panel of the widget by clicking on the ‘gear’ icon:
- From the properties panel, select the data source. In this case, it’s the name you typed into your OUTPUT Gate in step 6.
Optionally, you can add a title to your widget and select the number of decimal places to show. Your Widget should now display the compensated value, which should be closer to the actual room temperature: