Skip to content

Home

header

Welcome to the MicroPython Course! πŸ‘‹

This course is designed to provide you with a comprehensive introduction to building an IoT project with MicroPython on the ESP32. You will learn how to read sensor data, control a water pump, communicate via MQTT, and create a dashboard for remote monitoring - all through hands-on code examples!

Course overview

  1. Setup & Basics: Introduction to MicroPython, flashing the ESP32 with the firmware, setting up your development environment and learn the basics of MicroPython by controlling the onboard LED.
  2. Sensor Integration: Interface with a soil moisture sensor to monitor your plant’s water needs.
  3. Actuator Control: Learn to drive a pump (via a relay module) based on sensor readings.
  4. MQTT Communication: Transmit sensor data and receive remote commands using MQTT.
  5. Dashboard Development: Create an interactive dashboard to visualize sensor data and control your watering system.
graph LR
    subgraph TOP[ ]
        direction BT
            Cloud[Cloud Dashboard]
    end

    subgraph MID[ ]
        direction LR
            Sensors
            ESP32[ESP32 Basics]
            Actuators
    end

    Cloud <--MQTT--> ESP32
    Sensors --> ESP32
    ESP32 --> Actuators

    click ESP32 "./setup" _self
    click Sensors "./sensors" _self
    click Actuators "./actuator" _self
    click Cloud "./mqtt" _self


    %% Styling
    classDef active fill:#950f42,stroke:#333,stroke-width:1px;
    class MID subgraphBox;
    class TOP subgraphBox2;

    %% Subgraph styling workaround (pseudo-class)
    classDef subgraphBox fill:#ff000000,stroke:#950f42,stroke-width:2px,color:#fff;
    classDef subgraphBox2 fill:#ff000000,stroke:#950f42,stroke-width:0px,color:#fff;

Tools

In this course, we use MicroPython running on the ESP32 along with these great tools:


MicroPython Logo
Thonny
MQTT Logo
HiveMQ

Sneak peek

Here is a sneak peek of selected topics we cover in this course:

  • πŸ’‘ MicroPython Basics & LED Control


    Learn how to flash your ESP32 with MicroPython and start by blinking the onboard LED.

  • blink

  • blink

  • 🌱 Sensor Integration


    Read data from a soil moisture sensor to detect your plant’s water needs.

  • πŸ”Œ Pump Control


    Control a water pump (via a relay) to automate the irrigation process.

  • Water pump

  • LED Control

  • πŸ“‘ MQTT Communication


    Transmit sensor data and receive remote commands using MQTT for real-time control.

  • πŸ“ˆ Dashboard Development


    Build a user-friendly dashboard to monitor sensor readings and control the pump.

  • LED Control

Needed Hardware

The following hardware is needed for this course:

Expected outcome

By the end of this course, you will have built a complete smart plant watering system. You will know how to:

  • Monitor soil moisture using a sensor.
  • Automatically control a water pump based on sensor data.
  • Communicate with your device via MQTT.
  • Visualize data and interact with your system through a dashboard.

Let's get started! πŸš€