Controlling stuff with dht11 arduino



This is a small sensor which measures humidity and temperature, when you setup this with Arduino you can control heaters, fans or what what ever you want, in this sketch I've used leds but if you replace the leds with relays you can easily control electrical stuffs. Let's see the sketch then I'll explain bit more about the sketch.

Note: You might need to install dht11 library so that this sketch can work properly. You can get it from http://playground.arduino.cc/main/DHT11Lib. When you go to the site to get the files you will find 4 things. The sketch, dht11.h file, dht11.cpp and test_dewpoint.ino but all the files are in text form and in one page so you will need to make them in different files and to do that you might need to get help from this post.

The sketch
#include <dht11.h>

dht11 DHT11;

#define DHT11PIN 2
int led = 3;
int led2 = 4;

void setup()
{
  Serial.begin(9600);
  Serial.println("DHT11 TEST PROGRAM ");
  Serial.print("LIBRARY VERSION: ");
  Serial.println(DHT11LIB_VERSION);
  Serial.println();
 
pinMode (led,OUTPUT); 
pinMode (led2,OUTPUT); 
}

void loop()
{
  Serial.println("\n");

  int chk = DHT11.read(DHT11PIN);

  Serial.print("Read sensor: ");
  switch (chk)
  {
    case DHTLIB_OK:
        Serial.println("OK");
        break;
    case DHTLIB_ERROR_CHECKSUM:
        Serial.println("Checksum error");
        break;
    case DHTLIB_ERROR_TIMEOUT:
        Serial.println("Time out error");
        break;
    default:
        Serial.println("Unknown error");
        break;
  }

  Serial.print("Humidity (%):  ");
  Serial.println((float)DHT11.humidity, 2);

  Serial.print("Temperature (*C):  ");
  Serial.println((float)DHT11.temperature, 2);


 if (DHT11.humidity >60){
   digitalWrite (led, HIGH);
 } else {
      digitalWrite (led, LOW);
 }

  if (DHT11.temperature >30){
   digitalWrite (led2, HIGH);
 } else {
      digitalWrite (led2, LOW);
 }

   delay(3000);
}


 * The light blue highlighted arrow > you can see after humidity and temperature that means if the humidity or temperature above then 60 or 30 it will turn the led 1 and 2 on otherwise off, and if you put the left arrow < that means if humidity or temperature lower then the number you put after the arrow then it turn the led 1 and 2 on otherwise off.

* "delay(3000)" As you can see delay 3000 that means it will take a measurement after every 3 seconds.

DHT22 with sound alert


dht11 arduino. arduino dht11. arduino nano dht11. arduino dht. dht11 led. dht11 led arduino. dh11 arduino. arduino dht11 led. arduino dht11 fan control. dht 11 with arduino. dht11. dht 11 arduino. dht arduino. dht11 arduino nano. arduino dht 11. dht11 with arduino. arduino heater control. dht11 sketch. dht11 png. dht11 to arduino. dth11 arduino. dht11arduino. arduino with dht11. dht11 arduino code. arduino temperature controlled relay. dht11 con arduino. arduino fan control with temp sensor. arduino temperature controller relay. arduino control temperature. arduino dht11 sketch. dht11 relay arduino. dht11 and arduino. ct arduino. ct sensor arduino. 

dht11 setup. arduino and dht11. dht-11 arduino. arduino humidity controller. arduino temperature controller. 아두이노 dht11 led. dht11 arduino uno. arduino dht sensor. dht11 arduino program. arduino ct sensor. dht 11. control heater with arduino. arduino humidity control. controlling led with relay and arduino. dht11 arduino sketch. dht11 diagram. arduino relay temperature control. dht 11 sensor arduino. dht11 with arduino uno. 아두이노 dht11. arduino stuff. dht11 fan control. arduino fan controller. dht11 arduino codigo. arduino dth11. arduino fan temperature control. control temperature with arduino. arduino temperature fan controller. humidity control arduino. arduino temperature relay. dht11.h led setup arduino. 

dht11 아두이노. using dht11 arduino. dht11 using arduino. arduino:xp3_lnu5gyc= dht11. controlling heater with arduino. temperature controller arduino. dht11.h no such file or directory. sensor dht 11 arduino. dht11 code arduino. dht11 program for arduino. arduino dh11. dht11 arduino sensor. sensor arduino dht11. arduino temperature dht11. arduino heater controller. dht11 sensor arduino. dht11 arduino connection. dht11 esp8266 arduino. dht11 sketch arduino. dht11 arduino nano code. dht 11 arduino code. dht11 for arduino. arduino pid temperature controller relay. dht sensor with arduino. dehumidifier temperature sensor. dht11 program. hdt11 arduino. program dht11 arduino. temperature controlled fan using arduino and dht11. dht11 sensor with arduino. arduino temperature controlled relay circuit. dht11 arduino beispiel. arduino uno dht11. 

dht arduino code. dht11 code for arduino. dht 11 sensor with arduino. temperature sensor dht11 arduino. coding dht11 arduino. connection of dht11 with arduino. arduino nano dht. arduino fan speed control. dht 11 sensor arduino code. compilation terminated. exit status 1. dht no such file or directory. ардуино dht11. dht11 output format. dht control. led arduino setup. sketch arduino. controlling led with arduino. 

dht11 sensor png. arduino fan. arduino temperature and humidity controller. ct for arduino. control relays with arduino. dht-11. dht11 error. dht11 images. led stuff. dht sensor arduino. measures of humidity. amazing arduino. dht11 case. dht sensor. arduino relay sketch.

How to get your micro SIM card out from samsung galaxy s5 mini?


Hi, in this small post. I'm going to show you how to take a sim card out of a Samsung Galaxy s5 mini.
I was finding this hard too. After pushing the sim card in I couldn't take it out, then I got this crazy idea. I couldn't believe how easy it was!

Just get a pin from somewhere, which is very easy to find I think. Then place the pin right on the edge of the sim. Then press a bit, not too hard you might damage your sim. Then push outwards as you can see in the picture above.

That's it, hopefully this helps you :)


Get distance reading on command in arduino


As you might already know how to get distance reading from an ultrasonic sensor in Arduino, but in this post I want to show you a special way to get the distance reading not like you usually see the serial monitor keeps printing the distances, perhaps you will get the reading only when you ask the arduino board to show you the distance.

Ok, the code you going to see here is basically does two thing at once.
(a) it turns on a LED when the distance is more then 30cm, and
(b) it prints the distance when you send a command via serial monitor or bluetooth.

Let's see the code:
int ledPin = 4;
int trigPin = 2;
int echoPin = 3;
void setup() {
  Serial.begin (9600);
  pinMode(ledPin, OUTPUT);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
}
String str;

void loop() {
 
  if(Serial.available())
{
str = Serial.readStringUntil('\n');

if(str == "d")
{

  int duration, distance;
  digitalWrite (trigPin, HIGH);
  delayMicroseconds (10);
  digitalWrite (trigPin, LOW);
  duration = pulseIn (echoPin, HIGH);
  distance = (duration/2) / 29.1;

      Serial.print(distance);  
      Serial.print("cm");
      Serial.println();


  }   
 }

 int duration, distance;
  digitalWrite (trigPin, HIGH);
  delayMicroseconds (10);
  digitalWrite (trigPin, LOW);
  duration = pulseIn (echoPin, HIGH);
  distance = (duration/2) / 29.1;
  delay(100);
        
 if (distance > 30) {  // Change the number for long or short distances.
    digitalWrite (ledPin, HIGH);
  } else {
    digitalWrite (ledPin, LOW);
  
  }
}

What is the command code?
Well, the red letter "d" you can see in the "if(str == "d")" statement that is the code, you can change that code to what ever you want and the yellow highlighted code below does the measuring and printing job.

int duration, distance;
  digitalWrite (trigPin, HIGH);
  delayMicroseconds (10);
  digitalWrite (trigPin, LOW);
  duration = pulseIn (echoPin, HIGH);
  distance = (duration/2) / 29.1;

      Serial.print(distance);  
      Serial.print("cm");
      Serial.println();


Note: After uploading this sketch on your arduino > open your serial monitor and type the letter d and send it and the board will send you the distance measurement.
That's it, hopefully this might help you and if you want to know more about this please comment below I'll try my by best to help you. Thanks




Serial port 'com3' not found Arduino Nano


Have you ever seen a message like this when you tried to upload a sketch on your Arduino board? if yes then you have got the same problem that I had but luckily I have found the solution after few painful hours of finding out the problem and solve it.
Why do I see "serial port com3 not found"?
Well, when this happened to me I tried to look for the cause of the problem, I found out that I didn't have USB2.0-Serial driver for my PC as you can the screen short below.
 
Where can I find "USB2.0-Serial" driver?
Go to this page (http://www.driverscape.com/download/usb2.0-serial) and download which ever folder is appropriate for your PC, after downloading the folder unzip it and the go to your Device Manager and update your driver make sure after clicking on the update drive button locate the right path to the folder that you download the above site, once you have successfully update the driver you will see your USB port like the image below.
 
That's it, now you can upload your sketch and enjoy!!! :)






Newly posted:
Reason why rich getting richer and poor getting poorer