# Nixie thermometer – the temperature sensor

luca 16/01/2016 0
The design and development of this project is described in ten blog posts: for the chronological list follow this link

After having learned how to drive a nixie tube with Arduino, today I’ll show you how to read the data coming from the temperature sensor. The sensor I chose, designed for liquid coolers, it’s a 10Kohm thermistor. It’s indeed a resistor whose value changes based on its temperature; the nominal value (10Kohm for my sensor) is the resistance the sensor has at a temperature of 25°.

I can therefore use an analog PIN of my Arduino to read the voltage across the sensor and then calculate the resistance. You also need to add a pull-down resistor – this too with a value of 10Kohm – as it follows: To convert the raw data read by Arduino’s ADC (analog to digital converter) to a temperature value, you can use the Steinhart-Hart equation: this equation calculates the absolute temperature (T, Kelvin) from the resistance (R) and 3 constants that depends on the specific thermistor you’re using. For 10Kohm sensors, the typical values of the constants are:

• a =0.001129148
• b =0.000234125
• c = 0.0000000876741

You can now write a function that calculates the Celsius temperature (Kelvin – 273,15) having the value returned by analogRead() (RawADC) as its input:

``` double Thermistor(int RawADC) {   long Resistance; double Temp;   Resistance = 10000.0*((1024.0 / RawADC) - 1); Temp = log(Resistance); Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp)); Temp = Temp - 273.15; return Temp; } long Resistance; double Temp; Resistance = 10000.0*((1024.0 / RawADC) – 1); Temp = log(Resistance); Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp)); Temp = Temp – 273.15; return Temp; } ```

I wrote a sketch (available on Github) that, every two seconds, reads the temperature from a thermistor connected to PIN A0 and displays it on the serial monitor:
{"ft_lang_label":"__label__en","ft_lang_prob":0.80843854,"math_prob":0.96579415,"size":1811,"snap":"2019-51-2020-05","text_gpt3_token_len":495,"char_repetition_ratio":0.14609851,"word_repetition_ratio":0.16393442,"special_character_ratio":0.33406958,"punctuation_ratio":0.14121038,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9967478,"pos_list":[0,1,2,3,4,5,6,7,8],"im_url_duplicate_count":[null,3,null,3,null,3,null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-01-17T16:23:47Z\",\"WARC-Record-ID\":\"<urn:uuid:9d5b627e-2674-4fe6-88a9-205a437bb551>\",\"Content-Length\":\"68000\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:c2730356-2eca-4d8d-b33d-a08610e674cf>\",\"WARC-Concurrent-To\":\"<urn:uuid:f6c23d4e-6393-4ce1-967a-6714b744bdf2>\",\"WARC-IP-Address\":\"217.64.195.248\",\"WARC-Target-URI\":\"http://www.lucadentella.it/en/2016/01/16/termometro-nixie-il-sensore-temperatura/\",\"WARC-Payload-Digest\":\"sha1:AB3BRTI7NQ22EHQX3Z3SV7DBUNQQGNU6\",\"WARC-Block-Digest\":\"sha1:BNIH7TUVXCDZ3UPWKTVKPARNZASQXI2H\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-05/CC-MAIN-2020-05_segments_1579250589861.0_warc_CC-MAIN-20200117152059-20200117180059-00474.warc.gz\"}"}