{"id":22143,"date":"2018-02-10T19:30:22","date_gmt":"2018-02-10T12:30:22","guid":{"rendered":"http:\/\/tom.ji42.com\/?p=22143"},"modified":"2020-11-05T12:17:34","modified_gmt":"2020-11-05T05:17:34","slug":"wiring-nodemcu-esp8266-12e-with-i2c-16x2-lcd-screen","status":"publish","type":"post","link":"https:\/\/tom.tomwork.net\/?p=22143","title":{"rendered":"Wiring NodeMCU ESP8266 12E with i2C 16\u00d72 LCD Screen"},"content":{"rendered":"<p>Another illustration that demonstrate how to wire the i2c 16\u00d72 LCD on ESP8266 12 Known as NodeMCU, as you can see the diagram below the SCL as Arduino Analog Pin A4 is connected to D1 on NodeMCU at the same time the D2 as the SDA represent as Analog Pin A5 on Arduino Board, As you may notice that the sketch code that we used it is not LUA script it is actually standard Arduino C compiled\/Interpret by Arduino IDE. If you don\u2019t have an ESP8266 runs on Arduino IDE please follow this\u00a0<a href=\"https:\/\/www.14core.com\/arduino-ide-with-esp8266-integration-for-ease-programming\/\">link<\/a>.<\/p>\n<p><!--more--><\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/qazmypTyLp8\" width=\"640\" height=\"360\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" data-mce-fragment=\"1\"><\/iframe><\/p>\n<p><strong>Required Devices<\/strong><\/p>\n<ul>\n<li>NodeMCU 12,12E<\/li>\n<li>LCD16x2 on i2C Module<\/li>\n<li>Jumper Wires \/ DuPont Wires<\/li>\n<\/ul>\n<p><strong>Wiring Diagram<\/strong><\/p>\n<p><strong>Sketch Code<\/strong><\/p>\n<div id=\"crayon-5a7ecee887be6904028469\" class=\"crayon-syntax crayon-theme-arduino-ide crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-plain-wrap\"><\/div>\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">\n<div class=\"crayon-nums-content\">\n<div class=\"crayon-num\" data-line=\"crayon-5a7ecee887be6904028469-1\">1<\/div>\n<div class=\"crayon-num crayon-striped-num\" data-line=\"crayon-5a7ecee887be6904028469-2\">2<\/div>\n<div class=\"crayon-num\" data-line=\"crayon-5a7ecee887be6904028469-3\">3<\/div>\n<div class=\"crayon-num crayon-striped-num\" data-line=\"crayon-5a7ecee887be6904028469-4\">4<\/div>\n<div class=\"crayon-num\" data-line=\"crayon-5a7ecee887be6904028469-5\">5<\/div>\n<div class=\"crayon-num crayon-striped-num\" data-line=\"crayon-5a7ecee887be6904028469-6\">6<\/div>\n<div class=\"crayon-num\" data-line=\"crayon-5a7ecee887be6904028469-7\">7<\/div>\n<div class=\"crayon-num crayon-striped-num\" data-line=\"crayon-5a7ecee887be6904028469-8\">8<\/div>\n<div class=\"crayon-num\" data-line=\"crayon-5a7ecee887be6904028469-9\">9<\/div>\n<div class=\"crayon-num crayon-striped-num\" data-line=\"crayon-5a7ecee887be6904028469-10\">10<\/div>\n<div class=\"crayon-num\" data-line=\"crayon-5a7ecee887be6904028469-11\">11<\/div>\n<div class=\"crayon-num crayon-striped-num\" data-line=\"crayon-5a7ecee887be6904028469-12\">12<\/div>\n<div class=\"crayon-num\" data-line=\"crayon-5a7ecee887be6904028469-13\">13<\/div>\n<div class=\"crayon-num crayon-striped-num\" data-line=\"crayon-5a7ecee887be6904028469-14\">14<\/div>\n<div class=\"crayon-num\" data-line=\"crayon-5a7ecee887be6904028469-15\">15<\/div>\n<div class=\"crayon-num crayon-striped-num\" data-line=\"crayon-5a7ecee887be6904028469-16\">16<\/div>\n<div class=\"crayon-num\" data-line=\"crayon-5a7ecee887be6904028469-17\">17<\/div>\n<div class=\"crayon-num crayon-striped-num\" data-line=\"crayon-5a7ecee887be6904028469-18\">18<\/div>\n<div class=\"crayon-num\" data-line=\"crayon-5a7ecee887be6904028469-19\">19<\/div>\n<div class=\"crayon-num crayon-striped-num\" data-line=\"crayon-5a7ecee887be6904028469-20\">20<\/div>\n<div class=\"crayon-num\" data-line=\"crayon-5a7ecee887be6904028469-21\">21<\/div>\n<div class=\"crayon-num crayon-striped-num\" data-line=\"crayon-5a7ecee887be6904028469-22\">22<\/div>\n<div class=\"crayon-num\" data-line=\"crayon-5a7ecee887be6904028469-23\">23<\/div>\n<\/div>\n<\/td>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-5a7ecee887be6904028469-1\" class=\"crayon-line\"><span class=\"crayon-c\">\/*<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-2\" class=\"crayon-line crayon-striped-line\"><span class=\"crayon-c\">14CORE NodeMCU i2C 16&#215;2 LCD SCREEN<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-3\" class=\"crayon-line\"><span class=\"crayon-c\">Test COde&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-4\" class=\"crayon-line crayon-striped-line\"><span class=\"crayon-c\">*\/<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-5\" class=\"crayon-line\"><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-6\" class=\"crayon-line crayon-striped-line\"><span class=\"crayon-p\">#include &lt;Wire.h&gt;\u00a0\u00a0\/\/ This library is already built in to the Arduino IDE<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-7\" class=\"crayon-line\"><span class=\"crayon-p\">#include &lt;LiquidCrystal_I2C.h&gt; \/\/This library you can add via Include Library &gt; Manage Library &gt; <\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-8\" class=\"crayon-line crayon-striped-line\"><span class=\"crayon-e\">LiquidCrystal_I2C <\/span><span class=\"crayon-e\">lcd<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-cn\">0x3F<\/span><span class=\"crayon-sy\">,<\/span> <span class=\"crayon-cn\">20<\/span><span class=\"crayon-sy\">,<\/span> <span class=\"crayon-cn\">4<\/span><span class=\"crayon-sy\">)<\/span><span class=\"crayon-sy\">;<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-9\" class=\"crayon-line\"><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-10\" class=\"crayon-line crayon-striped-line\"><span class=\"crayon-t\">void<\/span> <span class=\"crayon-e\">setup<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-sy\">)<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-11\" class=\"crayon-line\"><span class=\"crayon-sy\">{<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-12\" class=\"crayon-line crayon-striped-line\"><span class=\"crayon-h\">\u00a0\u00a0<\/span><span class=\"crayon-v\">lcd<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-e\">init<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-sy\">)<\/span><span class=\"crayon-sy\">;<\/span><span class=\"crayon-h\">\u00a0\u00a0 <\/span><span class=\"crayon-c\">\/\/ initializing the LCD<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-13\" class=\"crayon-line\"><span class=\"crayon-h\">\u00a0\u00a0<\/span><span class=\"crayon-v\">lcd<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-e\">backlight<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-sy\">)<\/span><span class=\"crayon-sy\">;<\/span> <span class=\"crayon-c\">\/\/ Enable or Turn On the backlight <\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-14\" class=\"crayon-line crayon-striped-line\"><span class=\"crayon-h\">\u00a0\u00a0<\/span><span class=\"crayon-v\">lcd<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-e\">setCursor<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-cn\">0<\/span><span class=\"crayon-sy\">,<\/span> <span class=\"crayon-cn\">1<\/span><span class=\"crayon-sy\">)<\/span><span class=\"crayon-sy\">;<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-15\" class=\"crayon-line\"><span class=\"crayon-h\">\u00a0\u00a0<\/span><span class=\"crayon-v\">lcd<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-e\">print<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-s\">&#8220;14CORE | 16&#215;2 LCD TEST&#8221;<\/span><span class=\"crayon-sy\">)<\/span><span class=\"crayon-sy\">;<\/span> <span class=\"crayon-c\">\/\/ Start Print text to Line 1<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-16\" class=\"crayon-line crayon-striped-line\"><span class=\"crayon-h\">\u00a0\u00a0<\/span><span class=\"crayon-v\">lcd<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-e\">setCursor<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-cn\">0<\/span><span class=\"crayon-sy\">,<\/span> <span class=\"crayon-cn\">2<\/span><span class=\"crayon-sy\">)<\/span><span class=\"crayon-sy\">;<\/span><span class=\"crayon-h\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-17\" class=\"crayon-line\"><span class=\"crayon-h\">\u00a0\u00a0<\/span><span class=\"crayon-v\">lcd<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-e\">print<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-s\">&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8220;<\/span><span class=\"crayon-sy\">)<\/span><span class=\"crayon-sy\">;<\/span> <span class=\"crayon-c\">\/\/ Start Print Test to Line 2<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-18\" class=\"crayon-line crayon-striped-line\"><span class=\"crayon-sy\">}<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-19\" class=\"crayon-line\"><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-20\" class=\"crayon-line crayon-striped-line\"><span class=\"crayon-t\">void<\/span> <span class=\"crayon-e\">loop<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-sy\">)<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-21\" class=\"crayon-line\"><span class=\"crayon-sy\">{<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-22\" class=\"crayon-line crayon-striped-line\"><span class=\"crayon-h\">\u00a0\u00a0<\/span><span class=\"crayon-c\">\/\/ Nothing Absolutely Nothing!<\/span><\/div>\n<div id=\"crayon-5a7ecee887be6904028469-23\" class=\"crayon-line\"><span class=\"crayon-sy\">}<\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<div class=\"synved-social-container synved-social-container-share\"><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/14core-1318057461590353\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" data-provider=\"facebook\"><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" title=\"Share on Twitter\" href=\"https:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.14core.com%2Fwiring-nodemcu-esp8266-12e-with-i2c-16x2-lcd-screen%2F&amp;text=Hey%20check%20this%20out\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" data-provider=\"twitter\"><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-google_plus nolightbox\" title=\"Share on Google+\" href=\"https:\/\/plus.google.com\/u\/0\/113094848966463623463\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" data-provider=\"google_plus\"><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-reddit nolightbox\" title=\"Share on Reddit\" href=\"https:\/\/www.reddit.com\/submit?url=https%3A%2F%2Fwww.14core.com%2Fwiring-nodemcu-esp8266-12e-with-i2c-16x2-lcd-screen%2F&amp;title=Wiring%20NodeMCU%20ESP8266%2012E%20with%20i2C%2016%D72%20LCD%20Screen\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" data-provider=\"reddit\"><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-pinterest nolightbox\" title=\"Pin it with Pinterest\" href=\"https:\/\/pinterest.com\/pin\/create\/button\/?url=https%3A%2F%2Fwww.14core.com%2Fwiring-nodemcu-esp8266-12e-with-i2c-16x2-lcd-screen%2F&amp;media=http%3A%2F%2Fwww.14core.com%2Fwp-content%2Fuploads%2F2016%2F01%2FNodeMCU-LCD-Screen-i2c-16x2-Display.jpg&amp;description=Wiring%20NodeMCU%20ESP8266%2012E%20with%20i2C%2016%D72%20LCD%20Screen\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" data-provider=\"pinterest\"><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" title=\"Share by email\" href=\"mailto:?subject=Wiring%20NodeMCU%20ESP8266%2012E%20with%20i2C%2016%D72%20LCD%20Screen&amp;body=Hey%20check%20this%20out:%20https%3A%2F%2Fwww.14core.com%2Fwiring-nodemcu-esp8266-12e-with-i2c-16x2-lcd-screen%2F\" rel=\"nofollow\" data-provider=\"mail\"><\/a><\/div>\n<div class=\"yarpp-related\">\n<h3>Related Article:<\/h3>\n<ol>\n<li><a title=\"Wiring DHT11, DHT22, with OLED Screen on ESP8266 12E\" href=\"https:\/\/www.14core.com\/wiring-dht11-dht22-with-oled-screen-on-esp8266-12e\/\" rel=\"bookmark\">Wiring DHT11, DHT22, with OLED Screen on ESP8266 12E<\/a><\/li>\n<li><a title=\"Wiring the LCD 16\u00d72 Keypad Shield on Arduino\" href=\"https:\/\/www.14core.com\/wiring-the-lcd-16x2-keypad-shield-on-arduino\/\" rel=\"bookmark\">Wiring the LCD 16\u00d72 Keypad Shield on Arduino<\/a><\/li>\n<li><a title=\"Wiring the Rotary Encoder with Arduino\" href=\"https:\/\/www.14core.com\/wiring-the-rotary-encoder-with-arduino\/\" rel=\"bookmark\">Wiring the Rotary Encoder with Arduino<\/a><\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Another illustration that demonstrate how to wire the i2c 16\u00d72 LCD on ESP8266 12 Known as NodeMCU, as you can see the diagram below the SCL as Arduino Analog Pin A4 is connected to D1 on NodeMCU at the same time the D2 as the SDA represent as Analog Pin A5 on Arduino Board, As [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[13],"tags":[],"class_list":["post-22143","post","type-post","status-publish","format-standard","hentry","category-13"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6cOVM-5L9","_links":{"self":[{"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=\/wp\/v2\/posts\/22143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=22143"}],"version-history":[{"count":8,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=\/wp\/v2\/posts\/22143\/revisions"}],"predecessor-version":[{"id":25065,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=\/wp\/v2\/posts\/22143\/revisions\/25065"}],"wp:attachment":[{"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=22143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=22143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tom.tomwork.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=22143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}