{"id":146,"date":"2023-01-15T10:08:29","date_gmt":"2023-01-15T15:08:29","guid":{"rendered":"http:\/\/leapfrog.hopto.org\/wolfy\/?page_id=146"},"modified":"2023-02-06T07:43:07","modified_gmt":"2023-02-06T12:43:07","slug":"fridge-fan","status":"publish","type":"page","link":"https:\/\/leapfrog.hopto.org\/wolfy\/?page_id=146","title":{"rendered":"Fridge Fan"},"content":{"rendered":"\n<p>Our refrigerator is backed into a cul-de-sac without optimal air circulation. It is always a few degrees warmer behind the fridge, and I&#8217;d like to see if a simple temperature activated PC fan could cut our electricity use.<\/p>\n\n\n\n<p>I found a basic tutorial at <a href=\"https:\/\/arduinogetstarted.com\/tutorials\/arduino-cooling-system-using-dht-sensor\">arduinogetstarted.com<\/a> that set me off in the right direction.<\/p>\n\n\n\n<p> <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"565\" src=\"https:\/\/leapfrog.hopto.org\/wolfy\/wp-content\/uploads\/2023\/01\/arduino-cooling-fan-system-dht11-wiring-diagram-1024x565.jpg\" alt=\"\" class=\"wp-image-147\" srcset=\"https:\/\/leapfrog.hopto.org\/wolfy\/wp-content\/uploads\/2023\/01\/arduino-cooling-fan-system-dht11-wiring-diagram-1024x565.jpg 1024w, https:\/\/leapfrog.hopto.org\/wolfy\/wp-content\/uploads\/2023\/01\/arduino-cooling-fan-system-dht11-wiring-diagram-300x166.jpg 300w, https:\/\/leapfrog.hopto.org\/wolfy\/wp-content\/uploads\/2023\/01\/arduino-cooling-fan-system-dht11-wiring-diagram-768x424.jpg 768w, https:\/\/leapfrog.hopto.org\/wolfy\/wp-content\/uploads\/2023\/01\/arduino-cooling-fan-system-dht11-wiring-diagram.jpg 1456w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><a href=\"https:\/\/forums.tomshardware.com\/threads\/manually-controlling-4-pin-cooling-fans.2587710\/\">Four pin fan control:<\/a><\/p>\n\n\n\n<p>The wires and functions of a 4-pin fan are:<br>Pin #1 (Black) Ground<br>Pin #2 (Yellow) +12 VDC fixed<br>Pin #3 (Green) Speed Pulse Signal<br>Pin #4 (Blue) PWM Signal<\/p>\n\n\n\n<p>Also an Arduino sketch that reports results from a DHT11 temperature and humidity sensor to our temperature\/humidity reporting site (see Home Monitoring) so we can watch the thermal effects of the fan. Note the code contains a way to identify the sensor sending signal.  This way I can re-use the same code across multiple devices.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;dht.h&gt;\n#include &lt;OneWire.h&gt; \n#include &lt;DallasTemperature.h&gt;\n\n#include &lt;RCSwitch.h&gt;\nRCSwitch mySwitch = RCSwitch();\n\n\/\/#define SENSOR 1 \/\/ not made yet\n\/\/ #define SENSOR 2  \/\/ nano every\n#define SENSOR 3   \/\/ Make arduino uno\n\ndht DHT;\n\n#define DHT11_PIN 7\n\nint sensorPin = A0;  \/\/ potentiometer input signal\nint intensity = 0; \/\/ incoming potentiometer value\nint dt,dh;\n\nvoid setup(){\n  Serial.begin(9600);\n\n  if (SENSOR == 3) {\n    dt = -1.0;\n    dh = 1;\n  } else if (SENSOR == 2) {\n    dt = 99999;\n    dh = 99999;\n  } else if (SENSOR == 1) {\n    dt = 99999;\n    dh = 99999;\n  }\n  \n  \/\/ Transmitter is connected to Arduino Pin #10  \n  mySwitch.enableTransmit(10);\n\n  \/\/ Optional set protocol (default is 1, will work for most outlets)\n  mySwitch.setProtocol(1);\n  \/\/ mySwitch.setRepeatTransmit(120);\n  \/\/ mySwitch.setPulseLength(350);  \/\/ was 330\n\n}\n\nvoid loop(){\n \n  int chk = DHT.read11(DHT11_PIN);\n  unsigned long int temperature, humidity, intensity;\n  unsigned long int hash;\n  int nbits = 32;\n\n  temperature = round((DHT.temperature) * 9.0 \/ 5.0 + 32 + dt);\n  Serial.print(\"DHT11 Temperature: \");\n  Serial.println(temperature);\n  \n  humidity = DHT.humidity + dh;\n  Serial.print(\"DHT11 Humidity: \");\n  Serial.println(humidity);\n\n  intensity = analogRead(sensorPin);\n  intensity = 1024 - intensity;\n  \/\/ intensity = 50;\n\n  \/\/ Serial.print(\"Intensity: \");\n  \/\/ Serial.println(long (intensity)*10000);\n\n  hash = long (SENSOR) * 100000000 + (intensity)*10000 + 100 * humidity + temperature; \n\n  Serial.println(hash);\n  \n  mySwitch.send(1010101, nbits);\n  mySwitch.send(hash, nbits);\n  \/\/ mySwitch.send(1010101, nbits);\n    \n  delay(300000);  \/\/ Send a transmission every five minutes\n  \/\/delay(1000);\n  \n  \/\/ Serial.println(sizeof(nbits));\n}<\/code><\/pre>\n\n\n\n<p>Two items remaining&#8230; I need to locate\/purchase a relay, and note that the fans we need to use are 12 volt. I&#8217;ll need to figure out a way to power both the fan and the Arduino from the same 12V power source. That should be easy to look up.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>This thinking all fades away when faced with <a href=\"https:\/\/components101.com\/modules\/w1209-temperature-control-switch\">this<\/a>:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"500\" src=\"https:\/\/leapfrog.hopto.org\/wolfy\/wp-content\/uploads\/2023\/01\/image-1.png\" alt=\"\" class=\"wp-image-158\" srcset=\"https:\/\/leapfrog.hopto.org\/wolfy\/wp-content\/uploads\/2023\/01\/image-1.png 750w, https:\/\/leapfrog.hopto.org\/wolfy\/wp-content\/uploads\/2023\/01\/image-1-300x200.png 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><figcaption class=\"wp-element-caption\">Remote thermal sensor with integrated relay.<\/figcaption><\/figure>\n\n\n\n<p>$7 on Amazon with free shipping. Can&#8217;t control fan speed, but runs at 12V, same as a fan. \ud83d\ude42  Order placed.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"526\" height=\"461\" src=\"https:\/\/leapfrog.hopto.org\/wolfy\/wp-content\/uploads\/2023\/01\/image-2.png\" alt=\"\" class=\"wp-image-162\" srcset=\"https:\/\/leapfrog.hopto.org\/wolfy\/wp-content\/uploads\/2023\/01\/image-2.png 526w, https:\/\/leapfrog.hopto.org\/wolfy\/wp-content\/uploads\/2023\/01\/image-2-300x263.png 300w\" sizes=\"auto, (max-width: 526px) 100vw, 526px\" \/><figcaption class=\"wp-element-caption\">Wired for fan control.<\/figcaption><\/figure>\n\n\n\n<p>At 12 volts the fan was too loud for the family, so I cannibalized a 12V to 6V converter from a cigarette lighter plug-in, and it&#8217;s running now.<\/p>\n\n\n\n<p>Next step is to figure out how to tell if it&#8217;s actually doing any good.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Our refrigerator is backed into a cul-de-sac without optimal air circulation. It is always a few degrees warmer behind the fridge, and I&#8217;d like to see if a simple temperature activated PC fan could cut our electricity use. I found a basic tutorial at arduinogetstarted.com that set me off in the right direction. Four pin [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-146","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/leapfrog.hopto.org\/wolfy\/index.php?rest_route=\/wp\/v2\/pages\/146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/leapfrog.hopto.org\/wolfy\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/leapfrog.hopto.org\/wolfy\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/leapfrog.hopto.org\/wolfy\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/leapfrog.hopto.org\/wolfy\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=146"}],"version-history":[{"count":9,"href":"https:\/\/leapfrog.hopto.org\/wolfy\/index.php?rest_route=\/wp\/v2\/pages\/146\/revisions"}],"predecessor-version":[{"id":167,"href":"https:\/\/leapfrog.hopto.org\/wolfy\/index.php?rest_route=\/wp\/v2\/pages\/146\/revisions\/167"}],"wp:attachment":[{"href":"https:\/\/leapfrog.hopto.org\/wolfy\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}