thermistor and 4 digit display

I am new to Arduino and I was wondering how to have code that takes a reading form the thermistor and prints the reading on to the 4 digit 7-segment display. I used this circuit I found online

https://www.bing.com/images/search?view=detailV2&id=FD231B89CAD5D61282FBE6FCC9752204A9B7C2CC&thid=OIP.AT0cAfMUs5K2s_3FqG64rQHaHA&mediaurl=http%3A%2F%2Fwww.circuitbasics.com%2Fwp-content%2Fuploads%2F2017%2F05%2FArduino-7-Segment-Display-4-Digit-Temperature-Display.png&exph=1210&expw=1280&q=arduino+temperature+sensor+with+segement+display&selectedindex=3&ajaxhist=0&vt=0&eim=0,1,2,3,4,6,8,10

I also want to incorporate a red, yellow, and blue light that turn on based on the temperature value. Thanks!

Split Your proj into small parts. Part 1) Get reading the sensor type working. Use Serial monitor to show values. Part 2) Make printing on the display work. Part 3) Make turning the colored LEDs work.

Use the knowledge gained from this to assemble the parts together.

What you found looks cool and is easy to build. Why not start by defining the problem with specifications and a flow chart. What is the expected outcome. Purchase the Arduino cookbook and read it, this will give you some basics. also use the online tutorials and videos available, there are many good ones on this web site. At this point you will be able to define the problem and may have already solved it.

Thermistor tutorial.

Seven segment display tutorial

I made a post before on a project and decided to take it step by step. I have coded a simple thermistor, the code is here:

#include <math.h>

double Thermister(int RawADC) {
double Temp;
Temp = log(((10240000/RawADC) - 10000));
Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));
Temp = Temp - 273.15; // Convert Kelvin to Celcius
Temp = (Temp * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit
return Temp;
}

void setup() {
Serial.begin(115200);
}

void loop() {
Serial.println(int(Thermister(analogRead(0)))); // display Fahrenheit
delay(100);
}

I opened serial monitor and it is not giving temperatures just question marks. I am new and don’t really know how to use serial monitor. Thanks!

Please read "How to use this Forum" and look for how to use "code tags", the symbol up to the left in this window. Use Autoformat in the IDE and copy the code into the code tags. That allone often shows some of the common mistakes like mismatched curly brackets.

Reading question marks in Serial monitor is likely due to a mismatch in baudrate between S M and the "project". Check that the IDE Serial baudrate is 115200 as stated in the code.

andrewschwab:
I made a post before on a project and decided to take it step by step. I have coded a simple thermistor, the code is here:

#include <math.h>

double Thermister(int RawADC) {
double Temp;
Temp = log(((10240000/RawADC) - 10000));
Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));
Temp = Temp - 273.15; // Convert Kelvin to Celcius
Temp = (Temp * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit
return Temp;
}

void setup() {
Serial.begin(115200);
}

void loop() {
Serial.println(int(Thermister(analogRead(0)))); // display Fahrenheit
delay(100);
}

I opened serial monitor and it is not giving temperatures just question marks. I am new and don’t really know how to use serial monitor. Thanks!

Don’t keep spamming with new posts!

I have reported to the Moderators and asked them to merge.

.

void loop() { int adcVal = analogRead(0); Serial .print("raw ADC value = "); Serial.println(adcVal);. Serial.println(int(Thermister(adcVal))); // display Fahrenheit delay(100); } I inserted a serial print to see what values that the ADC is returning. What values are showing?

@andrewschwab

TOPIC MERGED.

Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you take a few moments to Learn How To Use The Forum. Other general help and troubleshooting advice can be found here. It will help you get the best out of the forum.

groundFungus: void loop() { int adcVal = analogRead(0); Serial .print("raw ADC value = "); Serial.println(adcVal);. Serial.println(int(Thermister(adcVal))); // display Fahrenheit delay(100); } I inserted a serial print to see what values that the ADC is returning. What values are showing?

I Have incorporated this inside my code and it is still giving me zeros. Could it be the circuit? thanks for helping though!

Post a clear photo of your wiring.

Post a copy of the serial monitor output.

I used this exact wiring with a 10k resistor.

Not exactly a clear picture...

Sorry I followed this picture exactly with a 10k resistor

https://www.bing.com/images/search?view=detailV2&id=0E65FE33DEBD32E41CFC952C9C8281DE6C69A7C9&thid=OIP.RBQ3KK1EwrGfp-2tIxZx8wHaFC&mediaurl=https%3A%2F%2Fcdn.tutsplus.com%2Fmac%2Fuploads%2F2013%2F09%2Fthermistor-setup-small.png&exph=388&expw=570&q=simple+thermistor+arduino&selectedindex=5&ajaxhist=0&vt=0&eim=0,1,2,3,4,6,8,10

No, we want to see the actual circuit that you built.

One of the wires wasn't plugged in. I feel dumb. Thanks for helping!

Working now?

One of the wires was not plugged in fully. Thank you for helping

Small issues often capsize huge things…. Congrats!