I'm trying to use an Arduino Mega to get temperature and humidity readings from a 3-pin DHT11. I don't have any other components attached. Connections are as follows: leftmost to 5V, middle to GND, rightmost to Pin 4.
I've also tried using a different DHT11 and am still getting the same problem.
I'm using the code and library from here
The schematic I was using for the 3-pin DHT11 didn't have a resistor for some reason.
I've just attached a 5.6k Ohm resistor (didn't have any 5.1k) on the data line (middle pin), but still having the same problem of values of 0.
Interesting. The bare DHT11s I've seen have 4 pins. The modules have 3 pins and (generally) include the pullup.
And confusing: initially you said you had the middle pin tied to ground, and now you've just said the middle pin is the data pin? I think this is too confusing for me. Good luck with your project.
This resistor is a pullup, it has to be connected between the data line and the +5V. Is this the way you connected it? Some pictures of your hardware and connections would help.
Thank you for your helpful response, I am fairly new to Arduino and am a bit confused.
I have the 3-pin version, one of the modules, but the pins aren't labelled on the module itself, so I am relying on online schematics, of which there seem to be multiple different versions, with pins labelled differently? Sometimes the Vcc is one of the outside pins, and sometimes the central one?
Case in point:
That's a pitty, but I can understand your confusion. The second picture on your post #8 comes from a reputable site, but yet seems to be wrong, since the legend doesn't agree with the silk on the module
One of the options is trying to look for information where you bought the module.
Another, I agree with @ledsyn, you can take a picture of the 2 sides of your module in order to try to identify the rails if we can, but considering that you probably tested different wiring positions, your module can be already dead at this point.
This modules aren't expensive, maybe buying another would be a better option.