I want to make a circuit using an Arduino that using a TDC 015 thermistor and 3 LEDs (red, green, and blue) to display temperature status. How do I connect the LEDs using a breadboard?
I have deleted your other cross-post @yahyaalbahnasawi.
Cross-posting is against the Arduino Forum rules. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.
Repeated cross-posting can result in a suspension from the forum.
In the future, please only create one topic for each distinct subject matter. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.
Thanks in advance for your cooperation.
Which Arduino are you planning to use ?
arduino uno (i also have all kinds of resistors)
Any reason you want to use a TDS 015 thermistor? This is all I could find on your thermistor. You may want to reconsider your choice of thermistor. Maybe consider a sensor like the DS18B20 temperature sensor. They are very inexpensive and come with or without sheath. Very easy to use with an Arduino or similar. Dozens of circuits and Arduino code are available.
Ron
tell me how i wire it though
if you do a web search for "arduino DS18B20" you will get plenty of links showing wiring and sample code
which specific microcontroller are you using?
EDIT: what temperature range are you looking at?
If you plan to just use it to monitor air temperature my begginers pick is the TMP36
For the LED's you should wire each to its own digital pin through a 330ohm resistor, short leg to GND and long (positive) to a digital pin, through a resistor. There are plenty of tutorials to interface a TMP36 with a Arduino like this one.
Hope this helps!!
// C++ code
//
int baselineTemp = 0;
int celsius = 0;
int fahrenheit = 0;
void setup()
{
pinMode(A0, INPUT);
Serial.begin(9600);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
}
void loop()
{
// set threshold temperature to activate LEDs
baselineTemp = 5;
// measure temperature in Celsius
celsius = map(((analogRead(A0) - 20) * 3.04), 0, 1023, -40, 125);
// convert to Fahrenheit
fahrenheit = ((celsius * 9) / 5 + 32);
Serial.print(celsius);
Serial.print(" C, ");
Serial.print(fahrenheit);
Serial.println(" F");
if (celsius <= baselineTemp) {
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
} //BLUE
if (celsius >= baselineTemp && celsius < baselineTemp + 25) {
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
} //GREEN
if (celsius >= baselineTemp + 25 && celsius < baselineTemp + 35) {
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
} //ORANGE
if (celsius >= baselineTemp + 35 && celsius < baselineTemp + 45) {
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, LOW);
} //RED1
if (celsius >= baselineTemp + 45) {
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
}
delay(20); // Wait for 0.02 seconds
}
Looks Great.(And 220 ohm is fine)
