Hi. I’m "Old Guy" (73) and I have a project in mind that I know a “mini computer” could handle for me. I studied electronics in high school back in the 60s. I later studied and then taught computer programming (besides other subjects) at the high school level. I am looking for some advice: what equipment do I need? What programming code do I need? And what tools do I need? I want to control a fan utilizing some temperature probes. If temp sensor 1 is less than 72 degrees F and temp sensor 1 is less than temp sensor 2 then turn the fan on, otherwise turn it off. I want to power the circuit board with a 9 volt battery or else with AA batteries. The fan will be a 110 volt fan.
It sounds like any Arduino will work fine. Just compare the number of inputs and outputs you want/need. ESP if you plan on introducing wifi to your project. The Arduino IDE will be enough for programing. It seems fairly simple.
Edit: I do have to ask, if AC is available, why power the device from a battery?
I don't follow why temp sensor 2 has to be less than temp sensor 1 for the fan to turn on. Here is some code to get you started. You could use a solid state relay to turn the fan on or off. I think they can be controlled by logic level inputs.
if(tempsensor1 < 72) && (digitalRead(fan) == LOW)
digitalWrite(fan, high) ; //or low depending on what turns the fan on
if(tempsensor1 >= 72) && (digitalRead(fan) == HIGH)
digitalWrite(fan, low) ; //or low depending on what turns the fan on
This would be a fun project!
I just finished a similar project with the Seeeduino xiao - but just for monitoring temp in a room I need to monitor. Used one of the small 128x32 OLED displays to display the temp.
You might consider having the arduino drive an AC solid state relay - which is essentially driving an LED.
I don't see why you would need two temp sensors.
If it were me I would setup the arduino with one thermistor/resistor voltage divider.
With the Arduino A/D reading the voltage and converting that to a 10-bit number 0-1023
I would have that running with the Arduino sending its values to the serial monitor
Then put the thermistor in water with rising temps to track the results.
Then I would know what the ON/OFF threshold values I want to control will be.
You can then write those into your code.
You could also use a second A/D and tie it to a potentiometer - and with that add real-time user adjustment capability to your circuit. The ON/OFF value could then follow the potentiometer value - with perhaps a few degrees +/- tolerance.
I think you'll find examples with a thermistor on Youtube
Personally - my favorite arduino is the Nano 5v unit
Nice project! :-]
Maybe just hardware, two comparators and one AND gate to trigger a relay or triac switch?
Thanks for getting back to me. I have never done a project with Arduino before and I thought that a 3.5v or a 5 v source was needed. Any advice will be appreciated.
Thanks for the comeback! 1. What are logic level inputs? 2. My garage ceiling is insulated. If the main floor of my garage is less than 72 degrees F and the temperature of the attic is higher than the temp in the main floor, then I want to turn on a fan in an 8 inch duct to blow the warm air down. It looks like there are a hundred ways of doing this with arduinos.
@dw Hi DW. My garage ceiling is insulated. If the main floor of my garage is less than 72 degrees F and the temperature of the attic is higher than the temp in the main floor, then I want to turn on a fan in an 8 inch duct to blow the warm air down. I need two sensors in order to compare the two temperatures. It looks like there are a hundred ways of doing this with arduinos.
@robotbuilder Your idea sounds simple, but what are each of these: "comparator", "AND gate" and what relay or "triac" I am new to all of this.
From google,
A voltage comparator is an electronic circuit that compares two input voltages and lets you know which of the two is greater. ... In this circuit, a positive voltage appears at the output if the input voltage is greater than the reference voltage; otherwise, no output voltage exists.
https://www.dummies.com/programming/electronics/components/electronics-components-how-to-use-an-op-amp-as-a-voltage-comparator/
https://www.electronics-tutorials.ws/logic/logic_2.html
Programming requires hardware.
Statements like this,
IF A > B THEN C
involve logic gates to be realised.
Programming is wiring up the hardware to perform some task but unlike a possible hardware solution it is done in a serial (step by step) action instead of in parallel.
In practice there is a mixture of parallel and serial processes taking place in the computer hardware.
Hardware can be much faster than their software equivalent thus the embodiment in hardware of algorithms for performing certain tasks like floating point arithmetic or graphics.
In a recent post hardware counters were suggested, instead of a program, to monitor and count pulses from a wheel encoder.
I have never done a project with Arduino before and I thought that a 3.5v or a 5 v source was needed.
Depending on the arduino(most need 5v) you can just add a wall wart power supply. I would be easier than replacing(or forgetting to) batteries.
My garage ceiling is insulated. If the main floor of my garage is less than 72 degrees F and the temperature of the attic is higher than the temp in the main floor, then I want to turn on a fan in an 8 inch duct to blow the warm air down. I need two sensors in order to compare the two temperatures.
This might complicate things a little bit. The way we communicate to sensors in Arduino works well in short distances. I don't know how far apart these 2 spaces are. That would just mean sending it RS232 between locations.
I think you should look into the comparator option first. If it is not feasible then look towards Arduino and we can help you address the distance problem(if it even is a problem).
I have considered a similar circuit. In my case I want to blow a fan across a wood burning stove IF room temp sensor is below some threshold, (i.e 65F) and IF firebox temp sensor is above a certain threshold (i.e 400F). In other words, if the room is cold, there is no sense blowing a fan across a wood stove that is not lit. My concept is an Arduino Uno, powered by a wall-wart, two temp sensing modules, a turn pot to adjust room set point, (preset firebox setpoint), and a SSR like DA-40 to turn on an AC blower. Pretty simple concept, but I have not built it yet. Seems like this design could be used for the OP's idea with attic fan, in place of my wood stove fan.
Imagine by thought, create, don't wait, Scott.
@whitneydesignlabs Yes. I have had many responses here on the forum but I am so new that I have not been able to totally relate with them. I have gone back to YouTube to watch more of the instructional videos and then later I will come back and re-read the suggestions that has been offered!
@oldguy Some suggestions for related videos:
About the 24 minute mark, he addresses SSRs. They are really easy to use because a signal from Arduino can directly switch large AC loads. Bill doesn't address AC mains voltage much, for safety reasons. So please make sure you are comfortable with AC power.
At the 2 minute mark, Bill addresses the DH22 temp sensor which is simple and easy to use.
I can imagine your project developing with a parts list something Arduino Uno (1), DH22 temp sensors (2), SSR-DA40, (1), Some hookup wire and connectors, 5v power supply (1), AC power cord (1), fan/blower (1).
From Bills videos, I think you could cut and paste code snipets, make a few minor modifications, into Arduino ide to make it all work.
Your logic in Psuedo code might be something like this: (in reality, it would be C++)
*****
Write to SSR pin and turn it off
Read temp SensorA
Read temp SensorB
If temp SensorA is greater than or equal to some number
And If temp SensorB is lower than or equal to some number
Then, Write to the SSR pin (and hence the fan) to turn on
Otherwise turn SSR pin off
Keep looping, starting with the temp sensor reads, continuing infinitely
*****
Fairly straight forward with a loop, and using one conditional IF statement. Of course, we can help here on the forum to work out any kinks you run across. Have fun!
PS: One thing I am not addressing is the distance from the Arduino that the DH22 sensors can be, ie wire length. I will let others more knowledgeable than me discuss that.
Imagine by thought, create, don't wait, Scott.