member
Basics: Project 066f ESP8266 ESP-12E module, White 0.96" I2C OLED display module, DHT11/21/22 modul
of Acoptex.com in NODEMCU
Basics: Project 066f
Project name: ESP8266 ESP-12E module, White 0.96" I2C / SPI OLED display module, DHT11/21/22 module
Tags: ESP, ESP8266, WI FI module, ESP-12E, Ai Thinker, AI-Cloud, SOC, GPIO, General Purpose Input Output, System On a Chip, IOT, internet of things, FTDI232, FTDI 232, how to upload sketch, blink sketch for ESP8266 ESP-12E module, LoLin NODEMCU V3, NODEMCU, V3, Development Board with USB-to-Serial Onboard, NodeMCU DevKit, IOT STARTUP, White 0.96" I2C / SPI OLED display module, DHT11, DHT21, DHT22 module
Attachments: sketch, library1, library2, library3
In this project, you need these parts :
1.Arduino Uno R3 (you can also use the other version of Arduino)
2. ESP8266 ESP-12E module with micro USB cable 1pc
3.Arduino IDE ( you can download it from here )
4.Jumper cables F-M, F-F, M-M
5. Breadboard 1 pc
6. White 0.96" I2C OLED display module 1 pc
7. Resistor 1 pc (10 KOhm)
8. DHT11 21 22 Humidity and temperature module 1pc
General
We will learn how to display the temperature and humidity from DHT module on the white 0.96" I2C OLED display, how to integrate the white 0.96" I2C OLED display with ESP8266 ESP-12E module (LoLin NODEMCU V3).
Understanding the white 0.96" I2C OLED display module
You can read more about it here.
Understanding the DHT 11 21 22 module
You can read more about it here.
Understanding the ESP8266 ESP-12E WI FI module (LoLin NODEMCU V3)
You can read more about it here.
Signals and connections of the DHT 11 21 22 module
There are two different versions of the DHT11 you might come across. One type has four pins, and the other type has three pins and is mounted to a small PCB. The PCB mounted version is nice because it includes a surface mounted 10K Ohm pull up resistor for the signal line. Here are the pin outs for both versions:
Signals and connections of the white 0.96" I2C OLED display module
GND - ground pin.
SDA - Serial Data Line pin.
SCL - Serial Clock Line pin.
VCC - this is the power pin. Can be connected to +5VDC or +3.3VDC pin of Arduino board (depends on the display module). All OLEDs are safe to use with 3.3V logic and power.
Signals and connections of the ESP8266 ESP-12E WI FI module (LoLin NODEMCU V3)
TX - transmit pin. GPIO pin
RX - receive pin. GPIO pin
3V3 (or 3V or 3.3V) - power supply pin (3-3.6V).
GND ( or G) - ground pin.
RST - reset pin. Keep it on high (3.3V) for normal operation. Put it on 0V to reset the chip.
EN - Chip enable. Keep it on high (3.3V) for normal operation.
Vin - External power supply 5VDC.
D0-D8 - GPIO (General Purpose Input Output) pins
D5-D8 - SPI interface
D1-D2– I²C/TWI Interface
SC (or CMD) - (Chip Select) - the pin that the master can use to enable and disable specific devices. GPIO pin
SO (or SDO) - Master In Slave Out (MISO) - SPI communication. The Slave line for sending data to the master. GPIO pin
SK (or CLK) - SCK (Serial Clock) - SPI communication.The clock pulses which synchronize data transmission generated by the master. GPIO pin
S1 (or SD1) - Master Out/Slave In (MOSI). SPI communication. The Master line for sending data to the peripherals. GPIO pin
S2 (or SD2) - GPIO pin
S3 (or SD3) - GPIO pin
VU (or VUSB) - external power 5VDC.
A0 - ADC output.
RSV - reserved
Wiring
Step by Step instruction
1. Adding ESP8266 platform to Arduino IDE
The Arduino environment has to be set up to make it compatible with the ESP8266 ESP-01 module. It is required to have Arduino IDE version 1.6.4 or higher in order to install the ESP8266’s platform packages.
- Open Arduino IDE.
- Open the Preferences window from the Arduino IDE. Go to File -> Preferences.
- Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field and click the “OK” button. If you already have a URL in there, and want to keep it, you can separate multiple URLs by placing a comma between them. (Arduino 1.6.5 added an expanded text box, separate links in here by line.)
- Open Boards manager. Go to Tools -> Board -> Boards Manager…
- There should be a couple new entries in addition to the standard Arduino boards. Look for esp8266. or scroll down to the ESP8266 entry (usually at the bottom). Select the ESP8266 entry. When you click it an install option will appear. Select the latest version and click install.
- The board definitions and tools for the ESP8266 include a whole new set of gcc, g++, and other reasonably large, compiled binaries, so it may take a few minutes to download and install (the archived file is ~110MB). Once the installation has completed, an Arduino-blue “INSTALLED” will appear next to the entry.
2. Uploading sketch to ESP8266 ESP-12E module
If you’re using an ESP-12E NodeMCU Kit, uploading the sketch is very simple, since it has built-in programmer.
Before use ESP8266 ESP-12E WI FI module (LoLin NODEMCU V3), you need to download the manufacture's driver (CH340) for this chip and install it in your PC. Here is the link. See the description of driver installation package below: CH340 / CH341 USB to serial WINDOWS driver installation package that supports 32/64 bit Windows 10 / 8.1 / 8/7 / VISTA / XP, SERVER 2016/2012/2008/2003, 2000 / ME / 98, through Microsoft digital signature authentication, support USB to 3-wire and 9-wire serial port, with the product release To the end user. Applicable scope: CH340G, CH340C, CH340B, CH340E, CH340T, CH340R, CH341A, CH341T, CH341H chips.
If you have CP2102 chip then you need to download the manufacture's driver for this chip and install it in your PC. Driver for Mac, Windows, Linux or more..
- Do wiring.
- Open Arduino IDE.
- Plug your ESP8266 ESP-12E module into your PC USB port.
- Choose your NodeMCU board. Go to Tools -> Board -> NodeMCU 1.0 (ESP-12E Module
)
- Select the correct com port.
- Verify and upload the sketch to your ESP8266 ESP-01 module. AT commands will not work after that. You need to Flash the firmware to enable them again.
- You will see the temperature and humidity displayed on OLED display module.
Summary
We have learnt how to display the temperature and humidity from DHT module on the white 0.96" I2C OLED display, how to integrate the white 0.96" I2C OLED display with ESP8266 ESP-12E module (LoLin NODEMCU V3).
Library
- All libraries attached on the begining of this project description.
- Wire library included in Arduino IDE.
- esp8266-oled-ssd1306 library. Download, unzip and add to libraries in our PC, for example C:\Users\toshiba\Documents\Arduino\libraries. This link you can find in Preferences of Adruino IDE program which installed in your PC. You can read about it here.
- Adafruit_Sensor library included.Download, unzip and add to libraries in our PC, for example C:\Users\toshiba\Documents\Arduino\libraries. This link you can find in Preferences of Adruino IDE program which installed in your PC.
- DHT-sensor library included. Download, unzip and add to libraries in our PC, for example C:\Users\toshiba\Documents\Arduino\libraries. This link you can find in Preferences of Adruino IDE program which installed in your PC. OR You can install it in Arduino IDE too: select Sketch-> Include library->Manage your libraries->type DHT in Filter your search line and you will see DHT sensor library by Adafruit->More info->select version->install. If it will be problem with compilation - remove 2 files from the library - DHT_U.cpp and DHT_U.h.
Sketch
- You can find it on the begining of this project
Other projects of Acoptex.com










Viewed: 2234 times