Introduction: Arduino - Two 7 LED Segments + DHT11 Temperature & Humidity Sensor

I want to show you in this "Instructable" how to read DHT11 temperatura&humidity sensor and show it in two 7 LED segments.

Step 1: Parts Required

1.- Arduino UNO

2.- 2 - 7-Segment-Display

3.- 5k Ohm resistor

4.- DHT11 Temperature&Humidity Sensor

5.- Breadboard

6.- Wire

Step 2: Code Test Sensor DHT11

We need to write to the eprom memory of the Arduino board, then we need to code the program with the IDE Arduino.

We install the IDE Arduino.

To use the DHT11 sensor we need a DHT11 - Library, I've attached. We must to install the library, copy the files of the zip to "C:\Program Files\Arduino\libraries" folder.

We connect the Arduino board to the computer, using the usb wire.

Open IDE Arduino and create a new scketch:

- Attach the library to the new scketch.

- Write the code to use the library and the dht11 sensor, I've attached. The program read the temperatura and humidity, and then write it to the Monitor Serial.

Step 3: Build Test Program DHT11

Connect DHT11 to Arduino:

  • DHT11 - Pin 1 -> Arduino - 5v
  • DHT11 - Pin 2:
    • Arduino - Digital pin 2
    • 5k Resistor and Arduino 5v (using two 10k resistor in pararell)
  • DHT11- Pin 3 -> Not Connected
  • DHT11 - Pin 4 -> Arduino - GND

Step 4: Run Test DHT11

We load the code to the Arduino board, using the Arduino IDE.

Run and open the Tools -> Monitor Serial, and it show us the temperature and humidity % each second.

The next steps, we show the temperatura and humidity % on the 7 led segment, Cool!!

Step 5: Solution With 2 7-Led Segment

The Solution will be:

  • Read the temperature and humidity
  • Write "t" in the first 7-Led Segment
  • Write the first digit of the temperature in the first 7-Led Segment
  • Write the second digit of the temperature in the second 7-Led Segment
  • Write "H" in the first 7-Led Segment
  • Write the first digit of the humidity in the first 7-Led Segment
  • Write the second digit of the humidity in the second 7-Led Segment
  • And loop.

Start -> [t][ ] -> [2][7] -> [H][ ] -> [2][5] -> Loop

Step 6: Build Two 7-Led Segment

We connect two 7-Led Segment on the DashBoard.

First 7-Led Segment -> Arduino

  • Pin 7 -> Pin 2
  • Pin 6 -> Pin 3
  • Pin 4 -> Pin 4
  • Pin 2 -> Pin 5
  • Pin 1 -> Pin 6
  • Pin 9 -> Pin 7
  • Pin 10 -> Pin 8

First 7-Led Segment -> Second 7-Led Segment

  • Pin 7 -> Pin 7
  • Pin 6 -> Pin 6
  • Pin 4 -> Pin 4
  • Pin 2 -> Pin 2
  • Pin 1 -> Pin 1
  • Pin 9 -> Pin 9
  • Pin 10 -> Pin 10

Multiplex First/Second 7-Led Segment:

First 7-Led Segment -> Arduino

  • Pin 3 -> Pin 9
  • Pin 8 -> Pin 9

Second 7-Led Segment -> Arduino

  • Pin 3 -> Pin 10
  • Pin 8 -> Pin 10