Micro:bit Related ProductsJacdac SeriesJacdac Energy Practice KitCase 2: Rice Pounding MachineOn this pageCase 2: Rice Pounding MachineIntroductionPress button A on the micro:bit V2 board, and the 360° building-block servo rotates at full speed (-100) to drive a cam mechanism, simulating the reciprocating pounding motion of an ancient rice pounding machine (water-powered trip hammer). Press button B, and the servo stops rotating.Learning ObjectivesLearn about the rice pounding machine (water-powered trip hammer / shuǐ duì) — an ancient mechanical device that uses water power to process grain.Understand event-driven programming — using button A and button B to control the start and stop of the servo respectively.Understand the cam mechanism — the mechanical principle of converting rotational motion into reciprocating linear motion.Explore the history of ancient grain processing and humanity's ingenious use of water power.Required MaterialsItemImageQuantitymicro:bit V21Jacdac Expansion Board1Jacdac 25cm Connector Cable1Jacdac Servo Module1360° Building-Block Servo1USB Cable1Sensor 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.Assembly StepsModel Principle360° Building-Block Servo and the Cam MechanismThe 360° building-block servo provides continuous rotational power. The cam mounted on the servo's output shaft is an irregular disc with a protruding lobe. As the cam rotates, its protruding part periodically lifts the pounder (follower). After the cam lobe rotates past, the pounder drops under gravity, striking the grain inside the stone mortar. Thus, with each full rotation of the servo, the pounder completes one cycle of "lift → drop → pound."PhaseMotionMechanical Principle① Cam riseCam lobe lifts the pounderRotation → Ascent② Pounder liftPounder raised to highest pointPotential energy accumulation③ Cam returnCam lobe rotates awaySupport removed④ Pounder dropPounder falls under gravity into mortarPotential → Kinetic → Impact force⑤ Cycle repeatCam keeps rotating, next pounding cycle beginsContinuous rotation → Intermittent impactCore Principle: The cam mechanism is one of the most classic mechanical structures for converting continuous rotational motion into intermittent reciprocating linear motion.The Rice Pounding Machine (Water-Powered Trip Hammer / Shuǐ Duì)The rice pounding machine, known in ancient China as "duì" (碓), was originally a human-powered foot-operated dehusking tool — a person stepped on a pedal to lift the hammer head, and when the foot was released, the hammer head dropped into the stone mortar to pound grain. In the late Western Han Dynasty (~1st century CE), the Chinese invented the water-powered trip hammer (shuǐ duì) — using flowing water to turn a waterwheel, whose axle-mounted paddles intermittently pressed down on the hammer lever, achieving automatic rice pounding. During the Three Kingdoms period (260–270 CE), Du Yu invented the linked trip hammer (lián jī duì) — a single waterwheel could simultaneously drive 4–12 hammer heads, increasing efficiency by more than tenfold.Connection DiagramAs shown below, insert the micro:bit V2 board into the Jacdac expansion board, and use a cable to 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 the 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/_R8wF0r2ktJR5You 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 cam mechanism. The pounder begins reciprocating up and down, simulating the water-powered trip hammer starting operation. Press button B, and the building-block servo stops rotating and the pounder stops pounding — simulating the closing of the sluice gate and the waterwheel coming to a halt.ThinkBesides pounding rice, what other applications of the cam mechanism can you find in daily life? (Hint: look at sewing machines, engine valves)If you wanted the pounder to strike with more force, how could you modify the shape of the cam?Program LogicTrigger ConditionActionSourceButton A pressed360° building-block servo rotates at full speed (-100), driving the cam mechanism; pounder begins reciprocating up and downmicro:bit Button AButton B pressed360° building-block servo stops rotating; pounder stops poundingmicro:bit Button BKnowledge Extension: From Manual Pounding to Water-Powered Automation — The Millennia-Long Evolution of Grain ProcessingI. The Journey of a Grain of Rice — Why Do Humans "Pound" Rice?Rice harvested from the field cannot be eaten directly. Each grain of rice is encased in a hard husk (chaff) that must be removed before the edible grain is obtained. In ancient times without machines, humans first used stones to smash and wooden sticks to pound. Later, they invented the mortar and pestle (chǔ jiù) — a stone mortar paired with a wooden pestle, manually pounded up and down to remove the husk.Processing MethodApproximate EraEfficiency (per person/day)Labor IntensityStone smashing / hand peelingNeolithic (~10,000 years ago)~5–10 kgExtremely highMortar and pestle (handheld)~5,000 years ago~15–20 kgVery highFoot-operated trip hammerWarring States (~400 BCE)~50–80 kgHighWater-powered trip hammer (single head)Late Western Han (~1st century CE)~150–300 kgVery low (automated)Linked trip hammer (4–12 heads)Three Kingdoms (260 CE)~600–3,600 kgVery low (automated)Modern rice millLate 19th century–presentSeveral tons per hourZero (fully automatic)From mortar-and-pestle to linked trip hammer, efficiency increased by over 300 times. The water-powered trip hammer is one of the earliest great inventions in human history to achieve "production automation."II. The Water-Powered Trip Hammer — Ancient China's "Smart Factory"The water-powered trip hammer is hailed as one of the most ingenious water-powered machines of antiquity, integrating three core technologies: ┌─────────────────────────┐ │ Trip Hammer System │ └──────────┬──────────────┘ ┌───────────────────────┼───────────────────────┐ ▼ ▼ ▼ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ │ Power Section │ │ Transmission │ │ Work Section │ │ (Waterwheel) │ ──► │ (Axle+Board) │ ──► │ (Lever+Head) │ └───────────────┘ └───────────────┘ └───────────────┘ Water flow turns Paddles on axle Paddle pushes lever the waterwheel intermittently tail down; head Potential→Kinetic push the lever rises→drops under (Nature's input) (Rotation→Recip.) gravity (impact)Technical ElementCorresponding PrincipleImplementation in This CaseWaterwheel rotationHydraulic → Rotational kinetic energy360° building-block servo rotationPaddle / CamRotation → Reciprocating linear motionCam mechanismPounder impactGravity-driven drop impactFree drop after cam riseWater flow controls speedInput energy regulationMicrophone sound level → RPM mappingIII. The Impact of Water-Powered Trip Hammers on Ancient SocietyPopulation growth support: During the Southern Dynasties, the widespread adoption of trip hammers dramatically increased grain processing efficiency, supporting rapid population growth in the Jiangnan region. Historical records indicate that at its peak, the Gushui River basin near Luoyang alone hosted dozens of trip hammers.Rice price reduction: Western Jin dynasty documents record that after the spread of trip hammers, rice prices in the Luoyang area fell by about 30%, significantly reducing living costs for ordinary people.Expanded applications: Trip hammers were not only used for pounding rice, but also for crushing medicinal herbs, grinding spices, pounding porcelain clay (ceramic raw material), pulping paper material, and crushing ores — truly the ancient "universal pulverizer."Living heritage: At its peak, the Cangnan Wanyao Village in Zhejiang had over a hundred trip hammers for pounding porcelain clay. In mountainous regions of Fujian, Jiangxi, and Hunan, trip hammers were still in normal use as late as the 1990s.IV. Humanity's Ingenious Use of Water Energy Through the AgesPeriodWater Energy ApplicationRepresentative Invention~4000 BCEWater transportAncient Egyptian Nile sailboats1st century BCEWater liftingGreek Archimedes' screw pump1st century CEWater-powered grain poundingChinese water-powered trip hammer1st century CEWater-powered grindingGreek/Roman water mill3rd century CEWater-powered bellowsChinese water-powered blast furnace bellows3rd–4th century CEWater-powered spinningChinese water-powered spinning wheelLate 19th centuryHydroelectric powerWorld's first hydroelectric station (Wisconsin, USA, 1882)21st centuryPumped storage / Tidal energyThree Gorges Dam (22,500 MW), offshore tidal power stationsAs of 2024, hydropower remains the world's largest source of renewable electricity, accounting for approximately 14.3% of global electricity generation and providing clean power to over 1 billion people. And it all traces back to a flash of inspiration two thousand years ago, when an ancient Chinese person facing a small stream thought: "Why not let the flowing water pound the rice for us?"V. The Loop — From Mechanism to ProgramThe working rhythm of the water-powered trip hammer embodies the profound wisdom of the "loop":Mechanical Loop (Trip Hammer)Program Loop (This Case's Code)Power sourceWater continuously striking the waterwheelLoop block repeatedly executing codeRepetition unitOne waterwheel revolution = one poundOne loop iteration = read sound + adjust speedRegulation mechanismMore water → faster wheel → higher pounding frequencyButton A pressed → servo full speed → higher pounding frequencyStop conditionClose sluice gate to block water flowButton B pressed → servo stopsReflection: Ancient craftsmen achieved "automated loops" with mechanisms; today's programmers achieve "program loops" with code. Two millennia of technological progress share the same underlying logic: discover repetition → build loops → continuously optimize. The rice pounding program you are writing continues this millennia-spanning engineering wisdom.