I'm writing code for thermistor and LED. HOW DO I WRITE THE CODE SO THE THERMISTOR CONTROL THE LED LIGHT ON AND OFF DURING TH TEMPERATURE CHANGE FROM THE THERMISTOR?
Please DO NOT YELL.
Wire the thermistor from an analogue input to ground. Put a suitable resistor (depends on the resistance of the thermistor) to 5v. Read the analogue value and switch at whatever the value is for the temperature you want.
Weedpharma
unless you want to practice programming this can be simply achieved without the use of arduino by hooking the the LED to the output of this circuit http://m.eet.com/media/1074719/0202feat1fig2.gif
Using the arduino follow these simple steps
-
Decide the temperature where the LED should turn on (or off)
-
Connect a the thermisor in potential divider circuit as shown in this link . The other resistor is preferably a variable resistor
- Attach the output to an analog input pin on the arduino an read the output using the serial monitor you will get an output range from 0-1024 which refers to 0-5v
4)For example I want to switch the LED when the temperature exceeds 40 degrees, but the normal operating temperature is 25 degrees than find the datasheet of the thermistor to find the resistance at those temperatures
-
If for example the temperature of 25 degrees the resistance is 3K and at 40 the temperature is 800 ohms. Then if we use a 3.3 k resistor (random value) which can be varied by a potentiometer. Using simple potential divider equation at 25 degrees the output voltage will be 2.7 v and when the temperature is at 40 degrees the output voltage will be 4v a voltage difference of about 1.3 large enough to be detected by the arduino hardware (4.8 mV is the smallest voltage that can be detected)
-
Now write a code that continuously check the temperature of the pin which can be implemented us the if function .
a) Read the analog pin
b) If the value read from the pin is smaller than than the value read at 40 degrees turn the led on
c) else turn off the led
Hope it help, if you dont understand something dont hesitate to ask
HOW DO I WRITE THE CODE SO THE THERMISTOR CONTROL THE LED LIGHT ON AND OFF DURING TH TEMPERATURE CHANGE FROM THE THERMISTOR?
This may come as a surprise to you but we are perfectly capable of reading lower case letters. If you want
to emphasize something the standard method is bold or underline. UPPER CASE implies you are SHOUTING ! As a general rule, it is unwise to SHOUT at someone you are asking for help.
raschemmel:
This may come as a surprise to you but we are perfectly capable of reading lower case letters. If you want
to emphasize something the standard method is bold or underline. UPPER CASE implies you are SHOUTING ! As a general rule, it is unwise to SHOUT at someone you are asking for help.
it may come as surprise to you, but he was not "shouting" anything, he infact just had the caps lock on...
and as far as I'm aware, it's still called a caps lock and not a "shout" lock.
as for the thermistor, it will give you a value you read from an analog input pin, based on that value you set your events.
It is generally accepted in all non verbal forums, that writing with caps lock on or all uppercase is yelling.
Uppercase is used to emphasise what is being said. Used for a word or phrase is ok. Used for a sentence or whole post is taken by yelling.
Weedpharma