MicroPython and the Internet of Things, Part I: Welcome

Posted by
on under

Welcome to my MicroPython and the Internet of Things tutorial!

In this first part I want to give you a brief overview of what this tutorial is about, and more importantly, provide you the list of components that you are going to need.

If you want to see me and hear me explain everything in this tutorial, I encourage you to purchase the video version from my Courses site. Not only it will make for a better learning experience, but you'll also be supporting my effort in keeping my blog updated with relevant content. Thank you!

For your reference, here is the complete list of chapters in this tutorial:

About This Tutorial

This is a tutorial for Python beginners who want to learn to program devices to interact with the physical world and with the so called "Cloud". You are going to learn how to program with MicroPython, a version of the Python language designed to run on microcontrollers. The applications that you are going to learn how to write are going to read data from sensors, display information on small screens, react to the push a button, and upload or download data from the Internet. Lots of cool stuff!

This tutorial is focused on the software side more than on the hardware side. I'm going to use a high-level "Lego" approach for building circuits, so instead of having to solder components into circuit boards, you'll be building your experiments on breadboards, and interconnecting components with jumper wires. You will be able to assemble and disassemble your circuits with ease, and more importantly, reuse components as you move through the tutorial and later when you build your own projects.

Requirements

To be able to follow this tutorial you just need to have basic coding experience with Python. You do not need to have any previous knowledge of microcontrollers, electronics, or even MicroPython.

You will also need a Windows, Mac or Linux computer with a free USB port, as you will connect a microcontroller to your computer to program it. If your computer is one of the newer ones that only come with USB-C ports, then you are going to need an adapter so that you can connect a regular USB cable.

The Shopping List

In this section I will give you a short list with the components that you are going to need to build all the examples featured in this tutorial. As a reference, I'm providing links to Amazon US and UK for all of them (disclaimer: my Amazon affiliate link is embedded in these links), but you do not need to buy the exact products I'm linking. There are many manufacturers for these components, so use the links I provide as a reference and then if you prefer, buy your components from your favorite retailer. If you want a recommendation other than Amazon, Ebay is also a great place to shop for electronic components, and you'll probably find better prices.

Microcontroller

MicroPython runs on a few different types of microcontrollers, but for this tutorial I'm going to work with just one model: the ESP8266. Note that there are a few different boards that you can buy with the same chip. The model that you want to get is the one informally referred to as "development board", and more formally known with the ESP-12 model name. These boards come with the microcontroller mounted on it, a small printed Wi-Fi antenna, a micro-USB input for power and programming, and 30 pins that insert straight into a breadboard.

The cost of these devices is so low that you are going to find that most sellers offer them in pairs or in four-packs. I recommend that you do order at least two.

ESP8266

Buy from Amazon US - Buy from Amazon UK

Temperarure and Humidity Sensor

To demonstrate how to work with sensors, I'm going to use a DHT22 temperature and humidity sensor. This little device reads and reports the temperature and humidity levels in the environment. Depending on where you buy it, you may find models that come with three or four pins. Both are fine for this tutorial.

ESP8266

Buy from Amazon US - Buy from Amazon UK

Screen

Some of the examples will display information on a small 128x64 pixel OLED screen. Once again, these are so cheap that you may want to get a few.

ESP8266

Buy from Amazon US - Buy from Amazon UK

Push Button

Some of the examples will be triggered by a button push. You are not going to need more than one button at a time for this tutorial, but as with the above you may want to also get a pack, since buttons are always handy to have.

ESP8266

Buy from Amazon US - Buy from Amazon UK

Breadboard and Jumper Wires

To be able to easily build and take apart your circuits without soldering, you are going to need a breadboard and some jumper wires. I recommend that you get more than one breadboard as well.

ESP8266

Buy from Amazon US - Buy from Amazon UK

USB to MicroUSB Cable

You will need a USB cable to connect your microcontroller to your computer. This is going to provide power, and also a serial connection through which you'll upload code into the microcontroller memory. This is the same cable that charge most Android phones, so you may already have one you can use.

ESP8266

Buy from Amazon US - Buy from Amazon UK

Power Bank (Optional)

A power bank is not required for this tutorial, but if you have one, you will be able to use it to power your microcontroller independently of the computer after you have uploaded your code.

Let's Build Some Stuff!

Once you have the materials listed above you are ready to move on to the next chapter and start building stuff!

Become a Patron!

Hello, and thank you for visiting my blog! If you enjoyed this article, please consider supporting my work on this blog on Patreon!

8 comments
  • #1 Jeff Gustafsson said

    Miguel,

    I tried quite a few of the Amazon purchase links on this page & none of them are connecting without error to Amazon.

  • #2 Miguel Grinberg said

    Jeff: Maybe it was a temporary glitch. I tested a few of the links and they seem to be working now.

  • #3 Pablo Fernandez said

    Miguel, un gusto en saludarte.
    Como va tanto tiempo !!!
    Comencé a investigar en IoT y en dicha búsqueda encontré tu huella ...
    Un placer enorme volver a encontrarte.
    Muy interesante los proyectos en los que estás embarcado.

    Te mando un fuerte abrazo !!!
    Seguimos en contacto.

  • #4 Kealan McCusker said

    HI Miguel Could you please update the purchase links as non of them work for the UK.

  • #5 Miguel Grinberg said

    @Kealan: these links are included just for reference, they are not intended to be an accurate purchase list. Using the images and the item names you should be able to find equivalent items in Amazon, Ebay or other shops.

  • #6 David Ransier said

    Hi, Miguel, none of the product links are working in Kindle, though most are working in your blog. The one that is failing for me is the microcontroller. Can you please provide either an URL or a product description for Amazon. There are so many similar products to choose from and I want to be sure to get the correct one. -Thanks (David R)

  • #7 Miguel Grinberg said

    @David: There are a ton of variants currently on Amazon, so by no means this is the only/best link, but here is one: link.

    Hey, are you Ensequence David? Awesome to cross paths with you again if you are!

  • #8 David Ransier said

    Thanks, and yes, that David. It was fun discovering your books, and you again. Very nice running into you!!

Leave a Comment