r/microbit • • 4h ago

We Built a Working Bascule Bridge with micro:bit – Boats Go Under, Pedestrians Go Over!

8 Upvotes

Imagine a small river running between two banks. Most of the time, people can simply walk across a bridge. But when a boat comes along, the bridge needs to lift up and let it pass. Once the boat is through, the bridge comes back down and pedestrians can cross again.

We wanted to recreate that idea with building blocks, so we made this tabletop bascule bridge using a micro:bit, a Nezha Pro Breakout Board, and parts from the Nezha Pro Sport Kit.

The bridge has a single lifting deck. One end is connected to a Smart Brick Motor on the left bank, while the other end rests on a support platform when the bridge is lowered. The motor rotates the deck around its pivot, lifting the free end to create space for boats to pass underneath.

What makes the project interesting is that the bridge doesn't just move up and down on command. It has different operating states, and the micro:bit tells you what is happening.

When the bridge is lowered, pressing A starts the opening sequence. The screen scrolls OPEN, followed by a 3-second countdown. The motor then turns 90 degrees counterclockwise to raise the deck. Once it reaches the open position, the display shows BOAT GO with a boat icon.

While the bridge is open, pressing A records a boat passing through. The micro:bit keeps a running boat count, so you can see how many boats have used the waterway. When all the boats have passed, pressing B starts the closing sequence. After another countdown, the motor rotates 90 degrees clockwise to lower the deck. The display then changes to WALK GO with a pedestrian icon.

We also wanted the movement to look a little more realistic. Instead of rotating the motor at one constant speed, the program divides the movement into two stages: the first 75 degrees run at speed setting 12, while the final 15 degrees slow down to speed setting 6. This makes the bridge approach its final position more gently rather than moving at the same speed all the way through.

There is one important detail before the bridge can operate: the program needs to know its actual starting position. When powered on, the player must confirm whether the deck is already open or closed. This is done through a simple calibration menu using the A and B buttons. It might seem like a small step, but it prevents the motor from trying to move the bridge in the wrong direction based on an incorrect starting assumption.

We also added a safety check. If the motor doesn't reach the requested angle within 30 seconds, the program stops it and displays ERR instead of continuing to issue movement commands.

The whole build uses just one motor, but there is quite a bit going on behind the scenes: angle-based motor control, different movement speeds, button input, state management, countdowns, and boat counting.

I like that this project turns a simple mechanical model into something you can actually operate and play with. You can even have two people take different roles: one controls the bridge, while the other moves paper boats and little figures across the scene.

If you were adding another feature, would you build a traffic light system, add a boat detection sensor, or make the bridge open automatically when a boat approaches?