Outdated and confusing?

Hi all. New to the Arduino forms, and getting my feet wet with Arduino programming and boards. I have been doing a fair amount of searching and looking around at various projects, code samples ect. Some great stuff out there. I am running into a problem. I am connecting a simple DHT11 temp / humid sensor to an LCD. 16x2. I have tested the temp sensor using G,V,S S to Pin 2. and checked the serial monitor and was getting the correct readings. Then later, connected up the LCD and did a few tests on it. (Hello world, serial read, ect) both working just fine. Now I am trying to bridge the two together and that is where things go south. Many errors on just about every bit of code I have tried. Doing some reading I am discovering that much of the code that is out there for this kind of project is slightly outdated? Thus why I am getting the errors. (I am guessing here.) I also noticed, that on many of the wiring diagrams, the resistor for the DHT11 is always missing as well as the 10k pot for contrast for the LCD screen. This makes me scratch my head a bit because it seems to contradict the working wiring and code for both the LCD and the Temp sensor.

Here is what I have. The DHT11 is connected to ground, and 5V, with the Signal going to digital pin 2. A 4.7k resistor between 5V and Signal on the sensor.

LCD connected per usual, with a 10k pot for contrast.

Now for the code:

I wont bother posting the code I have tried, I think it will just muddle this post. Is there updated code with a wiring diagram for reference anywhere out there? I have a link to (http://playground.arduino.cc/Main/DHT11Lib) I am guessing the best thing to do is load up the .h and the .cc to the library under the DHT11 folder, then run that sketch, but before I venture in doing that, I wanted to run it past here for a bit of confirmation on the steps, and the wiring. Here is just a quick snapshot of the project on the bench. Help is much appreciated.

Many errors on just about every bit of code I have tried. Doing some reading I am discovering that much of the code that is out there for this kind of project is slightly outdated? Thus why I am getting the errors. (I am guessing here.)

(obvious observation and personal insult removed by moderator)

What does get dated are the libraries. You need to use the versions that came with your IDE.

What else? I am guessing both at once is not a power problem but you can try using external power for the LCD.

Now for the code:

I wont bother posting the code I have tried, I think it will just muddle this post.

There went any hope to clear things up or say anything definite. Read the sticky-threads at the top of the section. One of the rules is to post the whole code.

Nice picture.. You could win an award for it... But it does nothing towards fixing your " Obsolete Code " simply because WE can't see how you tried to "Join".... the 2 sketches. That you are a new person and unsure of what to do is apparent. We ALL Were at one time or another. What isn't apparent is what you expect from posting that 'nice' picture... AT THE TOP OF THIS FORUM LISTING ARE TWO STICKY NOTES... PLEASE READ THEM... there are hundreds of examples... for using DHHT11 This one (Quite comprehensive) took me about 2 minutes of searching... It's from Adafruit.. a nice place to spend a dollar and staffed with people who know what they are talking about... Here: http://learn.adafruit.com/dht/overview Read it.. Please.

Doc

Moderator edit: vitriol and personal insults removed.

Well, this is not the first time I see someone who thinks they know why something doesn't work, and appears seriously misguided in their request for help. So I don't understand the harsh treatment the OP is getting in this thread.

To the OP, from your description I get that A works, and B works, and A+B doesn't work. We can investigate A and B using the code examples and find that they work for us as well, but we cannot imagine how you put A and B together, and that's where the problem is. We need to see your code, and if you are in doubt about the circuits some schematics as well. Then we could start a more productive exchange.

spatula: Well, this is not the first time I see someone who thinks they know why something doesn't work, and appears seriously misguided in their request for help. So I don't understand the harsh treatment the OP is getting in this thread.

To the OP, from your description I get that A works, and B works, and A+B doesn't work. We can investigate A and B using the code examples and find that they work for us as well, but we cannot imagine how you put A and B together, and that's where the problem is. We need to see your code, and if you are in doubt about the circuits some schematics as well. Then we could start a more productive exchange.

Thanks for the helpful advice. I sorted out the issue. Many of the LCD / Temp sensor examples that are out on the web are for older versions working with the uno. I updated the files from the link I provided and tried the new sketch and everything worked fine. Really appreciate your attempt to help out with the issue.

Docedison: This one (Quite comprehensive) took me about 2 minutes of searching... It's from Adafruit.. a nice place to spend a dollar and staffed with people who know what they are talking about... Here: http://learn.adafruit.com/dht/overview Read it.. Please.

Have already been through that link you provided, thanks. As I stated getting the temp sensor to work independently was not a problem. The link you posted here that took you two min to find, was helpful resource about 10 days ago for me.

GoForSmoke: Read the sticky-threads at the top of the section. One of the rules is to post the whole code.

As stated above. I loaded the code from the link (BTW: If you click the link you see the code, it is 3 parts. The Sketch, the .h and the .cc as well as the sketch) My words of ; I wont muddle the post with the code is because we have 3 parts, and simply clicking the link you have full view of the code. (Just an FYI, give it a try.) I did as I said in my post and everything worked just fine. My reason for posting here first is to get any input from the vast experience and knowledge from other members to avoid any pitfalls that I may have been missing.

Now back to what I have posted:

I will post the code I used, the correct wiring configuration and even a fancy photo in case any one else ever comes across this post and might have the same issue just starting out with this awesome development platform. Because maybe, just maybe it may help someone that needs that help learning the small things as they venture into this hobby.

Cheers.

Moderator edit: personal insults removed.

sencorp: I have comments but will keep them to my self this time.

You failed. Do not make me edit your posts again. Next time, use [u]Report to moderator[/u].

As for most of the rest of you, tone it down or I'll take a switch to your backsides.

sencorp:

GoForSmoke: Read the sticky-threads at the top of the section. One of the rules is to post the whole code.

As stated above. I loaded the code from the link (BTW: If you click the link you see the code, it is 3 parts. The Sketch, the .h and the .cc as well as the sketch) My words of ; I wont muddle the post with the code is because we have 3 parts, and simply clicking the link you have full view of the code. (Just an FYI, give it a try.)

Yup, done it, that's the code that works and not your code that didn't.

Believe it or not, I was trying to help. It's -very common- here to note the lack of code in 1st posts.

Updated*

I said I would post the working diagram and code in case anyone else had a question on how to make this work with the updated lib files. So here it is.

First the link to the updated Library files for the DHT11 to work with the newest IDE.

You can find the newest Library files here: http://playground.arduino.cc/Main/DHT11Lib

The Wiring Diagram is here:

The code used to work with this wiring and updated Library files is here:

    //
    //   FILE:  dht11_LCD.pde
    // PURPOSE: Display DHT11 values on an LCD for Arduino
    //

    //Celsius to Fahrenheit conversion
    double Fahrenheit(double celsius){
       return 1.8 * celsius + 32;
    }

    // include the library code:
    #include <LiquidCrystal.h>

    #include <dht11.h>

    dht11 DHT11;

    #define DHT11PIN 6

    // initialize the library with the numbers of the interface pins
    LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

    void setup(){
      // set up the LCD's number of columns and rows:
      lcd.begin(16, 2);
      // Print a message to the LCD.
      lcd.println("Sencorp Temp Tst ");
    }

    void loop(){

      int chk = DHT11.read(DHT11PIN);

      lcd.setCursor(0,1);
      switch (chk){
        case 0:
          lcd.print("H:");
          lcd.print((float)DHT11.humidity, 2);
          lcd.print(" T: ");
          lcd.println(Fahrenheit(DHT11.temperature), 2);
          break;
        case -1: lcd.print("Checksum error"); break;
        case -2: lcd.print("Time out error"); break;
        default: lcd.print("Unknown error"); break;
      }
      delay(2000);
    }

With everything in place, you should be able to get the LCD and DHT11 working quick with this config. I am sure others already know this, but in case someone comes along with the same question, they can get the answer quick with no worries.

GoForSmoke:

sencorp:

GoForSmoke:
Read the sticky-threads at the top of the section. One of the rules is to post the whole code.

As stated above. I loaded the code from the link (BTW: If you click the link you see the code, it is 3 parts. The Sketch, the .h and the .cc as well as the sketch) My words of ; I wont muddle the post with the code is because we have 3 parts, and simply clicking the link you have full view of the code. (Just an FYI, give it a try.)

Yup, done it, that’s the code that works and not your code that didn’t.

Believe it or not, I was trying to help. It’s -very common- here to note the lack of code in 1st posts.

Thanks for the help. Appreciate it.