Getting Started: ESP8266 WeMos D1 Mini Development Board (ACR-00029)

Getting Started: ESP8266 WeMos D1 Mini Development Board (ACR-00029)

by ACROBOTIC Industries

WeMos D1 Mini (ESP8266): Getting Started

Overview

Time to complete: 2–10min; Level of difficulty: Beginner

This guide will show you how to configure the WeMos D1 Mini to start programming its onboard ESP8266 Serial to Wi-Fi module. After completing this you’ll be able to simply connect the board to the USB port and start programming it using the Arduino IDE.

List of Materials

  • 1 x WeMos ESP8266 D1 Mini V2 IoT Kit (5-Piece)

The WeMos D1 Mini Development Board

The WeMos family of boards is one of the latest additions to the ESP8266-based Internet Of Things (IoT) ecosystem.

WeMos D1 Mini ESP8266 SoC and Shields

The WeMos D1 Mini is a development board for the ESP8266 SoC, which includes a USB-to-Serial IC (CH340G), and all the necessary passive components.  It comes ready for plugging it into your computer's USB port and loading up different firmware such as NodeMCU (Lua), MicroPython (Python), Espruino (JavaScript), or even your own, which you can build with the Arduino IDE (C++) or using the manufacturer's SDK.

Wemos D1 Mini V2 ESP8266 Development Board

The Wemos D1 Mini small form-factor and wide range of plug-and-play shields make it an ideal solution for quickly getting started with programming the ESP8266 SoC.


What is the ESP8266?

We've written a very detailed account of the ESP8266 System On a Chip (SoC), if you want to find out the full story behind this little chip we invite you to read it:

http://learn.acrobotic.com/tutorials/post/what-is-the-esp8266

In short, the ESP8266 Serial to Wi-Fi SoC was released in the summer of 2014, and it has become a center point in the development of inexpensive IoT applications.  Given that Wi-Fi chips have been available for around a decade, you may be wondering what makes the ESP8266 special.  Besides being released at the 'right' time, meaning as Internet Of Things (IoT) have entered everyday speak among developers and tech entrepreneurs, there are a few reasons behind its meteoric rise in popularity:

  • Very capable microcontroller (32-bit 80MHz, built-in Wi-Fi, adequate I/O buses and peripherals; full specs below)
  • Extremely low-cost; ~$1 in moderate volumes)
  • Open SDK that works with GCC
  • Demonstrated ability to run Lua (NodeMCU), JavaScript (Espruino), and Python (MicroPython) interpreters!
  • Arduino IDE integration

We'll learn over the next few steps we'll learn how to set up our computers to be able to communicate with the WeMos D1 Mini board in order to program its onboard ESP8266.


WeMos D1 Mini vs. NodeMCU DevKit 1.0

Both the Wemos D1 Mini and the NodeMCU DevKit are development boards for the ESP8266 that allow us to program the onboard SoC with ease from a computer's USB port.  Here are a few things to consider when making the choice for one vs. the other:

WeMos D1 Mini

  • SoC: ESP8266 (ESP-12F Module)
  • USB-to-Serial: WCH's CH340
  • Cost: $7.50
  • GPIO: 11 Digital, 1 Analog
  • Size: 34.2mm × 25.6mm
  • Voltage Reg.: RT9013 500mA LDO
  • Power Input: (3.0~5.5VDC)

NodeMCU DevKit v1.0

  • SoC: ESP8266 (ESP-12F Module)
  • USB-to-Serial: Silicon Labs' CP2102
  • Cost: $9.95
  • GPIO: 16 Digital, 1 Analog
  • Size: 49.0mm × 24.5mm
  • Voltage Reg.: AMS1117 1A LDO
  • Power Input: (4.0~15.0VDC)

The most important considerations to us are the size and number of GPIO, so those will be the deciding factors when choosing one over the other.  Note that both boards can be powered using the Micro-USB connector or the available Vin pin (labeled 5V on the WeMos D1 Mini), but the power input on the NodeMCU DevKit boards can be significantly higher thanks to its 1117-based power regulator.

[side-by-side boards]

Typically, the NodeMCU DevKit boards ship with male pins pre-soldered, which makes it ready for use on a breadboard.  Meanwhile, the WeMos D1 Mini boards ship with an assortment of header pins: male, female, and long-pin female for the users' convenience.

Wemos D1 Mini Pin Configurations

The latter of the three are used to stack the board on both the top and the bottom sides.


Soldering the Pin Headers

The WeMos D1 Mini development boards are shipped with 3 pairs of header pins: male, female, and long-pin female.  Depending on the application, one of these options will be suitable.

Because in this tutorial we will not be connecting anything to the WeMos D1 Mini development board (other than the USB cable), we won't need to solder the pin headers just yet.  We'll certainly do so in the upcoming tutorials, so remember to check them out if you're curious about this step.


Installing The USB Drivers

Before we can start writing code that runs on the ESP8266, we'll need to communicate with the Wemos D1 Mini Development Board using a computer's USB interface. In particular, we'll need to install and configure a Virtual COM Port (VCP) driver to allow sending/receiving data from the USB-to-Serial UART module on the board: WCH's CH340.  

WeMos D1 Mini USB to Serial Adapter (CH340)

The CH340 is a popular chip used in many inexpensive development boards such as the Arduino-compatible Nano 3.0. As expected, the driver installation process will vary depending on your Operating System.

OS X

It used to be a painful task getting the CH340 chip recognized by OS X, not only was the driver unsigned but it needed some pre-installation commands entered using the Terminal.  However, as of November of 2015, a new driver has been released and it works right out of the box: CH34x_Install_V1.3.zip.

More info on this driver is found on Björn's Blog!

Before installing the driver we need to access System Preferences → Security & Privacy → General, and set the option for Allow apps downloaded from: to Mac App Store and identified developers so that the driver can run properly. Then, we can follow the instructions on the driver's README file to complete the installation (fixed the grammar a bit):

  • Extract the contents of the zip file to a local installation directory
  • Double-click CH34x_Install_V1.3.pkg
  • Follow and complete the installation procedure
  • Restart the computer after the installation finishes

Once the computer restarts, open the Terminal.App (use the Finder to Navigate to Applications → Utilities → Terminal) and once it's open type the command:

​​ls /dev/tty.*

This returns a list of peripherals currently connected to the computer.  Typically, boards carrying the CH340 chip appear listed as /dev/tty.wchusbserial     where      consists of a combination of letters and numbers such as fa130 in the image below.  

If we issue the command before connecting the board, there usually aren't any usbmodem devices available.

Listing USB Devices in OSX

Linux

Luckily for Linux users, the CH340 is recognized without the need for installing drivers! Similar to OS X we can open up a Terminal window, and issue the same command:

​​ls /dev/tty* | grep 'USB\|ACM'

On Linux, boards carrying USB to Serial adapters (e.g., CH340, CP2102, FT232R) are listed as either /dev/tty.ACM    or /dev/tty.USB    where     is a number. Issuing the command once prior to connecting the USB is a quick way to narrow down which entry corresponds to the board.

Windows

Depending on your Windows version, download one of these files:

Once installed we should see the message: Device driver software installed successfully.

You can manually verify that everything is in working order by following these steps:

  • Open the Device Manager (available through Control Panel → System & Security → Device Manager in the System section)
  • Under the Ports (COM & LPT) entry, there should be an open port named USB-SERIAL CH340 (COM  ) where    is a number typically greater or equal than 3.

Now that we're ready to communicate with our ESP8266 via the CH340, we can explore how to load our code onto it.


Loading Code With The Arduino IDE

For those of us who want to use the ESP8266 as a regular microcontroller such as the ATmega328 in the Arduino UNO, then it's possible to write custom firmware and load it on the chip.  As is typical in programming microcontrollers, the custom firmware will replace anything previously stored in the chip's flash memory.  

Although we can use the manufacturer's SDK to develop our custom firmware, it is much easier to use the good ol' Arduino IDE.

If you don't have the Arduino IDE installed, please look at our detailed tutorial on how to get it on your system.

In the Arduino IDE open the Preferences window and enter the URL below into the Additional Boards Manager URLs field, and select OK.

http://arduino.esp8266.com/stable/package_esp8266com_index.json

Arduino IDE preferences for ESP8266

Select the menu option Tools → Board → Boards Manager... and scroll down and to locate the option esp8266 by ESP8266 Community which should be the last item on the list, and click Install.

Arduino IDE boards manager selection for ESP8266

After restarting the Arduino IDE we can now select the board we're using from the menu option Tools → Board → NodeMCU 1.0 (ESP-12E Module). Then, we specify the correct CPU Frequency (Tools → CPU Frequency: "" → 80MHz) and Upload Speed (Tools → Upload Speed: "" → 115200).  Finally, the last step is to select the correct option for the Port (Tools → Port → /dev/cu.SLAB_USBtoUART).

Arduino IDE options for ESP8266 

At this point we can write our own firmware and upload it.  To get started we can try one of the examples File → Examples → ESP8266WiFi → WiFiScan. After uploading it, we can open the Serial Monitor window and observe the results.  Note that we need to match the baud rate, so check that 115200 is selected from the drop down menu!

Arduino IDE WiFi scan results with ESP8266


Other Firmware Options

Thanks to concerted efforts of the community around the ESP8266, there are now a few different firmware options for the chip.  From custom firmware loaded directly onto the chip, to interpreters for processing commands through peripheral interfaces (e.g., SPI, UART) for languages such as Lua, JavaScript, and Python, to name a few.

Language Options for firmware running on the ESP8266

Keep in mind that only one firmware option can be running on the ESP8266 onboard your WeMos D1 Mini at a time.  For instance, if you have the the factory firmware (AT+Commands interpreter) and upload the Blink program from the Arduino IDE, you'll need to re-flash the AT+Commands firmware to be able to use it once again.  The process is painless, so we encourage you to try all options available.


Next Steps

Visit our other tutorials to get started with all the different projects for the WeMos D1 Mini and its family of shields!

 

Leave a comment

  • Please note, comments must be approved before they are published

$1 Days
$2 Hours
$3 Minutes
$4 Second
{ "en":{ "general": { "field": { "required": "Required", "actions": "Actions", "top_btn": "Top" }, "accessibility": { "skip_to_content": "Skip to content", "close_modal": "Close (esc)" }, "meta": { "tags": "Tagged \"[[ tags ]]\"", "page": "Page [[ page ]]" }, "404": { "title": "404 Page Not Found", "subtext": "The page you requested does not exist.", "link": "Continue shopping" }, "pagination": { "previous": "Previous", "next": "Next", "current_page": "Page [[ current ]] of [[ total ]]" }, "password_page": { "opening_soon": "Opening Soon", "login_form_heading": "Enter store using password", "login_form_password_label": "Password", "login_form_password_placeholder": "Your password", "login_form_submit": "Enter", "signup_form_email_label": "Email", "signup_form_success": "We will send you an email right before we open!", "admin_link_html": "Are you the store owner? Log in here<\/a>", "password_link": "Enter using password", "powered_by_shopify_html": "This shop will be powered by [[ shopify ]]" }, "social": { "share_on_facebook": "Share", "share_on_twitter": "Tweet", "share_on_pinterest": "Pin it", "alt_text": { "share_on_facebook": "Share on Facebook", "share_on_twitter": "Tweet on Twitter", "share_on_pinterest": "Pin on Pinterest" } }, "search": { "no_results_html": "Your search for \"[[ terms ]]\" did not yield any results.", "results_with_count": { "one": "[[ count ]] result for \"[[ terms ]]\"", "other": "[[ count ]] results for \"[[ terms ]]\"" }, "title": "Search our site", "placeholder": "Search", "submit": "Submit", "close": "Close search" }, "newsletter_form": { "newsletter_email": "Join our mailing list", "email_placeholder": "Email address", "confirmation": "Thanks for subscribing", "submit": "Subscribe", "show_me_text": "Do not show me again" }, "filters": { "show_more": "Show More", "show_less": "Show Less" }, "breadcrumbs": { "home": "Home", "create_account": "Create account", "account": "Account", "addresses": "Addresses" }, "item": { "remove": "Remove Item" } }, "sections": { "header": { "top_header_login": "Login", "top_header_register": "Register", "top_header_wishlist": "Wish list", "register_dropdown": "No account? Create one here", "forgot": "Forgot password", "all_collection": "All Collections", "world_wide_delivery": "Worldwide delivery", "shipping_text": "Free UK Delivery on orders over £ 100", "hot_line": "Hot line" }, "menu": { "mobile_menu_tab": "Menu", "mobile_account_tab": "Account", "mobile_settings_tab": "Settings" }, "slideshow": { "next_slide": "Next slide", "previous_slide": "Previous slide", "pause_slideshow": "Pause slideshow", "play_slideshow": "Play slideshow", "play_video": "Play video", "close_video": "Close video" }, "map": { "get_directions": "Get directions", "address_error": "Error looking up that address", "address_no_results": "No results for that address", "address_query_limit_html": "You have exceeded the Google API usage limit. Consider upgrading to a Premium Plan<\/a>.", "auth_error_html": "There was a problem authenticating your Google Maps account. Create and enable the JavaScript API<\/a> and Geocoding API<\/a> permissions of your app." } }, "blogs": { "article": { "view_all": "View all", "all_topics": "All topics", "by_author": "by [[ author ]]", "posted_in": "Posted in", "read_more": "Read more", "back_to_blog": "Back to [[ title ]]" }, "comments": { "title": "Leave a comment", "name": "Name", "email": "Email", "message": "Message", "post": "Post comment", "moderated": "Please note, comments must be approved before they are published", "success_moderated": "Your comment was posted successfully. We will publish it in a little while, as our blog is moderated.", "success": "Your comment was posted successfully! Thank you!", "comments_with_count": { "one": "[[ count ]] comment", "other": "[[ count ]] comments" } } }, "cart": { "general": { "title": "Your cart", "note": "Add a note to your order", "remove": "Remove", "subtotal": "Subtotal", "savings": "You're saving", "shipping_at_checkout": "Shipping & taxes calculated at checkout", "update": "Update", "checkout": "Process Check out", "empty": "Your cart is currently empty.", "cookies_required": "Enable cookies to use the shopping cart", "edit": "Edit", "cancel": "Cancel", "continue_shopping": "Continue shopping", "recently_added_item": "Recently added item(s)", "remove_item": "Remove This Item", "view_and_edit_cart": "View and edit cart", "clear": "Clear cart", "empty_page_title": "Shopping Cart is Empty", "here": "here", "empty_continue_html": "Click here to continue shopping.", "processing": "Processing...", "items_count_label" : "[[ count ]] item(s) in your cart", "ok" : "Ok" }, "label": { "product": "Product", "price": "Price", "quantity": "Quantity", "total": "Total", "total_item": "Total item", "sub_total_top": "Cart Subtotal" } }, "collections": { "general": { "view_all": "View all", "clear_all": "Clear All", "no_matches": "Sorry, there are no products in this collection", "items_with_count": { "one": "[[ count ]] product", "other": "[[ count ]] products" }, "load_more": "Load More", "sidebar_btn": "Filter by" }, "sorting": { "title": "Sort by", "manual": "Featured", "best_selling": "Best Selling", "title_ascending": "Alphabetically, A-Z", "title_descending": "Alphabetically, Z-A", "price_ascending": "Price, low to high", "price_descending": "Price, high to low", "created_descending": "Date, new to old", "created_ascending": "Date, old to new" }, "filters": { "title_tags": "Filter", "all_tags": "All products", "categories": "categories", "title": "Filter", "color": "Color", "size": "Size", "brand": "Brand", "price": "Price", "green": "Green", "blue": "Blue", "red": "Red", "pink": "Pink", "black": "Black", "purple": "Purple", "white": "White", "orange": "Orange" }, "product_item": { "quick_shop": "Quick View", "compare": "Compare", "wishlist": "Add to Wishlist" } }, "contact": { "form": { "name": "Name", "email": "Email", "phone": "Phone Number", "message": "Message", "submit": "Submit", "post_success": "Thanks for contacting us. We'll get back to you as soon as possible.", "address": "Address", "telephone": "Telephone", "title": "Write us", "required": "Required" } }, "customer": { "account": { "title": "My Account", "details": "Account Details", "view_addresses": "View Addresses", "return": "Return to Account Details" }, "activate_account": { "title": "Activate Account", "subtext": "Create your password to activate your account.", "password": "Password", "password_confirm": "Confirm Password", "submit": "Activate Account", "cancel": "Decline Invitation" }, "addresses": { "title": "Your Addresses", "default": "Default", "add_new": "Add a New Address", "edit_address": "Edit address", "first_name": "First Name", "last_name": "Last Name", "company": "Company", "address1": "Address1", "address2": "Address2", "city": "City", "country": "Country", "province": "Province", "zip": "Postal\/Zip Code", "phone": "Phone", "set_default": "Set as default address", "add": "Add Address", "update": "Update Address", "cancel": "Cancel", "edit": "Edit", "delete": "Delete", "delete_confirm": "Are you sure you wish to delete this address?" }, "login": { "title": "Login", "desc": "If you have an account, sign in with your email address.", "email": "Email", "password": "Password", "forgot_password": "Forgot your password?", "sign_in": "Sign In", "guest_title": "Continue as a guest", "guest_continue": "Continue" }, "orders": { "title": "Order History", "order_number": "Order", "date": "Date", "payment_status": "Payment Status", "fulfillment_status": "Fulfillment Status", "total": "Total", "none": "You haven't placed any orders yet." }, "order": { "title": "Order [[ name ]]", "date": "Placed on [[ date ]]", "cancelled": "Order Cancelled on [[ date ]]", "cancelled_reason": "Reason: [[ reason ]]", "billing_address": "Billing Address", "payment_status": "Payment Status", "shipping_address": "Shipping Address", "fulfillment_status": "Fulfillment Status", "discount": "Discount", "shipping": "Shipping", "tax": "Tax", "product": "Product", "sku": "SKU", "price": "Price", "quantity": "Quantity", "total": "Total", "fulfilled_at": "Fulfilled [[ date ]]", "subtotal": "Subtotal" }, "recover_password": { "title": "Reset your password", "email": "Email", "submit": "Submit", "cancel": "Cancel", "subtext": "We will send you an email to reset your password.", "success": "We've sent you an email with a link to update your password." }, "reset_password": { "title": "Reset account password", "subtext": "Enter a new password for [[ email ]]", "password": "Password", "password_confirm": "Confirm Password", "submit": "Reset Password" }, "register": { "title": "Create Account", "first_name": "First Name", "last_name": "Last Name", "email": "Email", "password": "Password", "submit": "Create", "desc": "Creating an account is easy. Just fill in the form below." } }, "homepage": { "onboarding": { "product_title": "Your product's name", "product_description": "This area is used to describe your product’s details. Tell customers about the look, feel, and style of your product. Add details on color, materials used, sizing, and where it was made.", "collection_title": "Your collection's name", "blog_title": "Your post's title", "blog_excerpt": "Your store hasn’t published any blog posts yet. A blog can be used to talk about new product launches, tips, or other news you want to share with your customers. You can check out Shopify’s ecommerce blog for inspiration and advice for your own store and blog.", "blog_author": "Author name", "no_content": "This section doesn’t currently include any content. Add content to this section using the sidebar." } }, "layout": { "navigation": { "search": "Search", "toggle": "expand\/collapse", "expand": "expand", "collapse": "collapse", "all_categories": "All Categories" }, "cart": { "title": "Cart", "items_count": { "one": "item", "other": "items" } }, "customer": { "account": "Account", "log_out": "Log out", "logout": "Log out", "log_in": "Log in", "create_account": "Create account", "sign_up": "Sign up", "wishlist": "Wishlist" }, "footer": { "social_platform": "[[ name ]] on [[ platform ]]" }, "list_page": { "grid": "Grid", "list": "List" } }, "products": { "product": { "regular_price": "Regular price", "sold_out": "Sold out", "unavailable": "Unavailable", "on_sale": "Sale", "quantity": "Quantity", "add_to_cart": "Add to cart", "back_to_collection": "Back to [[ title ]]", "related_title": "Related Products", "qty_increase": "Increase", "qty_decrease": "Decrease", "deal_days": "Days", "deal_hours": "Hours", "deal_minutes": "Minutes", "deal_second": "Second", "select_option": "Select Option", "add_to_wishlist": "Add to Wishlist", "add_to_review": "Add to review", "compare_success_msg": "[[ product_title ]] has added to comparing box successful", "compare_exist_msg": "[[ product_title ]] is exist in comparing box", "compare_cart_msg": "[[ product_title ]] has added to shopping cart", "compare_remove_msg": "[[ product_title ]] has removed from comparing box", "compare_remove_msg": "[[ product_title ]] has removed from comparing box", "comparing_box": "Comparing box", "compare_no_items": "There is no items in comparing box", "wishlist_success_msg": "[[ product_title ]] has added to wishlist successful", "wishlist_exist_msg": "[[ product_title ]] is exist in wishlist", "wishlist_cart_msg": "[[ product_title ]] has added to shopping cart", "wishlist_box": "Wishlist", "wishlist_remove_msg": "[[ product_title ]] has removed from wishlist", "wislist_no_items": "There is no items in wishlist", "upsell_cart_msg": "\"[[ product_title ]]\" has added to shopping cart", "upsell_block_title": "Frequently bought with \"[[ product_title ]]\"", "upsell_cart_qty": "[[ count ]] item(s)", "upsell_product_page_title": "You may also like these products", "upsell_checkout_btn": "Checkout", "share": "Share product", "share_on_facebook": "Share on Facebook", "share_on_twitter": "Share on Twitter", "share_on_pinterest": "Share on Pinterest", "share_on_google": "Share on Google+", "share_on_linkedin": "Share on LinkedIn", "availability": "Availability", "in_stock": "In Stock", "out_of_stock": "Out of stock", "quick_overview": "Quick Overview", "details": "Details", "reviews": "Reviews", "first_review": "Be the first review", "tags": "Product Tags", "size_chart": "Size Chart", "options": "Options", "vendor": "Vendor", "features": "Features", "sale_left_text": "[[ sales ]] SOLD. HURRY! ONLY A FEW LEFT!", "checkout_text": "Secured and trusted checkout with" }, "upsell": { "recommend_text": "Someone purchased a", "minute_ago": "minutes ago" } }, "gift_cards": { "issued": { "title_html": "Here's your [[ value ]] gift card for [[ shop ]]!", "subtext": "Your gift card", "disabled": "Disabled", "expired": "Expired on [[ expiry ]]", "active": "Expires on [[ expiry ]]", "redeem_html": "Use this code at checkout to redeem your [[ value ]] gift card", "shop_link": "Start shopping", "print": "Print this gift card", "remaining_html": "[[ balance ]] left", "add_to_apple_wallet": "Add to Apple Wallet" } }, "date_formats": { "month_day_year": "%B %d, %Y" } } }