Micro:bit Related ProductsJacdac SeriesJacdac Energy Practice KitCase 8: Oil PumpOn this pageCase 8: Oil PumpIntroductionPress button A on the micro:bit V2 board, and the 360° building-block servo rotates at full speed (100), simulating a beam pumping unit (nodding donkey oil pump) in continuous operation extracting oil. Press button B, and the servo stops rotating, simulating pump shutdown.Learning ObjectivesLearn about the servo module.Learn about the button A and button B blocks in MakeCode — triggering different servo actions via different button presses.Understand what petroleum is.Required MaterialsItemImageQuantitymicro:bit V21Jacdac Expansion Board1Jacdac 25cm Connector Cable1Jacdac Servo Module1360° Building-Block Servo1USB Cable1Assembly StepsModel PrincipleServo Module (360° Continuous Rotation Servo)The servo module (360° continuous rotation servo) is a motor module that can rotate continuously through 360°. Its rotation speed and direction are adjusted via control signals, rather than being fixed at a specific angle like a standard servo. It is commonly used for driving robot wheels, conveyor belts, and simulating reciprocating mechanical motion.Beam Pumping Unit (Nodding Donkey)The beam pumping unit (walking beam pump) is one of the primary oil extraction devices in oilfields. Driven by an electric motor, it causes the walking beam to oscillate up and down, which in turn drives the sucker rod to pump underground oil to the surface. Its appearance and motion resemble a "nodding" or "kowtowing" action, hence the nickname "nodding donkey."Fun Fact: Petroleum is a fossil fuel buried deep underground, formed from the remains of ancient organisms over millions of years of geological processes. It is known as the "blood of industry" and serves as a key raw material for gasoline, diesel, plastics, synthetic fibers, and many other products.Sensor PrincipleThis case does not use an external sensor module; control is achieved entirely through the built-in button A and button B of the micro:bit V2 board.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 Linkhttps://makecode.microbit.org/_eA4Pg13sPaj0You can also download the program directly from the webpage below. Once downloaded, you can start running the program.ResultPress button A on the micro:bit V2 board, and the 360° building-block servo rotates at full speed, driving the walking beam to oscillate up and down, simulating a beam pumping unit continuously extracting oil. Press button B, and the servo stops rotating, simulating pump shutdown.ThinkWhat other scenarios in daily life can a servo be applied to?Besides the beam pumping unit, what other oil extraction equipment do you know of?Program LogicTrigger ConditionActionSourceButton A pressed360° building-block servo rotates continuously at full speed (100) in a single direction, simulating oil pump operationmicro:bit Button AButton B pressed360° building-block servo stops rotating, simulating pump shutdownmicro:bit Button BKnowledge Extension: Petroleum and Our FutureI. Petroleum — The "Blood" of Modern CivilizationPetroleum is not just a source of gasoline and diesel — it permeates every corner of modern life:Petroleum ProductEveryday UsesGasoline, diesel, jet fuelFuel for cars, trucks, airplanes, shipsPlastics (polyethylene, polypropylene, etc.)Phone cases, stationery, toys, packaging, water pipesSynthetic fibers (polyester, acrylic, nylon)Clothing, backpacks, sneakers, carpetsFertilizers, pesticidesAgricultural production, ensuring food supplyAsphaltRoad and airport runway pavingSynthetic rubberTires, seals, shoe solesPharmaceuticals, cosmeticsAspirin, petroleum jelly, lipstick, shampooThe Numbers: In 2024, the world consumed approximately 103 million barrels of oil per day, totaling about 37.4 billion barrels for the year. Since 1900, humanity has extracted approximately 1.57 trillion barrels of oil. Petroleum accounts for 32% of global fossil fuel carbon emissions, second only to coal (41%).II. The Real Challenges We Face⚠️ Challenge 1: Finite ResourcesKey Data PointValueGlobal proven oil reserves~1.73 trillion barrelsYears of extraction remaining at current rate~47 yearsThis means: at current consumption rates, proven oil reserves will only last until around 2070. While technological advances continue to discover new oil fields, exploration is becoming increasingly difficult and costly.⚠️ Challenge 2: Climate and Environmental Crisis2024 global fossil fuel carbon emissions reached a record 37.4 billion tons, up 0.8% year-on-year.Oil spills from extraction (e.g., offshore platform blowouts) cause devastating damage to marine ecosystems.Plastic pollution is staggering: approximately 8 million tons of plastic enter the ocean each year — equivalent to dumping one truckload of plastic waste into the sea every minute.Wastewater and exhaust emissions from petrochemical production threaten water sources and air quality.⚠️ Challenge 3: Geopolitics and Energy SecurityOil resources are extremely unevenly distributed, with the Middle East (Saudi Arabia, Iraq, Kuwait, etc.) holding nearly half of the world's proven reserves. When conflict or political instability erupts in oil-producing regions, global oil prices fluctuate violently, directly affecting every country's economic development and every person's cost of living.III. A Glimmer of Hope — The Energy Transition UnderwayFacing these challenges, the world is rapidly embracing clean energy. The good news: change is already happening.☀️ Solar Power: The Fastest-Growing Energy SourceYearGlobal New Solar InstallationsCumulative Capacity2024582 GW2.25 TW2025647 GW~2.9 TW2024 global solar electricity generation reached 2,132 TWh, 6.9% of global electricity.Solar module prices plunged ~45% in the past year to just ~$0.10 per watt.99 countries have doubled their solar capacity in the past five years; 23 countries now get over 10% of their electricity from solar (Hungary leads globally at 25%).💨 Wind Power: A Strong Comeback2025 global new wind installations: 167 GW, up 47% year-on-year; cumulative ~1,300 GW.2024 global wind electricity generation: 2,494 TWh, 8.1% of global electricity.Wind + solar combined directly contributed ~15% of global electricity in 2024 (~31.9% if all renewables including hydro are counted).🚗 Electric Vehicles: Rewriting Oil DemandMass adoption of new energy vehicles is reducing transportation's dependence on oil at the source.2024 global EV sales (including plug-in hybrids) exceeded 17 million units, up ~25% year-on-year. The electrification wave is accelerating globally.IV. What We Can DoFacing the dual challenges of oil depletion and environmental crisis, everyone can contribute:DirectionConcrete ActionsSave energyTurn off lights when leaving, set AC reasonably (≥26°C in summer), choose public transport, cycling, or walkingReduce plastic useBring your own water bottle and shopping bags, refuse single-use plastics, practice proper waste sortingSupport clean energyLearn about solar, wind, hydrogen, and other clean energy; share environmental awareness with those around youCultivate scientific interestStudy science seriously and consider future careers in energy technology, environmental protection, and innovationPractice low-carbon livingSave paper, finish your food, recycle — every small habit reduces your carbon footprint