Forgive me i am new to Arduino Language, i have nearly completed a milling machine conversion to CNC control, all i have left is the Cabinet cooling to consider, i would like it to be OFF until a set Temperature, come ON at the set point and go OFF when Temperature as reduced to set point. I amusing an Arduino Uno R3, i would like to save my Arduino for future projects, so i would use a ATTiny 85 chip, it would also be nice to have an LED indication that the Fan is running, and a LCD on the front of my cabinet showing the current Temperature, so i need a sketch for this to happen, can anyone help me.
If you have a LCD, the 2 line by 16 character ones being dirt cheap, you do not really need the LED - just say "Fan On" on the second line. You can use reverse blocks to make it more obvious from a distance.
Forgive me i am new to Arduino Language, i have nearly completed a milling machine conversion to CNC control, all i have left is the Cabinet cooling to consider, i would like it to be OFF until a set Temperature, come ON at the set point and go OFF when Temperature as reduced to set point. I amusing an Arduino Uno R3, i would like to save my Arduino for future projects, so i would use a ATTiny 85 chip, it would also be nice to have an LED indication that the Fan is running, and a LCD on the front of my cabinet showing the current Temperature, so i need a sketch for this to happen, can anyone help me.
To summerise : -
Fan ON & OFF controlled by Temperature set point.
Use of a ATTiny 85
LCD for real time viewing.
LED indication of Fan running.
Regards
Ray
For temperature readings, try an LM34 or LM35.
These are little 3 terminal packages (TO-92 - like a little black transistor) that are calibrated for 10 millivolts per degree (degrees F for the LM34 and degrees C for the LM35).
They just take 5 volts and ground, and the third pin is the output which would go directly to an AVR analog input pin.
They are calibrated and linearized, so all you need to do is look for the voltage that corresponds to the temperature setpoint you want.
Since they draw less than 100 MICRO-amperes of current, you can use an AVR pin (digitalWrite HIGH) to power it.
Krupski:
They are calibrated and linearised, so all you need to do is look for the voltage that corresponds to the temperature setpoint you want.
But the trouble is, the Arduino isn't calibrated and regulated so well (see other discussions on this matter), so you then need to both calibrate it and provide a well-regulated supply or voltage reference before you can do so. That's why they make digital temperature sensors.
Krupski:
They are calibrated and linearised, so all you need to do is look for the voltage that corresponds to the temperature setpoint you want.
But the trouble is, the Arduino isn't calibrated and regulated so well (see other discussions on this matter), so you then need to both calibrate it and provide a well-regulated supply or voltage reference before you can do so. That's why they make digital temperature sensors.
The Arduino has a regulated power source (a 117-5) which is quite good. The A/D is referenced from the 5 volt rail, so it produces fairly accurate results.
A sensor to control a fan at a given temperature doesn't need to be accurate to 1/100 of a degree... and how to access a digital sensor and drive an LCD display when the OP wants to use an 8 pin AVR?
Lots of beginners try to calculate the resistor for an LED and plug the numbers into Ohm's law, then go hunting for a 469.725 ohm resistor. Later when they have experience, they know to use a 470.
Many Thanks everyone for your help.
Firstly a bit about myself so you know where i am coming from. I am a retired Mechanical Engineer (65 y.o.) I understand and have great knowledge of Basic Electricity and control systems, but i only have a small Electronics knowledge, on to my problem.
I have an LM35 sensor to use, i think i understand what most of your comments are about, but still no schematic, is there a schematic out there in cyberspace i can use, because i think it will be years before i get to your knowledge levels, i can read schematics easily, having spent a lifetime following them.
Getting the answer as a digital value eliminates the whole issue of calibration and accuracy of an analog sensor, so from the sketch designer's point of view it's a simpler solution as well as a better one. Given how cheap they are and how easy to use, the digital sensor is IMO the obvious choice.
I'm using a DS18B20 digital sensor for my fan control.
It doesn't seem like the original poster needs .1 degee of accuracy or to put several temp sensors on the same line.
He just needs one and being able to put many on the same line is one of the main reasons for the digital sensor.
I am really struggling here, what i need is a schematic with a sketch, i have the LCD, i have the ATtiny 85, and an LM35 sensor, if it cannot be done so be it, but i have not come across any samples of this circuit on the Internet, i have found plenty that use the Complete Uno board, I have a Shield for copying the sketch direct to the '85 i need the schematic to go with the sketch.
I've never used that combination, but if you have example sketches and circuit diagrams for a different Arduino then you could port it to an ATtiny85 by identifying the hardware resources (pins, timers, interrupts etc) used and map each of those to the corresponding resource on the ATtiny. Then find the declarations in the code which identify those resources, and update them to match the ones on the ATtiny. It would be easiest to take each of your devices one at a time and work out how to use them on the ATtiny - noting that when you combine them you may end up with some conflict so be prepared to shuffle things around to resolve that.
As Crossroads remarked in reply #1, the type of LCD you have is a critical issue - if it is one of the ubiquitous Hitachi like 16x2 displays, you can see in the documentation for the LCD library that it takes a minimum of six pins to drive. That would leave you with none left for reading temperatures or lighting LEDs. You could add shift registers to overcome this of course.
This may explain why you have had so much trouble finding a schematic. What kind of LCD do you have?