<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Simple thermometer using Arduino Micro and OLED display</title><link>/products/arduino/arduino-projects/b/blog/posts/simple-thermometer-using-arduino-micro-and-oled-display</link><description>A colleague recently made an Arduino-based thermometer to measure how hot it gets in the office. I thought I&amp;#39;d recreate and document the project with the components I have at hand Circuit The circuit is based around the TMP36 temperatu...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Simple thermometer using Arduino Micro and OLED display</title><link>https://community.element14.com/products/arduino/arduino-projects/b/blog/posts/simple-thermometer-using-arduino-micro-and-oled-display</link><pubDate>Wed, 08 Aug 2018 17:26:08 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bb92e072-9bf1-4740-a077-0d1ba5905db5</guid><dc:creator>phil.s</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Better late than never.&lt;/p&gt;&lt;p&gt;Very good - for a newcomer to OLEDs, this was just what I was after.&lt;/p&gt;&lt;p&gt;I am going to fit two of these to a fridge and a freezer. I suspect that the temperature control of the fridge thermostat is&amp;nbsp; pretty poor with swings between 1-degree C and 10-degrees C.&lt;/p&gt;&lt;p&gt;This will be the basis of a new fridge thermostat. I was using the TMP36 for the freezer which it&amp;#39;s ideal for.&lt;/p&gt;&lt;p&gt;My setup is 1.3&amp;quot; 128 x 64 OLED from Lamnu (?) on Amazon and has SPI as well as I2C. As reviewers have noted, documentation is next to useless.&lt;/p&gt;&lt;p&gt;So for I2C, remove the 4K7 SMD resistor marked SPI and short out the I2C pads (not the SPI as well). Subtstitute SD1106 for SSH1306 libraries and change references accordingly.&lt;/p&gt;&lt;p&gt;On Nano or Uno, use A4 for SDA and A5 for SCL.&lt;/p&gt;&lt;p&gt;I like the averaging and the fact that I didn&amp;#39;t have to code for negative values.&lt;/p&gt;&lt;p&gt;The only problem I had was with the I2C address - I tried Nick Gammons&amp;#39; address finder sketch, but it couldn&amp;#39;t find it. Is this because the SSH1106 chip doesn&amp;#39;t support full read/write?&lt;/p&gt;&lt;p&gt;However, 0x3D worked for the 128 x 64&lt;/p&gt;&lt;p&gt;Thanks a lot.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=3&amp;AppID=149&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Simple thermometer using Arduino Micro and OLED display</title><link>https://community.element14.com/products/arduino/arduino-projects/b/blog/posts/simple-thermometer-using-arduino-micro-and-oled-display</link><pubDate>Tue, 15 Mar 2016 12:57:12 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bb92e072-9bf1-4740-a077-0d1ba5905db5</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hi Frederick,&lt;/p&gt;&lt;p&gt;first of all thank you for this project, it&amp;#39;s perfect for my needs.&lt;/p&gt;&lt;p&gt;I have one question for 2nd code - with button.&lt;/p&gt;&lt;p&gt;I&amp;#39;m confused with this line: &lt;/p&gt;&lt;p&gt;attachInterrupt(4, debounce, FALLING); - instead of 4, do we maybe must use pin 7 for interrupt? If no, can you please explain me then connection between pin7 (button) and pin4.&lt;/p&gt;&lt;p&gt;Thank you very much.&lt;/p&gt;&lt;p&gt;P.S. I&amp;#39;m new to this and learning every day...&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=3&amp;AppID=149&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Simple thermometer using Arduino Micro and OLED display</title><link>https://community.element14.com/products/arduino/arduino-projects/b/blog/posts/simple-thermometer-using-arduino-micro-and-oled-display</link><pubDate>Sun, 05 Jul 2015 08:46:58 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bb92e072-9bf1-4740-a077-0d1ba5905db5</guid><dc:creator>fvan</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Added a button linked to an interrupt to toggle the displayed value between degrees C, F and K. Updated the post above &lt;span&gt;[View:/resized-image/__size/16x16/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-bb92e072-9bf1-4740-a077-0d1ba5905db5/2352.contentimage_5F00_1.png:16:16]&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=3&amp;AppID=149&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Simple thermometer using Arduino Micro and OLED display</title><link>https://community.element14.com/products/arduino/arduino-projects/b/blog/posts/simple-thermometer-using-arduino-micro-and-oled-display</link><pubDate>Sun, 05 Jul 2015 07:54:13 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bb92e072-9bf1-4740-a077-0d1ba5905db5</guid><dc:creator>balearicdynamics</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hello, the following two sources (sorry but it is impossible to attach) are the temperature class I use on ChipKit PI - that is 100% compatible with Arduino. It makes available the temperature reading in all the known (by me) formats: Fahrenheit, Celsius, Kelving, Rankine. You can use it as a library in the Arduino IDE or include the two files in your own project as well.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Enrico&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Include file&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=%2F**%0A*+%5Cfile+Temperature.h%0A*+%5Cbrief+Constants+and+class+prototypes%0A*%2F%0A%0A%23ifndef+Temperature_h%0A%23define+Temperature_h%0A%0A%23include+%3Cinttypes.h%3E%0A%0A%2F%2F%21+Constant+for+Kelvin+temperature+conversion%0A%23define+KELVINC+273%0A%0A%2F%2F%21+Absolute+zero+value+for+calculation%0A%23define+ABSOLUTE_ZERO_CELSIUS+-273.15%0A%0A%2F%2F%21+Celsius+temperature+offset.+Should+be+calibrated+depending+on+the%0A%2F%2F%21+analog+reading+from+the+choosen+chip.+This+value+is+preset+for%0A%2F%2F%21+LM35+temperature+sensor.%0A%23define+TEMP_OFFSET+10%0A%0A%2F%2F%21+Analog+channel+for+the+temperature+sensor%0A%23define+TEMP_SENSOR+A1%0A%0Aclass+Temperature%0A%7B%0A++public%3A%0A++++Temperature%28%29%3B%0A++++void+CalcTemp%28float+sensor%29%3B%0A++++float+Celsius%28%29+const%3B%0A++++float+Fahrenheit%28%29+const%3B%0A++++float+Kelvin%28%29+const%3B%0A++++float+Rankine%28%29+const%3B%0A++private%3A%0A++++float+_Celsius%3B%0A++++float+_Fahrenheit%3B%0A++++float+_Kelvin%3B%0A++++float+_Rankine%3B%0A++++float+_sensorValue%3B%0A%7D%3B%0A%23endif]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Class file&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=%2F**%0A*+%5Cfile+Temperature.cpp%0A*+%5Cbrief+Class+to+manage+the+internal+temperature+of+the+devices.%0A*%0A*+The+Temperature+class+acquires+data+from+an+LM35+temperature+sensor%0A*%0A*%2F%0A%23include+%22Temperature.h%22%0A%0A%2F**%0A++*+%5Cbrief+Temperature+class+constructor.+Set+the+analog+pin+for+data+reading%0A++*%2F%0ATemperature%3A%3ATemperature%28%29+%7B%0A%7D%0A%0A%2F**%0A*+%5Cbrief+Convert+the+analog+value+to+the+respective+value.%0A*%0A*+As+the+call+to+the+temperature+reading+is+not+a+high+priority+task+and+does%0A*+not+need+very+high+responsivity%2C+when+the+analog+data+are+read+they+are+immediately%0A*+converted+to+the+three+temperature+scales%3A+Celsius%2C+Kelvin+and+Farehneit.%0A*%2F%0Avoid+Temperature%3A%3ACalcTemp%28float+sensor%29+%7B%0A++_sensorValue+%3D+sensor%3B%0A++_Celsius+%3D+%28%28%28_sensorValue+%2F+1024%29+*+5%29+*+100%29+-+TEMP_OFFSET%3B+%2F%2F+convert+the+reading+to+C%0A++_Fahrenheit+%3D+_Celsius+*+1.8+%2B+32.0%3B+%2F%2F+convert+the+reading+to+F%0A++_Kelvin+%3D+_Celsius+-+ABSOLUTE_ZERO_CELSIUS%3B+%2F%2F+convert+the+reading+to+K%0A++_Rankine+%3D+%28%28_Celsius+-+ABSOLUTE_ZERO_CELSIUS%29+*+9%29+%2F+5%3B+%2F%2F+convert+the+reading+do+R%0A%7D%0A%0Afloat+Temperature%3A%3ACelsius%28%29+const+%7B%0A++return%28_Celsius%29%3B%0A%7D%0A%0Afloat+Temperature%3A%3AFahrenheit%28%29+const+%7B%0A++return%28_Fahrenheit%29%3B%0A%7D%0A%0A%0Afloat+Temperature%3A%3AKelvin%28%29+const+%7B%0A++return%28_Kelvin%29%3B%0A%7D%0A%0A%0Afloat+Temperature%3A%3ARankine%28%29+const+%7B%0A++return%28_Rankine%29%3B%0A%7D]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;In the sketch,&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=%23include+%22Temperature.h%22]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Then create a global library instance&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=%2F%2F%21+Internal+temperature+sensor+class+instance%0ATemperature+internalTemp%3B]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;When needed (in the setup() or loop() functions) call the temperature reading&lt;/p&gt;&lt;p&gt;Here I use the TEMP_SENSOR analog pin value, but you can use your own method&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=++%2F%2F+Read+the+actual+temperature%0A++internalTemp.CalcTemp%28analogRead%28TEMP_SENSOR%29%29%3B]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Then everywhere you need you have the converted temperature in all the formats calling the class methods as shown below&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=Serial.println%28internalTemp.Celsius%28%29%29%3B%0ASerial.println%28internalTemp.Fahrenheit%28%29%29%3B%0ASerial.println%28internalTemp.Kelvin%28%29%29%3B%0ASerial.println%28internalTemp.Rankine%28%29%29%3B]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;img src="https://community.element14.com/aggbug?PostID=3&amp;AppID=149&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Simple thermometer using Arduino Micro and OLED display</title><link>https://community.element14.com/products/arduino/arduino-projects/b/blog/posts/simple-thermometer-using-arduino-micro-and-oled-display</link><pubDate>Sat, 04 Jul 2015 20:58:30 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bb92e072-9bf1-4740-a077-0d1ba5905db5</guid><dc:creator>Robert Peter Oakes</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Its all in the software so you can have it show in any unuit you prefer, Kelvin anyone &lt;span&gt;[View:/resized-image/__size/16x16/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-bb92e072-9bf1-4740-a077-0d1ba5905db5/contentimage_5F00_1.png:16:16]&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=3&amp;AppID=149&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Simple thermometer using Arduino Micro and OLED display</title><link>https://community.element14.com/products/arduino/arduino-projects/b/blog/posts/simple-thermometer-using-arduino-micro-and-oled-display</link><pubDate>Sat, 04 Jul 2015 19:40:03 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bb92e072-9bf1-4740-a077-0d1ba5905db5</guid><dc:creator>clem57</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Can this show F degrees? Maybe a button for other countries like US.&lt;/p&gt;&lt;p&gt;Clem&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=3&amp;AppID=149&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Simple thermometer using Arduino Micro and OLED display</title><link>https://community.element14.com/products/arduino/arduino-projects/b/blog/posts/simple-thermometer-using-arduino-micro-and-oled-display</link><pubDate>Sat, 04 Jul 2015 19:21:36 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bb92e072-9bf1-4740-a077-0d1ba5905db5</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Outside is too hot for me.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I prefer your room temperature, which is at least comfortable.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;DAB&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=3&amp;AppID=149&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>