Skip to main content

Case 6: Wind Power Generation


Introduction

Tilt the micro:bit V2 board to control the "wind strength" — the greater the tilt angle, the stronger the wind, and the faster the 360° building-block servo drives the wind turbine blades. When the board is placed flat (no-wind state), the blades stop rotating. The built-in accelerometer senses the tilt angle and adjusts rotation speed in real time, simulating a wind turbine operating in response to changing wind conditions.


Learning Objectives

  1. Learn about wind turbines and understand the basic principle of converting wind energy into electrical energy.
  2. Learn about the micro:bit V2's accelerometer — a MEMS sensor capable of detecting tilt angle and motion state.
  3. Understand the difference between gyroscopes and accelerometers and their respective applications in daily life.
  4. Learn multi-condition branching (if-else if-else) — categorizing wind levels based on tilt angle and executing different rotation speeds for each level.
  5. Understand the important role of wind energy in the history of human energy utilization.

Required Materials

ItemImageQuantity
micro:bit V21
Jacdac Expansion Board1
Jacdac 25cm Connector Cable1
Jacdac Servo Module1
360° Building-Block Servo1
USB Cable1

Sensor Principle

This case uses the built-in accelerometer of the micro:bit V2 as the sensor. It detects the board's tilt angle (pitch direction) and maps the tilt angle to different wind levels with corresponding servo speeds.

Assembly Steps


Model Principle

Wind Turbine — Capturing the Energy of the Wind

A wind turbine consists of three major parts: the tower, blades, and nacelle (housing the generator). The wind pushes the blades to rotate, transmitting rotational kinetic energy through the main shaft to the generator, which uses electromagnetic induction to convert kinetic energy into electrical energy. In simple terms:

Wind energy → Blade rotation (kinetic energy) → Gearbox speed change → Generator rotation → Electromagnetic induction → Electrical energy

The faster the blades spin, the greater the generator's power output. A single modern large wind turbine (10 MW) operating at full capacity can generate 10,000 kWh per hour — enough to power an average household for about 3 years.


Connection Diagram

As shown below, insert the micro:bit V2 board into the Jacdac expansion board, and connect the servo module to the Jacdac expansion board's edge connector.

Connection Diagram


Programming Software

Microsoft MakeCode


MakeCode Programming

Step 1: Adding the Jacdac Extension

  1. Go to Microsoft MakeCode and click "New Project".

    New Project

  2. Enter a project name in the pop-up window and click "Create".

    Create Project

  3. Click "Extensions" in the code drawer.

    Extensions

  4. In the pop-up interface, type "Jacdac" and click the search icon, then select the Jacdac software library as shown.

    Search Jacdac


Step 2: Connecting the Hardware

  1. Use a USB cable to connect the micro:bit V2 board to the computer.

    Note: If this is the first time running a Jacdac program on the micro:bit V2, please pre-load a blank Jacdac program onto the board first. Otherwise, skip this step.

    Connect micro:bit

  2. Connect the sensor. MakeCode will automatically detect and simulate it in the simulator area, where sensor status is displayed in real time.

    Sensor Simulation

  3. Click "ADD BLOCKS" to add the sensor extension module.

    Note: When connecting a new sensor, repeat the "click 'ADD BLOCKS'" workflow once.

    ADD BLOCKS


Write the Program as Shown

Program Screenshot


https://makecode.microbit.org/_5uu7PU2ojFTc

You can also download the program directly from the webpage below. Once downloaded, you can start running the program.


Result

When the micro:bit V2 board is placed horizontally, the servo is stationary — no-wind state. Tilt the board slightly forward (small angle), and the servo rotates at low speed — a gentle breeze. Increase the tilt to a medium angle, and the servo rotates at medium speed — the wind picks up. Tilt it steeply, and the servo rotates at high speed — strong wind incoming. The tilt angle determines the "wind strength" and blade speed in real time.


Think

  1. Besides tilt detection, what other motions can an accelerometer sense? (Hint: shaking, free fall)
  2. If you attached the micro:bit to a spinning bicycle wheel, how would the accelerometer readings change?

Program Logic

Trigger ConditionActionSource
Board horizontal (minimal tilt)Servo stationary — no-wind statemicro:bit Accelerometer
Slight tilt (small angle)Servo rotates at low speed — gentle breezemicro:bit Accelerometer
Medium tiltServo rotates at medium speed — wind strengtheningmicro:bit Accelerometer
Steep tiltServo rotates at high speed — strong windmicro:bit Accelerometer

Knowledge Extension: Wind Energy — A Ten-Thousand-Year Journey from Sailboats to Offshore Wind Farms

I. Wind — Humanity's Earliest "Free Energy"

Before coal and oil were discovered, wind and water were the only two forms of natural power that humans could harness at scale. The history of wind energy utilization is almost as long as human civilization itself:

PeriodWind Energy ApplicationRepresentative Example
~5000 BCEWind-powered sailingAncient Egyptian Nile sailboats
~200 BCEWind-powered water liftingPersian (Iranian) vertical-axis windmills
7th–13th century CEWindmill drainage & grindingPersian windmills spread westward → European windmills, Chinese vertical-sail windmills
12th centuryEuropean windmill proliferationDutch windmills for drainage and land reclamation (see Windmill Case)
1887–1888First wind turbine generatorsJames Blyth (Scotland) built one for his holiday home; Charles Brush (USA) built a 12 kW turbine
1941First megawatt-class wind turbineSmith-Putnam turbine, Vermont, USA, 1.25 MW
1970sOil crisis spurs wind power revivalDenmark leads large-scale deployment
1991World's first offshore wind farmVindeby, Denmark — 11 × 450 kW turbines
2025Global wind capacity reaches 1,299 GW57 countries built new wind projects; China's installed capacity exceeds 520 GW

II. How a Wind Turbine Works

A modern wind turbine consists of the following key components:

                        ┌──────────────────────────────┐
│ Wind Turbine Structure │
└──────────────┬───────────────┘

┌─────────┐ ┌────────┐ ┌───────┴───────┐ ┌──────────┐
│ Blades │ │Nacelle │ │ Tower │ │Foundation│
└────┬────┘ └───┬────┘ └───────────────┘ └──────────┘
│ │
┌─────┴─────┐ ┌──┴──────────────┐
│Wind pushes│ │Gearbox→Generator│
│rotation │ │Kinetic→Electric │
│Up to 140m+│ │Yaw system→align │
└───────────┘ └─────────────────┘
ComponentFunctionInteresting Fact
BladesCapture wind energy, convert wind kinetic energy into rotational kinetic energyModern blades can exceed 140 meters in length — longer than a football field
Nacelle (housing generator)Convert rotational kinetic energy into electrical energyContains a yaw system that automatically rotates the nacelle to face the wind
TowerElevates the turbine to capture stronger, more stable winds at altitudeModern tower heights can reach 140 meters — about 50 stories tall
FoundationSecurely anchors the entire structureOffshore turbine foundations can weigh thousands of tons — equivalent to a small warship

Key Data: A single 10 MW offshore wind turbine's blades take about 4–5 seconds per rotation, but each rotation generates approximately 15 kWh of electricity. At that rate, one turbine can generate about 40 million kWh annually — enough to power roughly 12,000 Chinese households for an entire year.


III. Wind Power — A Vanguard of the Global Energy Transition

Key Data PointValue
2025 global new wind installations165 GW, up 40% year-on-year — a historic record
End-2025 global cumulative wind capacity~1,299 GW
2024 global wind electricity generation2,494 TWh, 8.1% of global electricity
World's largest wind power countryChina (520 GW, ~40% of global total)
World's largest offshore wind farmDogger Bank, UK (planned total capacity 3.6 GW)
World's largest single wind turbineMingyang MySE 18.X-20MW (China, already rolled off production line)
2024 wind industry employment~1.6 million people globally
57 countriesBuilt new wind projects in 2025

In 2024, Denmark generated approximately 55% of its electricity from wind power — the highest share globally. Ireland (36%), Uruguay (35%), and Portugal (29%) followed closely. In these countries, one out of every three kilowatt-hours comes from the gift of the wind.


IV. The Future of Wind — How Much Potential Remains

ProspectDescription
Floating offshore windTraditional offshore turbines require seabed fixation (water depth < 60 m). Floating turbines can be deployed in deep water (> 60 m), multiplying the accessible wind resource several-fold. Japan, Norway, and Scotland have built demonstration projects.
High-altitude wind energyAt 300–500 m altitude, wind speeds are 2–3× higher and more stable than at ground level. Multiple companies are developing tethered kite/drone power generation systems, replacing heavy towers with lightweight tethers.
Turbine blade recyclingEarly fiberglass blades were difficult to recycle after decommissioning. From 2025, multiple manufacturers have started introducing recyclable blades whose materials can be reused after retirement.
Wind + energy storageWind is intermittent? Pair it with large-scale battery storage or hydrogen production (using surplus wind power for electrolysis to produce hydrogen) to "shave peaks and fill valleys," making wind power available 24/7.

According to IEA projections, by 2050, wind and solar together will provide approximately 70% of global electricity. The tiny servo-driven blades you control on the micro:bit today could one day grow into giant rotors over 200 meters in diameter sweeping across the sea surface. The wind keeps blowing — the key is whether we are ready to capture it.