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?
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.
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.
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:
place the DHT11 (+) and the LCD (+) in the same rail of the green wire (Arduino +5V);
place the DHT11 (-) and the LCD (-) in the same rail of the blue wire (Arduino GND).
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.