{"id":2543,"date":"2020-07-18T13:00:00","date_gmt":"2020-07-18T12:00:00","guid":{"rendered":"https:\/\/chewett.co.uk\/blog\/?p=2543"},"modified":"2020-08-12T17:23:32","modified_gmt":"2020-08-12T16:23:32","slug":"i2c-connection-pins-on-the-wemos-d1-mini-esp8266","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/2543\/i2c-connection-pins-on-the-wemos-d1-mini-esp8266\/","title":{"rendered":"I2C Connection Pins on the WeMos D1 Mini (ESP8266)"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"254\" data-attachment-id=\"2546\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/2543\/i2c-connection-pins-on-the-wemos-d1-mini-esp8266\/wemos_i2c_connections\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/wemos_i2c_connections.jpg?fit=800%2C300&amp;ssl=1\" data-orig-size=\"800,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"wemos_i2c_connections\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/wemos_i2c_connections.jpg?fit=300%2C113&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/wemos_i2c_connections.jpg?fit=678%2C254&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/wemos_i2c_connections.jpg?resize=678%2C254&#038;ssl=1\" alt=\"\" class=\"wp-image-2546\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/wemos_i2c_connections.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/wemos_i2c_connections.jpg?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/wemos_i2c_connections.jpg?resize=768%2C288&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/wemos_i2c_connections.jpg?resize=50%2C19&amp;ssl=1 50w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/figure>\n\n\n\n<p>This blog post details the I2C connections on the WeMos D1 Mini (ESP8266).<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Using I2C connections with the WeMos D1 Mini (ESP8266)<\/h2>\n\n\n\n<p>Within IoT devices the I2C protocol is used a lot for multi-master multi-slave communication as a relatively simple serial bus. You will find that small sensors will report their data on the I2C bus. This means it can be important to know how to connect your IoT device to an I2C bus.<\/p>\n\n\n\n<p>To connect something to the I2C bus you will need to join both devices SCL and SDA pins together. These two I2C connections are not labelled on the WeMos&#8217;s circuit board so this makes it a bit harder to use.<\/p>\n\n\n\n<p>For the WeMos D1 Mini the pins as as follows:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>I2C Pin <\/strong><\/td><td><strong>Pin on the WeMos<\/strong><\/td><\/tr><tr><td>SCL (Serial Clock)<\/td><td>D1<\/td><\/tr><tr><td>SDA (Serial Data)<\/td><td>D2<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Once connected you will be able to talk to your I2C devices using the WeMos D1 Mini.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Important reminder about Pin numbers and the Arduino IDE<\/h2>\n\n\n\n<p>It is important to remember that the pin mappings for the WeMos D1 are not the same as the standard Arduino Pins. What this means is that Pin 1 on the Arduino is not represented as 1.<\/p>\n\n\n\n<p>You will need to use the WeMos constants for this to correctly address the pins.<\/p>\n\n\n\n<p>I talk more about this in my blog post <a href=\"https:\/\/chewett.co.uk\/blog\/1066\/pin-numbering-for-wemos-d1-mini-esp8266\/\">Pin Numbering for WeMos D1 mini (ESP8266)<\/a>.<\/p>\n\n\n\n<p>If you have any questions about the I2C pins on the WeMos feel free to ask below in the comments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog post details the I2C connections on the WeMos D1 Mini (ESP8266).<\/p>\n","protected":false},"author":1,"featured_media":2595,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"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":"Today I have written a quick note on the I2C Connection Pins on the #WeMos D1 Mini (#ESP8266)","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":[97],"tags":[296,209,237],"class_list":["post-2543","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-electronics","tag-i2c","tag-wemos","tag-wemos-d1-mini"],"wppr_data":{"cwp_meta_box_check":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/wemos_i2c_pin_numbering_posticon_output.png?fit=1200%2C628&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-F1","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2549,"url":"https:\/\/chewett.co.uk\/blog\/2549\/using-the-128x64-i2c-sh1106-oled-display-module-screen-with-a-wemos-d1-mini-esp8266\/","url_meta":{"origin":2543,"position":0},"title":"Using the 128\u00d764 I2C SH1106 OLED Display Module Screen with a WeMos D1 Mini (ESP8266)","author":"Chewett","date":"September 26, 2020","format":false,"excerpt":"In this blog post I talk about how you can use a 128\u00d764 I2C\u00a0SH1106 OLED Display Module Screen with a WeMos D1 Mini (ESP8266) using the Arduino IDE. Summary of the 128\u00d764 I2C\u00a0SH1106 OLED Display Module Screen The SH1106 OLED display module is a nice 128x64 pixel screen. This unit\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/wemos_128x64_sh1106_oled_screen_output.png?fit=1200%2C628&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/wemos_128x64_sh1106_oled_screen_output.png?fit=1200%2C628&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/wemos_128x64_sh1106_oled_screen_output.png?fit=1200%2C628&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/wemos_128x64_sh1106_oled_screen_output.png?fit=1200%2C628&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/wemos_128x64_sh1106_oled_screen_output.png?fit=1200%2C628&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":937,"url":"https:\/\/chewett.co.uk\/blog\/937\/configuring-wemos-d1-mini-pro-esp8266-arduino-ide\/","url_meta":{"origin":2543,"position":1},"title":"Configuring the Wemos D1 Mini Pro ESP8266 for Arduino IDE","author":"Chewett","date":"December 30, 2017","format":false,"excerpt":"This guide runs you through a basic set of steps to configure the Aduino IDE to program a Wemos D1 Mini Pro ESP8266. What is the Wemos D1 mini Pro The Wemos D1 mini Pro is an Arduino-like board that runs using the ESP8266 microcontroller. One of the key differences\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/01\/wemos_d1_mini_post_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/01\/wemos_d1_mini_post_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/01\/wemos_d1_mini_post_icon.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/01\/wemos_d1_mini_post_icon.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1405,"url":"https:\/\/chewett.co.uk\/blog\/1405\/using-the-dht11-temperature-sensor-with-a-wemos-d1-mini-esp8266\/","url_meta":{"origin":2543,"position":2},"title":"Using the DHT11 Temperature Sensor with a WeMos D1 Mini (ESP8266)","author":"Chewett","date":"August 18, 2018","format":false,"excerpt":"In this blog post I talk about the additional steps needed to use the DHT11 temperature sensor with a WeMos D1 Mini (ESP8266) with the Arduino IDE. Differences from running a DHT11 on an Arduino There are two major differences to bear in mind when using the DHT11 on a\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/dht11_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/dht11_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/dht11_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/dht11_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1412,"url":"https:\/\/chewett.co.uk\/blog\/1412\/using-the-ds18b20-temperature-sensor-with-a-wemos-d1-mini-esp8266\/","url_meta":{"origin":2543,"position":3},"title":"Using the DS18B20 Temperature Sensor with a WeMos D1 Mini (ESP8266)","author":"Chewett","date":"November 21, 2018","format":false,"excerpt":"In this blog post I talk about the additional steps needed to use the DS18B20 onewire temperature sensor with a WeMos D1 Mini (ESP8266) using the Arduino IDE. Important differences compared to using the DS18B20 on an Arduino There is one major difference to bear in mind when using the\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/11\/wd18b20_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/11\/wd18b20_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/11\/wd18b20_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/11\/wd18b20_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1476,"url":"https:\/\/chewett.co.uk\/blog\/1476\/using-the-dht22-temperature-sensor-with-a-wemos-d1-mini-esp8266\/","url_meta":{"origin":2543,"position":4},"title":"Using the DHT22 Temperature Sensor with a WeMos D1 Mini (ESP8266)","author":"Chewett","date":"September 22, 2018","format":false,"excerpt":"In this blog post I talk about the additional steps needed to use the DHT22 temperature sensor with a WeMos D1 Mini (ESP8266) with the Arduino IDE. Differences from running a DHT22 on an Arduino There are two major differences to bear in mind when using the DHT22 on a\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/09\/dht22_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/09\/dht22_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/09\/dht22_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/09\/dht22_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1856,"url":"https:\/\/chewett.co.uk\/blog\/1856\/using-the-sw-18010p-motion-vibration-sensor-with-a-wemos-d1-mini-esp8266\/","url_meta":{"origin":2543,"position":5},"title":"Using the SW-18010P Motion Vibration Sensor with a WeMos D1 Mini (ESP8266)","author":"Chewett","date":"February 2, 2019","format":false,"excerpt":"In this blog post I talk about how you can use a SW-18010P Motion Vibration sensor with a WeMos D1 Mini (ESP8266) using the Arduino IDE. Summary of the SW-18010P Motion Vibration sensor This motion sensor works by encasing a small spring inside a metal casing. Whenever the sensor moves\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/02\/sw18010p_vibration_sensor_wemos.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/02\/sw18010p_vibration_sensor_wemos.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/02\/sw18010p_vibration_sensor_wemos.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/02\/sw18010p_vibration_sensor_wemos.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=2543"}],"version-history":[{"count":2,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2543\/revisions"}],"predecessor-version":[{"id":2548,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2543\/revisions\/2548"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media\/2595"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=2543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=2543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=2543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}