I am not sure how to wire this breadboard for the DHT-11 sensor?

Hi all,

I am attempting to create an LCD that displays the temperature using the DHT-11 and I am using the following project and wiring diagram as a guide: How to use the DHT11 with Arduino - Code, Circuit Diagram, Video Tutorial (techzeero.com)

The DHT-11's GND pin connects to a pin on the negative power-rail on the breadboard and it looks as though there is another wire that connects from that same pin on the breadboard to the GND port on the Arduino Uno. Is it ok for me to just connect a wire from the dht-11's gnd pin directly to the gnd pin on the Arduino?

Also, it appears there is a potentiometer included in the above project. I do not want to use a potentiometer. It looks like the third pin on the LCD is connected to the potentiometer - since I will not be using one of these, where do I connect the third pin of the LCD to on the breadboard / Arduino?

Thanks

Yes.

to 5V.

so im assuming that the red wire already connected to 5v in the diagram is not needed?

Pin 3 of the LCD is the contrast adjusting pin. It can be connected to ground directly or through a fixed resistor sized to provide good contrast. See this thread

A potentiometer is best because the contrast can chage with changes in supply voltage or temprature. The pot allows easy contrast adjustment.

1 Like

Thanks.

Could someone please draw on the diagram the connections without the potentiometer please? Just so I can visually see it. Thank you

image
Connect V0 (pin 3) to ground.

image

Connect Vo (pin 3) to ground with a fixed resistor. Start with 1K and try lower resistor values till the contrast is acceptable.

Arduino Temperature and Humidity Sensor using DHT11 and 1602 LCD Modul – CreateLabz Store

Now using the above project.

image

I have wired everything correctly, except for the two wires that i have circled in green on the above diagram. My breadboard is different to the one on the diagram as i have two power rails whereas the diagram does not.

Where am i meant to connect those two wires to?

Hi, @random_person2567

Can you post some images of your project?
So we can see your component layout.

Thanks... Tom.. :smiley: :+1: :coffee: :australia:

Hi Tom,

Above is a photo of the board i have completed so far. Is the photo OK?

In a place where they can feed the DHT11 and the LCD display simultaneously.
The breadboard in your picture doesn´t have power rails. Each colum is a rail that represents the same electrical point. Like this:

This other breadboard from post #11 has power rails and the way you wired the things is wrong, since Arduino +5V and GND are not connected to the LCD and the DHT11.

To do it correctly:

  1. place the DHT11 (+) and the LCD (+) in the same rail of the green wire (Arduino +5V);
  2. place the DHT11 (-) and the LCD (-) in the same rail of the blue wire (Arduino GND).

Project makes no sense to me, it code says

#include <LCD.h.h>

i get the following error:
exit status 1
LCD.h.h: No such file or directory

I am not sure where to download lcd.h.h - the links the website provided do not work

A little Googlefu may help:
Maybe this tutorial >> Measure temperature/humidity using DHT11 + LCD i2c + Arduino – SURTR TECHNOLOGY

Or this one >> https://arduinogetstarted.com/tutorials/arduino-temperature-humidity-sensor-lcd

The problem with using code from the internet for the LCD is that there are several different libraries named LiquidCrystal_I2C and they are not the same. So you have to make sure to find the library that the code was written for. I recommend installing and using the hd44780 library for your LCD. It is the latest and is actively maintained. The hd44780 library is available via the IDE library manager. How to install an Arduino library.

Then you will have to know the I2C address of the LCD I2C interface backpack and the pin mapping between the I2C backpack and the LCD. Those parameters must be included in the LCD object constructor. If you replace the LiquidCrystal_I2C library with the hd44780 library those parameters are automatically determined by the library code.

Here is my boilerplate code to get started with the hd44780 library.

// hd44780 library see https://github.com/duinoWitchery/hd44780
// thehd44780 library is available through the IDE library manager
#include <Wire.h>
#include <hd44780.h>                       // main hd44780 header
#include <hd44780ioClass/hd44780_I2Cexp.h> // i2c expander i/o class header

hd44780_I2Cexp lcd; // declare lcd object: auto locate & auto config expander chip

// LCD geometry
const int LCD_COLS = 16;
const int LCD_ROWS = 2;

void setup()
{
   lcd.begin(LCD_COLS, LCD_ROWS);
   lcd.clear();
   lcd.print("Hello World");
   lcd.setCursor(0, 1);
   lcd.print("Millis ");
}

void loop()
{
   updateLCD();
}

void updateLCD()
{
   static unsigned long lcdTimer = 0;
   unsigned long lcdInterval = 500;  // update 2 times per second
   if (millis() - lcdTimer >= lcdInterval)
   {
      lcdTimer = millis();
      lcd.setCursor(8, 1);
      lcd.print("       "); // overwrite old data
      lcd.setCursor(8, 1);  // reset the cursor
      lcd.print(millis());
   }
}

In the examples you will find documentation, sample code and a diagnostic sketch if you have trouble. Run the diagnostic and post the results and we can help.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.