Micro:bit Related ProductsJacdac SeriesJacdac Energy Practice KitCase 10: Solar-Powered FanOn this pageCase 10: Solar-Powered FanIntroductionUse the LED matrix light-sensing function of the micro:bit V2 board to detect ambient light intensity in real time. The stronger the light, the faster the 360° building-block servo drives the fan blades (minimum 20%, maximum 100% speed). The weaker the light, the slower the rotation. In complete darkness, the fan runs at a minimum speed of 20% (simulating standby mode). This simulates a solar-powered fan — the stronger the sunlight, the faster the fan spins.Learning ObjectivesLearn about the micro:bit LED matrix light-sensing function — LEDs repurposed as light sensors.Understand automatic control — light intensity automatically adjusts fan speed in real time.Explore real-world solar energy applications — solar-powered fans, solar streetlights, etc.Learn data mapping — mapping light level values (0–255) to servo speed for smooth speed regulation.Required MaterialsItemImageQuantitymicro:bit V21Jacdac Expansion Board1Jacdac 25cm Connector Cable1Jacdac Servo Module1360° Building-Block Servo1USB Cable1Assembly StepsModel Principle360° Building-Block Servo and the Solar-Powered FanThe 360° building-block servo provides continuous rotational power, driving the fan blades to generate airflow. The servo speed is adjusted in real time based on ambient light intensity — the stronger the light, the faster the rotation, simulating the causal chain of "more sunlight received by the solar panel → greater electrical power output → faster fan speed."Solar-Powered Fan — Turning Sunlight into a Cool BreezeA solar-powered fan consists of three parts: solar panel + motor + fan blades. The solar panel (photovoltaic panel) converts sunlight into electrical energy, which drives the motor to spin the fan blades. It requires no batteries or external power source — as long as there is sunlight, it works. It is a model of "zero-carbon" clean energy application. Small fans on sun hats, outdoor solar exhaust fans, and solar car radiator fans all use this principle.Sunlight → PV Panel (light→electricity) → Motor rotation (electricity→kinetic) → Fan blades push air → Cool breezeSensor PrincipleThis case uses the micro:bit V2 board's LED matrix light-sensing function as the sensor. Besides displaying patterns, the micro:bit's LED matrix can be repurposed as a light sensor — by measuring the reverse leakage current of the LEDs to sense ambient light intensity. Light level values range from 0 to 255 (0 = darkest, 255 = brightest). The program uses the map function to map light values to servo speed (20–100), achieving automatic speed regulation where stronger light results in faster fan rotation.Connection DiagramAs 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.Programming SoftwareMicrosoft MakeCodeMakeCode ProgrammingStep 1: Adding the Jacdac ExtensionGo to Microsoft MakeCode and click "New Project".Enter a project name in the pop-up window and click "Create".Click "Extensions" in the code drawer.In the pop-up interface, type "Jacdac" and click the search icon, then select the Jacdac software library as shown.Step 2: Connecting the HardwareUse 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 the sensor. MakeCode will automatically detect and simulate it in the simulator area, where sensor status is displayed in real time.Click "ADD BLOCKS" to add the sensor extension module.Note: When connecting a new sensor, repeat the "click 'ADD BLOCKS'" workflow once.Write the Program as ShownReference Program Link📎https://makecode.microbit.org/_2aFbbrEteHf1You can also download the program directly from the webpage below. Once downloaded, you can start running the program.ResultWhen shining a flashlight or phone flashlight on the micro:bit V2's LED matrix, the fan blades spin at high speed (up to 100%) — the stronger the sunlight, the stronger the wind. When covering the LED matrix with your hand (simulating an overcast day), the fan speed automatically drops to the minimum ~20%. After removing the cover, the fan speed immediately picks back up. Light intensity determines fan speed in real time, with no manual operation needed.ThinkIf you wanted the fan to automatically shut off when light drops below a certain threshold (to protect the motor from repeated low-speed starts), how could you improve the program?Why do real solar products (like solar streetlights, solar power banks) typically come equipped with a rechargeable battery?Program LogicTrigger ConditionActionSourceLight intensity changes (continuous detection)Maps light value (0–255) to servo speed (20–100); stronger light → faster speed, weaker light → slower speedmicro:bit LED Matrix light sensingComplete darkness (light value ≈ 0)Servo runs at minimum 20% speed (simulating standby)micro:bit LED Matrix light sensingStrong light exposure (light value ≈ 255)Servo runs at maximum 100% full speedmicro:bit LED Matrix light sensingKnowledge Extension: Solar Energy — The Most "Generous" Free Energy on EarthI. Just How "Generous" Is Solar Energy?The Earth receives as much energy from the Sun in 1.5 hours as the entire human race consumes in a full year. Every second, the Sun releases approximately 3.8×10²⁶ watts through nuclear fusion, of which about 1.7×10¹⁷ watts reaches the top of Earth's atmosphere — one hundred thousand times the total energy content of all fossil fuel reserves on Earth.Key Data PointValue2025 global solar installed capacity~2,900 GW2025 global new solar installations647 GW, 79% of global new renewable capacity2024 global solar electricity generation2,132 TWh, 6.9% of global electricitySolar module price (2024)~$0.10/watt, down ~45% in one yearPV module price reduction over the past decade~90%II. Everyday Applications of Solar ProductsSolar energy is not just for large power stations — it has become deeply integrated into our daily lives:ProductPrincipleTypical PowerSolar calculatorTiny PV panel drives LCD display< 0.01 WSolar fan hatPV panel → small motor → fan0.5–2 WSolar streetlightDaytime PV charging → battery → nighttime LED lighting20–100 WSolar power bankFoldable PV panel → charging circuit → USB output5–28 WHome rooftop solarPV array → inverter → home use + grid feed-in3–10 kWIII. The Wisdom of Automatic ControlThis case demonstrates the concept of pure automatic control — the micro:bit's LED matrix light sensor detects ambient light intensity in real time, and the program automatically maps the light value to fan speed, requiring no manual intervention. Stronger light → faster fan; weaker light → slower fan; complete darkness → fan runs at minimum speed (simulating standby).The core advantage of automatic control is "no human intervention needed" — the system senses environmental changes through sensors, makes decisions autonomously via the program, and drives actuators to act. This closed-loop logic of "sense → decide → act" is the foundation of all intelligent systems, from thermostats to self-driving cars. Real solar products (such as solar streetlights and solar exhaust fans) rely on precisely this automatic control logic to achieve 24/7 unattended operation.