user38337: I have connected the circuit as per the diagram below and I have got the LCD to display boxes and nothing else. What could be wrong here? Please help! 
Circuit diagram below - 

Code as follows -
#include<DHT11.h>
#include<LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
#define dht11pin 12
dht11 DHT11;
#define pwm 9
byte degree[8] =
{
  0b00011,
  0b00011,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000
};
void setup()
{
  lcd.begin(16, 2);
  lcd.createChar(1, degree);
  lcd.clear();
  lcd.print("   Fan Speed  ");
  lcd.setCursor(0, 1);
  lcd.print("  Controlling ");
  delay(2000);
  analogWrite(pwm, 255);
  lcd.clear();
  lcd.print("Our Project ");
  delay(2000);
}

void loop()
{
  DHT11.read(dht11pin);
  int temp = DHT11.temperature;
  lcd.setCursor(0, 0);
  lcd.print("Temperature:");
  lcd.print(temp);
  lcd.write(1);
  lcd.print("C");
  lcd.setCursor(0, 1);
  if (temp < 26 )
  {
    analogWrite(9, 0);
    lcd.print("Fan OFF  ");
    delay(100);
  }
  else if (temp == 26)
  {
    analogWrite(pwm, 51);
    lcd.print("Fan Speed: 20%   ");
    delay(100);
  }
  else if (temp == 27)
  {
    analogWrite(pwm, 102);
    lcd.print("Fan Speed: 40%   ");
    delay(100);
  }
  else if (temp == 28)
  {
    analogWrite(pwm, 153);
    lcd.print("Fan Speed: 60%   ");
    delay(100);
  }
  else if (temp == 29)
  {
    analogWrite(pwm, 204);
    lcd.print("Fan Speed: 80%    ");
    delay(100);
  }
  else if (temp > 29)
  {
    analogWrite(pwm, 255);
    lcd.print("Fan Speed: 100%   ");
    delay(100);
  }
  delay(3000);
}

I used the default LiquidCrystal.h library for this project. Is that wrong?

user4143: Your constructor doesn't match your wiring:
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

You have:
RS = 7
E = 6
D4 = 5
D5 = 4
D6 = 3
D7 = 2

Yet your wiring has:
RS = 2
E = 3
D4 = 4
D5 = 5
D6 = 6
D7 = 7

I.e., completely backwards.
The constructor prototype is:
LiquidCrystal(rs, enable, d4, d5, d6, d7) 

Yet you seem to have chosen to ignore (or misunderstand) that.
Instead you need to specify your pins correctly:
LiquidCrystal(2, 3, 4, 5, 6, 7);

Also, as a side note, you don't have a ground connection to that little 9V circuit off to one side - so you will never be able to control it.  Read this.

38337: <p>I have connected the circuit as per the diagram below and I have got the LCD to display boxes and nothing else. What could be wrong here? Please help! </p>

<p>Circuit diagram below - </p>

<p><a href="https://i.stack.imgur.com/GBiXM.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GBiXM.gif" alt="enter image description here"></a></p>

<p>Code as follows -</p>

<pre class="lang-cpp prettyprint-override"><code>#include&lt;DHT11.h&gt;
#include&lt;LiquidCrystal.h&gt;
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
#define dht11pin 12
dht11 DHT11;
#define pwm 9
byte degree[8] =
{
  0b00011,
  0b00011,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000
};
void setup()
{
  lcd.begin(16, 2);
  lcd.createChar(1, degree);
  lcd.clear();
  lcd.print("   Fan Speed  ");
  lcd.setCursor(0, 1);
  lcd.print("  Controlling ");
  delay(2000);
  analogWrite(pwm, 255);
  lcd.clear();
  lcd.print("Our Project ");
  delay(2000);
}

void loop()
{
  DHT11.read(dht11pin);
  int temp = DHT11.temperature;
  lcd.setCursor(0, 0);
  lcd.print("Temperature:");
  lcd.print(temp);
  lcd.write(1);
  lcd.print("C");
  lcd.setCursor(0, 1);
  if (temp &lt; 26 )
  {
    analogWrite(9, 0);
    lcd.print("Fan OFF  ");
    delay(100);
  }
  else if (temp == 26)
  {
    analogWrite(pwm, 51);
    lcd.print("Fan Speed: 20%   ");
    delay(100);
  }
  else if (temp == 27)
  {
    analogWrite(pwm, 102);
    lcd.print("Fan Speed: 40%   ");
    delay(100);
  }
  else if (temp == 28)
  {
    analogWrite(pwm, 153);
    lcd.print("Fan Speed: 60%   ");
    delay(100);
  }
  else if (temp == 29)
  {
    analogWrite(pwm, 204);
    lcd.print("Fan Speed: 80%    ");
    delay(100);
  }
  else if (temp &gt; 29)
  {
    analogWrite(pwm, 255);
    lcd.print("Fan Speed: 100%   ");
    delay(100);
  }
  delay(3000);
}
</code></pre>

<p>I used the default LiquidCrystal.h library for this project. Is that wrong?</p>
 4143: <p>Your constructor doesn't match your wiring:</p>

<pre><code>LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
</code></pre>

<p>You have:</p>

<pre><code>RS = 7
E = 6
D4 = 5
D5 = 4
D6 = 3
D7 = 2
</code></pre>

<p>Yet your wiring has:</p>

<pre><code>RS = 2
E = 3
D4 = 4
D5 = 5
D6 = 6
D7 = 7
</code></pre>

<p>I.e., completely backwards.</p>

<p>The constructor prototype is:</p>

<pre><code>LiquidCrystal(rs, enable, d4, d5, d6, d7) 
</code></pre>

<p>Yet you seem to have chosen to ignore (or misunderstand) that.</p>

<p>Instead you need to specify your pins <em>correctly</em>:</p>

<pre><code>LiquidCrystal(2, 3, 4, 5, 6, 7);
</code></pre>

<p>Also, as a side note, you don't have a ground connection to that little 9V circuit off to one side - so you will never be able to control it.  <a href="https://hackingmajenkoblog.wordpress.com/2016/12/06/the-importance-of-sharing-grounds/" rel="nofollow noreferrer">Read this.</a></p>
